Package io.atomix.raft.partition.impl
Class RaftServerCommunicator
java.lang.Object
io.atomix.raft.partition.impl.RaftServerCommunicator
- All Implemented Interfaces:
RaftServerProtocol
Raft server protocol that uses a
ClusterCommunicationService.-
Constructor Summary
ConstructorsConstructorDescriptionRaftServerCommunicator(String prefix, Serializer serializer, ClusterCommunicationService clusterCommunicator, Duration requestTimeout) -
Method Summary
Modifier and TypeMethodDescriptionappend(MemberId memberId, AppendRequest request) Sends an append request to the given node.configure(MemberId memberId, ConfigureRequest request) Sends a configure request to the given node.install(MemberId memberId, InstallRequest request) Sends an install request to the given node.poll(MemberId memberId, PollRequest request) Sends a poll request to the given node.reconfigure(MemberId memberId, ReconfigureRequest request) Sends a reconfigure request to the given node.voidRegisters an append request callback.voidRegisters a configure request callback.voidRegisters a install request callback.voidRegisters a poll request callback.voidregisterReconfigureHandler(Function<ReconfigureRequest, CompletableFuture<ReconfigureResponse>> handler) Registers a reconfigure request callback.voidRegisters a transfer request callback.voidRegisters a vote request callback.transfer(MemberId memberId, TransferRequest request) Sends a transfer request to the given node.voidUnregisters the append request handler.voidUnregisters the configure request handler.voidUnregisters the install request handler.voidUnregisters the poll request handler.voidUnregisters the reconfigure request handler.voidUnregisters the transfer request handler.voidUnregisters the vote request handler.vote(MemberId memberId, VoteRequest request) Sends a vote request to the given node.
-
Constructor Details
-
RaftServerCommunicator
public RaftServerCommunicator(String prefix, Serializer serializer, ClusterCommunicationService clusterCommunicator, Duration requestTimeout)
-
-
Method Details
-
configure
Description copied from interface:RaftServerProtocolSends a configure request to the given node.- Specified by:
configurein interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
reconfigure
public CompletableFuture<ReconfigureResponse> reconfigure(MemberId memberId, ReconfigureRequest request) Description copied from interface:RaftServerProtocolSends a reconfigure request to the given node.- Specified by:
reconfigurein interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
install
Description copied from interface:RaftServerProtocolSends an install request to the given node.- Specified by:
installin interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
transfer
Description copied from interface:RaftServerProtocolSends a transfer request to the given node.- Specified by:
transferin interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
poll
Description copied from interface:RaftServerProtocolSends a poll request to the given node.- Specified by:
pollin interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
vote
Description copied from interface:RaftServerProtocolSends a vote request to the given node.- Specified by:
votein interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
append
Description copied from interface:RaftServerProtocolSends an append request to the given node.- Specified by:
appendin interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
registerTransferHandler
public void registerTransferHandler(Function<TransferRequest, CompletableFuture<TransferResponse>> handler) Description copied from interface:RaftServerProtocolRegisters a transfer request callback.- Specified by:
registerTransferHandlerin interfaceRaftServerProtocol- Parameters:
handler- the open session request handler to register
-
unregisterTransferHandler
public void unregisterTransferHandler()Description copied from interface:RaftServerProtocolUnregisters the transfer request handler.- Specified by:
unregisterTransferHandlerin interfaceRaftServerProtocol
-
registerConfigureHandler
public void registerConfigureHandler(Function<ConfigureRequest, CompletableFuture<ConfigureResponse>> handler) Description copied from interface:RaftServerProtocolRegisters a configure request callback.- Specified by:
registerConfigureHandlerin interfaceRaftServerProtocol- Parameters:
handler- the open session request handler to register
-
unregisterConfigureHandler
public void unregisterConfigureHandler()Description copied from interface:RaftServerProtocolUnregisters the configure request handler.- Specified by:
unregisterConfigureHandlerin interfaceRaftServerProtocol
-
registerReconfigureHandler
public void registerReconfigureHandler(Function<ReconfigureRequest, CompletableFuture<ReconfigureResponse>> handler) Description copied from interface:RaftServerProtocolRegisters a reconfigure request callback.- Specified by:
registerReconfigureHandlerin interfaceRaftServerProtocol- Parameters:
handler- the open session request handler to register
-
unregisterReconfigureHandler
public void unregisterReconfigureHandler()Description copied from interface:RaftServerProtocolUnregisters the reconfigure request handler.- Specified by:
unregisterReconfigureHandlerin interfaceRaftServerProtocol
-
registerInstallHandler
public void registerInstallHandler(Function<InstallRequest, CompletableFuture<InstallResponse>> handler) Description copied from interface:RaftServerProtocolRegisters a install request callback.- Specified by:
registerInstallHandlerin interfaceRaftServerProtocol- Parameters:
handler- the open session request handler to register
-
unregisterInstallHandler
public void unregisterInstallHandler()Description copied from interface:RaftServerProtocolUnregisters the install request handler.- Specified by:
unregisterInstallHandlerin interfaceRaftServerProtocol
-
registerPollHandler
Description copied from interface:RaftServerProtocolRegisters a poll request callback.- Specified by:
registerPollHandlerin interfaceRaftServerProtocol- Parameters:
handler- the open session request handler to register
-
unregisterPollHandler
public void unregisterPollHandler()Description copied from interface:RaftServerProtocolUnregisters the poll request handler.- Specified by:
unregisterPollHandlerin interfaceRaftServerProtocol
-
registerVoteHandler
Description copied from interface:RaftServerProtocolRegisters a vote request callback.- Specified by:
registerVoteHandlerin interfaceRaftServerProtocol- Parameters:
handler- the open session request handler to register
-
unregisterVoteHandler
public void unregisterVoteHandler()Description copied from interface:RaftServerProtocolUnregisters the vote request handler.- Specified by:
unregisterVoteHandlerin interfaceRaftServerProtocol
-
registerAppendHandler
public void registerAppendHandler(Function<AppendRequest, CompletableFuture<AppendResponse>> handler) Description copied from interface:RaftServerProtocolRegisters an append request callback.- Specified by:
registerAppendHandlerin interfaceRaftServerProtocol- Parameters:
handler- the open session request handler to register
-
unregisterAppendHandler
public void unregisterAppendHandler()Description copied from interface:RaftServerProtocolUnregisters the append request handler.- Specified by:
unregisterAppendHandlerin interfaceRaftServerProtocol
-