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, Duration snapshotRequestTimeout, Duration configurationChangeTimeout, io.micrometer.core.instrument.MeterRegistry meterRegistry) -
Method Summary
Modifier and TypeMethodDescriptionappend(MemberId memberId, AppendRequest request) Sends an append request to the given node.append(MemberId memberId, VersionedAppendRequest request) configure(MemberId memberId, ConfigureRequest request) Sends a configure request to the given node.forceConfigure(MemberId memberId, ForceConfigureRequest request) Sends a force configure request to the given node.install(MemberId memberId, InstallRequest request) Sends an install request to the given node.join(MemberId memberId, JoinRequest request) Sends a join request to the given node.leave(MemberId memberId, LeaveRequest request) Sends a leave 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.voidvoidRegisters a configure request callback.voidregisterForceConfigureHandler(Function<ForceConfigureRequest, CompletableFuture<ForceConfigureResponse>> handler) voidRegisters a install request callback.voidvoidvoidRegisters 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.voidvoidUnregisters the install request handler.voidvoidvoidUnregisters 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, Duration snapshotRequestTimeout, Duration configurationChangeTimeout, io.micrometer.core.instrument.MeterRegistry meterRegistry)
-
-
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
-
forceConfigure
public CompletableFuture<ForceConfigureResponse> forceConfigure(MemberId memberId, ForceConfigureRequest request) Description copied from interface:RaftServerProtocolSends a force configure request to the given node.- Specified by:
forceConfigurein interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
join
Description copied from interface:RaftServerProtocolSends a join request to the given node.- Specified by:
joinin interfaceRaftServerProtocol- Parameters:
memberId- the node to which to send the requestrequest- the request to send- Returns:
- a future to be completed with the response
-
leave
Description copied from interface:RaftServerProtocolSends a leave request to the given node.- Specified by:
leavein 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
-
append
- Specified by:
appendin interfaceRaftServerProtocol
-
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
-
registerForceConfigureHandler
public void registerForceConfigureHandler(Function<ForceConfigureRequest, CompletableFuture<ForceConfigureResponse>> handler) - Specified by:
registerForceConfigureHandlerin interfaceRaftServerProtocol
-
unregisterForceConfigureHandler
public void unregisterForceConfigureHandler()- Specified by:
unregisterForceConfigureHandlerin interfaceRaftServerProtocol
-
registerJoinHandler
- Specified by:
registerJoinHandlerin interfaceRaftServerProtocol
-
unregisterJoinHandler
public void unregisterJoinHandler()- Specified by:
unregisterJoinHandlerin interfaceRaftServerProtocol
-
registerLeaveHandler
- Specified by:
registerLeaveHandlerin interfaceRaftServerProtocol
-
unregisterLeaveHandler
public void unregisterLeaveHandler()- Specified by:
unregisterLeaveHandlerin 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
-
registerAppendV1Handler
public void registerAppendV1Handler(Function<AppendRequest, CompletableFuture<AppendResponse>> handler) Description copied from interface:RaftServerProtocolRegisters an append request callback.- Specified by:
registerAppendV1Handlerin interfaceRaftServerProtocol- Parameters:
handler- the open session request handler to register
-
registerAppendV2Handler
public void registerAppendV2Handler(Function<VersionedAppendRequest, CompletableFuture<AppendResponse>> handler) - Specified by:
registerAppendV2Handlerin interfaceRaftServerProtocol
-
unregisterAppendHandler
public void unregisterAppendHandler()Description copied from interface:RaftServerProtocolUnregisters the append request handler.- Specified by:
unregisterAppendHandlerin interfaceRaftServerProtocol
-