*/
public class IsolatedLeader extends AbstractLeader {
public IsolatedLeader(RaftActorContext context) {
- super(context);
+ super(context, RaftState.IsolatedLeader);
}
// we received an Append Entries reply, we should switch the Behavior to Leader
// changes its state to Follower, hence we only need to switch to Leader if the state is still Isolated
if (ret.state() == RaftState.IsolatedLeader && !isLeaderIsolated()) {
LOG.info("IsolatedLeader {} switching from IsolatedLeader to Leader", leaderId);
- return switchBehavior(new Leader(context));
+ return internalSwitchBehavior(RaftState.Leader);
}
return ret;
}
-
- @Override
- public RaftState state() {
- return RaftState.IsolatedLeader;
- }
}