public interface RaftActorBehavior extends AutoCloseable
RaftState. Each handles the same Raft messages differently.| Modifier and Type | Method and Description |
|---|---|
void |
close() |
@Nullable String |
getLeaderId()
Returns the id of the leader.
|
short |
getLeaderPayloadVersion()
Returns the leader's payload data version.
|
long |
getReplicatedToAllIndex()
Returns the index of the last log entry that has been replicated to all peers.
|
@Nullable RaftActorBehavior |
handleMessage(akka.actor.ActorRef sender,
Object message)
Handle a message.
|
void |
setReplicatedToAllIndex(long replicatedToAllIndex)
Sets the index of the last log entry that has been replicated to all peers.
|
RaftState |
state()
Returns the state associated with this behavior.
|
RaftActorBehavior |
switchBehavior(RaftActorBehavior behavior)
Closes the current behavior and switches to the specified behavior, if possible.
|
@Nullable RaftActorBehavior handleMessage(akka.actor.ActorRef sender, Object message)
sender - The sender of the messagemessage - A message that needs to be processedRaftState state()
@Nullable String getLeaderId()
void setReplicatedToAllIndex(long replicatedToAllIndex)
replicatedToAllIndex - the indexlong getReplicatedToAllIndex()
short getLeaderPayloadVersion()
RaftActorBehavior switchBehavior(RaftActorBehavior behavior)
behavior - the new behavior to switch tovoid close()
close in interface AutoCloseableCopyright © 2019 OpenDaylight. All rights reserved.