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