Search in sources :

Example 1 with DeletionInfo

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

the class DataResolverTest method assertRepairContainsDeletions.

private void assertRepairContainsDeletions(Mutation mutation, DeletionTime deletionTime, RangeTombstone... rangeTombstones) {
    PartitionUpdate update = mutation.getPartitionUpdates().iterator().next();
    DeletionInfo deletionInfo = update.deletionInfo();
    if (deletionTime != null)
        assertEquals(deletionTime, deletionInfo.getPartitionDeletion());
    assertEquals(rangeTombstones.length, deletionInfo.rangeCount());
    Iterator<RangeTombstone> ranges = deletionInfo.rangeIterator(false);
    int i = 0;
    while (ranges.hasNext()) {
        RangeTombstone expected = rangeTombstones[i++];
        RangeTombstone actual = ranges.next();
        String msg = String.format("Expected %s, but got %s", expected.toString(cfm.comparator), actual.toString(cfm.comparator));
        assertEquals(msg, expected, actual);
    }
}
Also used : DeletionInfo(org.apache.cassandra.db.DeletionInfo) MutableDeletionInfo(org.apache.cassandra.db.MutableDeletionInfo) PartitionUpdate(org.apache.cassandra.db.partitions.PartitionUpdate) RangeTombstone(org.apache.cassandra.db.RangeTombstone)

Aggregations

DeletionInfo (org.apache.cassandra.db.DeletionInfo)1 MutableDeletionInfo (org.apache.cassandra.db.MutableDeletionInfo)1 RangeTombstone (org.apache.cassandra.db.RangeTombstone)1 PartitionUpdate (org.apache.cassandra.db.partitions.PartitionUpdate)1