- private static final IsolatedLeaderCheck ISOLATED_LEADER_CHECK = new IsolatedLeaderCheck();
- private final Stopwatch isolatedLeaderCheck;
- private @Nullable LeadershipTransferContext leadershipTransferContext;
+ /**
+ * Internal message sent to periodically check if this leader has become isolated and should transition
+ * to {@link IsolatedLeader}.
+ */
+ @VisibleForTesting
+ static final Object ISOLATED_LEADER_CHECK = new Object();
+
+ private final Stopwatch isolatedLeaderCheck = Stopwatch.createStarted();
+ @Nullable private LeadershipTransferContext leadershipTransferContext;
+
+ Leader(RaftActorContext context, @Nullable AbstractLeader initializeFromLeader) {
+ super(context, RaftState.Leader, initializeFromLeader);
+ }