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.
RaftMessage
objects are created byRaftModelFactory
.- See Also:
RaftModel
,RaftModelFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RaftMessage.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 Object
getGroupId()
Returns the group id of the Raft node which created this messageRaftEndpoint
getSender()
Returns the endpoint of the Raft node which created this messageint
getTerm()
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
-
-