@Test public void testVnodeRepairState() { 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, host3), VnodeRepairState.UNREPAIRED); assertThat(vnodeRepairState.getReplicas()).containsExactlyInAnyOrder(host1, host2, host3); assertThat(vnodeRepairState.getTokenRange()).isEqualTo(range); assertThat(vnodeRepairState.lastRepairedAt()).isEqualTo(VnodeRepairState.UNREPAIRED); assertThat(vnodeRepairState.isSameVnode(vnodeRepairState)).isTrue(); }
public VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt) { myTokenRange = tokenRange; myReplicas = replicas; myLastRepairedAt = lastRepairedAt; }
VnodeRepairState { public VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt) { myTokenRange = tokenRange; myReplicas = replicas; myLastRepairedAt = lastRepairedAt; } }
VnodeRepairState { public VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt) { myTokenRange = tokenRange; myReplicas = replicas; myLastRepairedAt = lastRepairedAt; } VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt); }
VnodeRepairState { public VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt) { myTokenRange = tokenRange; myReplicas = replicas; myLastRepairedAt = lastRepairedAt; } 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 VnodeRepairState(LongTokenRange tokenRange, ImmutableSet<Host> replicas, long lastRepairedAt) { myTokenRange = tokenRange; myReplicas = replicas; myLastRepairedAt = lastRepairedAt; } 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; }