Package io.microraft.model.message
Interface RaftMessage
-
- All Superinterfaces:
RaftModel,Serializable
- All Known Subinterfaces:
AppendEntriesFailureResponse,AppendEntriesRequest,AppendEntriesSuccessResponse,InstallSnapshotRequest,InstallSnapshotResponse,PreVoteRequest,PreVoteResponse,TriggerLeaderElectionRequest,VoteRequest,VoteResponse
public interface RaftMessage extends RaftModel
Implemented by request and response classes of the Raft consensus algorithm RPCs. Raft messages are the objects that go back and forth between Raft nodes.Raft message implementations must be treated as immutable and once a Raft message object is created its contents must not be mutated.
RaftMessageobjects are created byRaftModelFactory.- See Also:
RaftModel,RaftModelFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceRaftMessage.RaftMessageBuilder<T extends RaftMessage>The base builder interface for Raft message classes
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectgetGroupId()Returns the group id of the Raft node which created this messageRaftEndpointgetSender()Returns the endpoint of the Raft node which created this messageintgetTerm()Returns the term at which the Raft node created this message
-
-
-
Method Detail
-
getGroupId
Object getGroupId()
Returns the group id of the Raft node which created this message- Returns:
- the group id of the Raft node which created this message
-
getSender
@Nonnull RaftEndpoint getSender()
Returns the endpoint of the Raft node which created this message- Returns:
- the endpoint of the Raft node which created this message
-
getTerm
int getTerm()
Returns the term at which the Raft node created this message- Returns:
- the term at which the Raft node created this message
-
-