use of org.apache.cassandra.gms.HeartBeatState in project cassandra by apache.
the class StorageProxyTest method shouldHintTest.
private void shouldHintTest(Consumer<Replica> test) throws Exception {
InetAddressAndPort testEp = InetAddressAndPort.getByName("192.168.1.1");
Replica replica = full(testEp);
StorageService.instance.getTokenMetadata().updateHostId(UUID.randomUUID(), testEp);
EndpointState state = new EndpointState(new HeartBeatState(0, 0));
Gossiper.runInGossipStageBlocking(() -> Gossiper.instance.markDead(replica.endpoint(), state));
try {
test.accept(replica);
} finally {
StorageService.instance.getTokenMetadata().removeEndpoint(testEp);
}
}
Aggregations