(RaftState newState)
| 838 | } |
| 839 | |
| 840 | public void convertStateTo(RaftState newState) throws Exception { |
| 841 | resetTimerTime(); |
| 842 | // 按真值表处理所有情况。 |
| 843 | switch (getState()) { |
| 844 | case Follower: |
| 845 | convertStateFromFollowerTo(newState); |
| 846 | return; |
| 847 | case Candidate: |
| 848 | convertStateFromCandidateTo(newState); |
| 849 | return; |
| 850 | case Leader: |
| 851 | convertStateFromLeaderTo(newState); |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | private void registerInternalRpc() { |
| 856 | server.AddFactoryHandle(RequestVote.TypeId_, new Service.ProtocolFactoryHandle<>( |
no test coverage detected