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) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
CompletableFuture<org.apache.ratis.protocol.RaftClientReply> |
sendAsync(org.apache.ratis.protocol.Message message)
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)
server
- the local raft serverclientSupplier
- a function for building a remote raft clientlocalClientId
- the client id for local requestspublic CompletableFuture<org.apache.ratis.protocol.RaftClientReply> sendAsync(org.apache.ratis.protocol.Message message) throws IOException
message
- the message to sendIOException
- if an exception occurred while sending the requestpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.