Search in sources :

Example 1 with HeartBeatState

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);
    }
}
Also used : EndpointState(org.apache.cassandra.gms.EndpointState) InetAddressAndPort(org.apache.cassandra.locator.InetAddressAndPort) HeartBeatState(org.apache.cassandra.gms.HeartBeatState) Replica(org.apache.cassandra.locator.Replica)

Aggregations

EndpointState (org.apache.cassandra.gms.EndpointState)1 HeartBeatState (org.apache.cassandra.gms.HeartBeatState)1 InetAddressAndPort (org.apache.cassandra.locator.InetAddressAndPort)1 Replica (org.apache.cassandra.locator.Replica)1