use of com.datastax.oss.driver.api.core.metadata.TokenMap in project java-driver by datastax.
the class TokenITBase method checkRanges.
private void checkRanges(Session session) {
assertThat(session.getMetadata().getTokenMap()).isPresent();
TokenMap tokenMap = session.getMetadata().getTokenMap().get();
checkRanges(tokenMap.getTokenRanges());
}
use of com.datastax.oss.driver.api.core.metadata.TokenMap in project java-driver by datastax.
the class TokenITBase method should_create_tokens_and_ranges.
@Test
public void should_create_tokens_and_ranges() {
TokenMap tokenMap = getTokenMap();
// Pick a random range
TokenRange range = tokenMap.getTokenRanges().iterator().next();
Token start = tokenMap.parse(tokenMap.format(range.getStart()));
Token end = tokenMap.parse(tokenMap.format(range.getEnd()));
assertThat(tokenMap.newTokenRange(start, end)).isEqualTo(range);
}
Aggregations