@Test public void testGetState() { LeaderNodeRole role = new LeaderNodeRole(1, LogReplicationTask.NONE); RoleState state = role.getState(); Assert.assertEquals(RoleName.LEADER, state.getRoleName()); Assert.assertEquals(1, state.getTerm()); }
@Override public RoleState getState() { return new DefaultRoleState(RoleName.LEADER, term); }
LeaderNodeRole extends AbstractNodeRole { @Override public RoleState getState() { return new DefaultRoleState(RoleName.LEADER, term); } }
LeaderNodeRole extends AbstractNodeRole { @Override public RoleState getState() { return new DefaultRoleState(RoleName.LEADER, term); } LeaderNodeRole(int term, LogReplicationTask logReplicationTask); }
LeaderNodeRole extends AbstractNodeRole { @Override public RoleState getState() { return new DefaultRoleState(RoleName.LEADER, term); } LeaderNodeRole(int term, LogReplicationTask logReplicationTask); @Override NodeId getLeaderId(NodeId selfId); @Override void cancelTimeoutOrTask(); @Override RoleState getState(); @Override String toString(); }
LeaderNodeRole extends AbstractNodeRole { @Override public RoleState getState() { return new DefaultRoleState(RoleName.LEADER, term); } LeaderNodeRole(int term, LogReplicationTask logReplicationTask); @Override NodeId getLeaderId(NodeId selfId); @Override void cancelTimeoutOrTask(); @Override RoleState getState(); @Override String toString();  }