Search in sources :

Example 1 with CqlMetadata

use of com.palantir.atlasdb.cassandra.backup.CqlMetadata in project atlasdb by palantir.

the class CassandraRepairEteTest method testTokenRangeCoversFullRing.

@Test
public void testTokenRangeCoversFullRing() {
    CqlMetadata cqlMetadata = new CqlMetadata(cluster.getMetadata());
    Set<Range<LightweightOppToken>> tokenRanges = cqlMetadata.getTokenRanges();
    // Turning this into a RangeSet should give the complete range (-inf, +inf)
    RangeSet<LightweightOppToken> fullTokenRing = tokenRanges.stream().collect(toImmutableRangeSet());
    assertThat(fullTokenRing.asRanges()).containsExactly(Range.all());
}
Also used : CqlMetadata(com.palantir.atlasdb.cassandra.backup.CqlMetadata) LightweightOppToken(com.palantir.atlasdb.keyvalue.cassandra.LightweightOppToken) FullyBoundedTimestampRange(com.palantir.timestamp.FullyBoundedTimestampRange) Range(com.google.common.collect.Range) Test(org.junit.Test)

Aggregations

Range (com.google.common.collect.Range)1 CqlMetadata (com.palantir.atlasdb.cassandra.backup.CqlMetadata)1 LightweightOppToken (com.palantir.atlasdb.keyvalue.cassandra.LightweightOppToken)1 FullyBoundedTimestampRange (com.palantir.timestamp.FullyBoundedTimestampRange)1 Test (org.junit.Test)1