use of org.apache.cassandra.io.sstable.metadata.StatsMetadata in project cassandra by apache.
the class SSTableMetadataTrackingTest method testMinMaxtimestampRow.
@Test
public void testMinMaxtimestampRow() throws Throwable {
createTable("CREATE TABLE %s (a int, b int, c text, PRIMARY KEY (a, b))");
ColumnFamilyStore cfs = Keyspace.open(keyspace()).getColumnFamilyStore(currentTable());
execute("INSERT INTO %s (a,b,c) VALUES (1,1,'1') using timestamp 10000");
execute("DELETE FROM %s USING TIMESTAMP 9999 WHERE a = 1");
cfs.forceBlockingFlush();
StatsMetadata metadata = cfs.getLiveSSTables().iterator().next().getSSTableMetadata();
assertEquals(9999, metadata.minTimestamp);
assertEquals(10000, metadata.maxTimestamp);
assertEquals(Integer.MAX_VALUE, metadata.maxLocalDeletionTime, 5);
cfs.forceMajorCompaction();
metadata = cfs.getLiveSSTables().iterator().next().getSSTableMetadata();
assertEquals(9999, metadata.minTimestamp);
assertEquals(10000, metadata.maxTimestamp);
assertEquals(Integer.MAX_VALUE, metadata.maxLocalDeletionTime, 5);
}
Aggregations