Package io.atomix.raft.roles
Class LeaderRole
java.lang.Object
io.atomix.raft.roles.AbstractRole
io.atomix.raft.roles.InactiveRole
io.atomix.raft.roles.PassiveRole
io.atomix.raft.roles.ActiveRole
io.atomix.raft.roles.LeaderRole
- All Implemented Interfaces:
RaftRole,ZeebeLogAppender,Managed<RaftRole>
Leader state.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.atomix.raft.zeebe.ZeebeLogAppender
ZeebeLogAppender.AppendListener -
Field Summary
Fields inherited from class io.atomix.raft.roles.AbstractRole
log, raft -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendEntry(long lowestPosition, long highestPosition, BufferWriter data, ZeebeLogAppender.AppendListener appendListener) Appends an entry to the local Raft log and schedules replication to each follower.voidappendEntry(long lowestPosition, long highestPosition, ByteBuffer data, ZeebeLogAppender.AppendListener appendListener) Appends an entry to the local Raft log and schedules replication to each follower.voidappendEntry(ApplicationEntry entry, ZeebeLogAppender.AppendListener appendListener) Appends an entry to the local Raft log and schedules replication to each follower.onAppend(AppendRequest request) Handles an append request.onConfigure(ConfigureRequest request) Handles a configure request.voidonInitialEntriesCommitted(Runnable runnable) onPoll(PollRequest request) Handles a poll request.onReconfigure(ReconfigureRequest request) Handles a configure request.onTransfer(TransferRequest request) Handles a transfer request.onVote(VoteRequest request) Handles a vote request.role()Returns the Raft state represented by this state.start()stop()Methods inherited from class io.atomix.raft.roles.ActiveRole
handlePoll, handleVoteMethods inherited from class io.atomix.raft.roles.PassiveRole
appendEntries, checkPreviousEntry, checkTerm, completeAppend, failAppend, handleAppend, onInstall, succeedAppendMethods inherited from class io.atomix.raft.roles.AbstractRole
forward, isRunning, logRequest, logResponse, toString, updateTermAndLeader
-
Constructor Details
-
LeaderRole
-
-
Method Details
-
start
- Specified by:
startin interfaceManaged<RaftRole>- Overrides:
startin classPassiveRole
-
stop
- Specified by:
stopin interfaceManaged<RaftRole>- Overrides:
stopin classPassiveRole
-
role
Description copied from class:AbstractRoleReturns the Raft state represented by this state.- Specified by:
rolein interfaceRaftRole- Overrides:
rolein classPassiveRole- Returns:
- The Raft state represented by this state.
-
onReconfigure
Description copied from interface:RaftRoleHandles a configure request.- Specified by:
onReconfigurein interfaceRaftRole- Overrides:
onReconfigurein classPassiveRole- Parameters:
request- The request to handle.- Returns:
- A completable future to be completed with the request response.
-
onConfigure
Description copied from interface:RaftRoleHandles a configure request.- Specified by:
onConfigurein interfaceRaftRole- Overrides:
onConfigurein classInactiveRole- Parameters:
request- The request to handle.- Returns:
- A completable future to be completed with the request response.
-
onTransfer
Description copied from interface:RaftRoleHandles a transfer request.- Specified by:
onTransferin interfaceRaftRole- Overrides:
onTransferin classInactiveRole- Parameters:
request- The request to handle.- Returns:
- A completable future to be completed with the request response.
-
onAppend
Description copied from interface:RaftRoleHandles an append request.- Specified by:
onAppendin interfaceRaftRole- Overrides:
onAppendin classActiveRole- Parameters:
request- The request to handle.- Returns:
- A completable future to be completed with the request response.
-
onPoll
Description copied from interface:RaftRoleHandles a poll request.- Specified by:
onPollin interfaceRaftRole- Overrides:
onPollin classActiveRole- Parameters:
request- The request to handle.- Returns:
- A completable future to be completed with the request response.
-
onVote
Description copied from interface:RaftRoleHandles a vote request.- Specified by:
onVotein interfaceRaftRole- Overrides:
onVotein classActiveRole- Parameters:
request- The request to handle.- Returns:
- A completable future to be completed with the request response.
-
appendEntry
Description copied from interface:ZeebeLogAppenderAppends an entry to the local Raft log and schedules replication to each follower.- Specified by:
appendEntryin interfaceZeebeLogAppender
-
appendEntry
public void appendEntry(long lowestPosition, long highestPosition, ByteBuffer data, ZeebeLogAppender.AppendListener appendListener) Description copied from interface:ZeebeLogAppenderAppends an entry to the local Raft log and schedules replication to each follower.- Specified by:
appendEntryin interfaceZeebeLogAppender- Parameters:
lowestPosition- lowest record position in the data bufferhighestPosition- highest record position in the data bufferdata- data to store in the entry
-
appendEntry
public void appendEntry(long lowestPosition, long highestPosition, BufferWriter data, ZeebeLogAppender.AppendListener appendListener) Description copied from interface:ZeebeLogAppenderAppends an entry to the local Raft log and schedules replication to each follower.- Specified by:
appendEntryin interfaceZeebeLogAppender- Parameters:
lowestPosition- lowest record position in the data bufferhighestPosition- highest record position in the data bufferdata- data to store in the entry
-
onInitialEntriesCommitted
-