| 程序包 | 说明 |
|---|---|
| com.alipay.sofa.jraft | |
| com.alipay.sofa.jraft.core |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
FSMCaller.onStartFollowing(LeaderChangeContext ctx)
Called when start following a leader.
|
void |
StateMachine.onStartFollowing(LeaderChangeContext ctx)
This method is called when a follower or candidate starts following a leader and its leaderId
(should be NULL before the method is called) is set to the leader's id,
situations including:
1. a candidate receives appendEntries request from a leader
2. a follower(without leader) receives appendEntries from a leader
the parameter ctx gives the information(leaderId, term and status) about
the very leader whom the follower starts to follow.
|
boolean |
FSMCaller.onStopFollowing(LeaderChangeContext ctx)
Called when stop following a leader.
|
void |
StateMachine.onStopFollowing(LeaderChangeContext ctx)
This method is called when a follower stops following a leader and its leaderId becomes null,
situations including:
1. handle election timeout and start preVote
2. receive requests with higher term such as VoteRequest from a candidate
or appendEntries request from a new leader
3. receive timeoutNow request from current leader and start request vote.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
FSMCallerImpl.onStartFollowing(LeaderChangeContext ctx) |
void |
StateMachineAdapter.onStartFollowing(LeaderChangeContext ctx) |
boolean |
FSMCallerImpl.onStopFollowing(LeaderChangeContext ctx) |
void |
StateMachineAdapter.onStopFollowing(LeaderChangeContext ctx) |
Copyright © 2021. All rights reserved.