use of org.apache.cassandra.locator.EndpointsForToken in project cassandra by apache.
the class DigestResolverTest method agreeingTransient.
/**
* A full response and a transient response, with the transient response being a subset of the full one
*/
@Test
public void agreeingTransient() {
SinglePartitionReadCommand command = SinglePartitionReadCommand.fullPartitionRead(cfm, nowInSec, dk);
EndpointsForToken targetReplicas = EndpointsForToken.of(dk.getToken(), full(EP1), trans(EP2));
DigestResolver<?, ?> resolver = new DigestResolver<>(command, plan(ConsistencyLevel.QUORUM, targetReplicas), 0);
PartitionUpdate response1 = update(row(1000, 4, 4), row(1000, 5, 5)).build();
PartitionUpdate response2 = update(row(1000, 5, 5)).build();
Assert.assertFalse(resolver.isDataPresent());
resolver.preprocess(response(command, EP1, iter(response1), false));
resolver.preprocess(response(command, EP2, iter(response2), false));
Assert.assertTrue(resolver.isDataPresent());
Assert.assertTrue(resolver.responsesMatch());
Assert.assertTrue(resolver.hasTransientResponse());
}
Aggregations