Search in sources :

Example 1 with Slice

use of org.apache.cassandra.db.Slice in project cassandra by apache.

the class DataResolverTest method withExclusiveStartIf.

// Forces the start to be exclusive if the condition holds
private static RangeTombstone withExclusiveStartIf(RangeTombstone rt, boolean condition) {
    if (!condition)
        return rt;
    Slice slice = rt.deletedSlice();
    ClusteringBound<?> newStart = ClusteringBound.create(Kind.EXCL_START_BOUND, slice.start());
    return condition ? new RangeTombstone(Slice.make(newStart, slice.end()), rt.deletionTime()) : rt;
}
Also used : Slice(org.apache.cassandra.db.Slice) RangeTombstone(org.apache.cassandra.db.RangeTombstone)

Example 2 with Slice

use of org.apache.cassandra.db.Slice in project cassandra by apache.

the class DataResolverTest method withExclusiveEndIf.

// Forces the end to be exclusive if the condition holds
private static RangeTombstone withExclusiveEndIf(RangeTombstone rt, boolean condition) {
    if (!condition)
        return rt;
    Slice slice = rt.deletedSlice();
    ClusteringBound<?> newEnd = ClusteringBound.create(Kind.EXCL_END_BOUND, slice.end());
    return condition ? new RangeTombstone(Slice.make(slice.start(), newEnd), rt.deletionTime()) : rt;
}
Also used : Slice(org.apache.cassandra.db.Slice) RangeTombstone(org.apache.cassandra.db.RangeTombstone)

Aggregations

RangeTombstone (org.apache.cassandra.db.RangeTombstone)2 Slice (org.apache.cassandra.db.Slice)2