public class RaftJournalAppender extends Object implements Closeable
Constructor and Description |
---|
RaftJournalAppender(org.apache.ratis.server.RaftServer server,
java.util.function.Supplier<org.apache.ratis.client.RaftClient> clientSupplier,
org.apache.ratis.protocol.ClientId localClientId,
InstancedConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
CompletableFuture<org.apache.ratis.protocol.RaftClientReply> |
sendAsync(org.apache.ratis.protocol.Message message,
org.apache.ratis.util.TimeDuration timeout)
Sends a request to raft server asynchronously.
|
public RaftJournalAppender(org.apache.ratis.server.RaftServer server, java.util.function.Supplier<org.apache.ratis.client.RaftClient> clientSupplier, org.apache.ratis.protocol.ClientId localClientId, InstancedConfiguration configuration)
server
- the local raft serverclientSupplier
- a function for building a remote raft clientlocalClientId
- the client id for local requestsconfiguration
- the server configurationpublic CompletableFuture<org.apache.ratis.protocol.RaftClientReply> sendAsync(org.apache.ratis.protocol.Message message, org.apache.ratis.util.TimeDuration timeout) throws IOException
message
- the message to sendtimeout
- the time duration to wait before giving up on the requestIOException
- if an exception occured while sending the requestpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.