@Test public void testVnodeWithDifferentReplicasIsNotSame() { LongTokenRange range = new LongTokenRange(1, 2); Host host1 = mock(Host.class); Host host2 = mock(Host.class); Host host3 = mock(Host.class); VnodeRepairState vnodeRepairState = new VnodeRepairState(range, ImmutableSet.of(host1, host2), VnodeRepairState.UNREPAIRED); VnodeRepairState otherVnodeRepairState = new VnodeRepairState(range, ImmutableSet.of(host1, host3), VnodeRepairState.UNREPAIRED); assertThat(vnodeRepairState.isSameVnode(otherVnodeRepairState)).isFalse(); }
public boolean isSameVnode(VnodeRepairState other) { return getTokenRange().equals(other.getTokenRange()) && getReplicas().equals(other.getReplicas()); }
VnodeRepairState { public boolean isSameVnode(VnodeRepairState other) { return getTokenRange().equals(other.getTokenRange()) && getReplicas().equals(other.getReplicas()); } }
VnodeRepairState { public boolean isSameVnode(VnodeRepairState other) { return getTokenRange().equals(other.getTokenRange()) && getReplicas().equals(other.getReplicas()); } VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt); }
VnodeRepairState { public boolean isSameVnode(VnodeRepairState other) { return getTokenRange().equals(other.getTokenRange()) && getReplicas().equals(other.getReplicas()); } VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt); LongTokenRange getTokenRange(); ImmutableSet<Host> getReplicas(); long lastRepairedAt(); boolean isSameVnode(VnodeRepairState other); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
VnodeRepairState { public boolean isSameVnode(VnodeRepairState other) { return getTokenRange().equals(other.getTokenRange()) && getReplicas().equals(other.getReplicas()); } VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt); LongTokenRange getTokenRange(); ImmutableSet<Host> getReplicas(); long lastRepairedAt(); boolean isSameVnode(VnodeRepairState other); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static final long UNREPAIRED; }