@Test public void testResetReplicatingStates() { Set<NodeEndpoint> endpoints = new HashSet<>(); endpoints.add(new NodeEndpoint("A", "localhost", 2333)); endpoints.add(new NodeEndpoint("B", "localhost", 2334)); NodeGroup group = new NodeGroup(endpoints, NodeId.of("A")); group.resetReplicatingStates(1); Assert.assertFalse(group.findMember(NodeId.of("A")).isReplicationStateSet()); Assert.assertTrue(group.findMember(NodeId.of("B")).isReplicationStateSet()); }
void resetReplicatingStates(int nextLogIndex) { for (GroupMember member : memberMap.values()) { if (!member.idEquals(selfId)) { member.setReplicatingState(new ReplicatingState(nextLogIndex)); } } }
NodeGroup { void resetReplicatingStates(int nextLogIndex) { for (GroupMember member : memberMap.values()) { if (!member.idEquals(selfId)) { member.setReplicatingState(new ReplicatingState(nextLogIndex)); } } } }
NodeGroup { void resetReplicatingStates(int nextLogIndex) { for (GroupMember member : memberMap.values()) { if (!member.idEquals(selfId)) { member.setReplicatingState(new ReplicatingState(nextLogIndex)); } } } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId); }
NodeGroup { void resetReplicatingStates(int nextLogIndex) { for (GroupMember member : memberMap.values()) { if (!member.idEquals(selfId)) { member.setReplicatingState(new ReplicatingState(nextLogIndex)); } } } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);  }
NodeGroup { void resetReplicatingStates(int nextLogIndex) { for (GroupMember member : memberMap.values()) { if (!member.idEquals(selfId)) { member.setReplicatingState(new ReplicatingState(nextLogIndex)); } } } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);   }