use of org.apache.cassandra.db.compaction.Verifier in project cassandra by apache.
the class VerifyTest method testVerifyCounterCorrectUncompressed.
@Test
public void testVerifyCounterCorrectUncompressed() {
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(COUNTER_CF3);
fillCounterCF(cfs, 2);
SSTableReader sstable = cfs.getLiveSSTables().iterator().next();
try (Verifier verifier = new Verifier(cfs, sstable, false, Verifier.options().invokeDiskFailurePolicy(true).build())) {
verifier.verify();
} catch (CorruptSSTableException err) {
fail("Unexpected CorruptSSTableException");
}
}
use of org.apache.cassandra.db.compaction.Verifier in project cassandra by apache.
the class VerifyTest method testNoFilterFile.
@Test
public void testNoFilterFile() {
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(BF_ALWAYS_PRESENT);
fillCF(cfs, 100);
assertEquals(1.0, cfs.metadata().params.bloomFilterFpChance, 0.0);
for (SSTableReader sstable : cfs.getLiveSSTables()) {
File f = new File(sstable.descriptor.filenameFor(Component.FILTER));
assertFalse(f.exists());
try (Verifier verifier = new Verifier(cfs, sstable, false, Verifier.options().build())) {
verifier.verify();
}
}
}
use of org.apache.cassandra.db.compaction.Verifier in project cassandra by apache.
the class VerifyTest method testVerifyCounterCorrect.
@Test
public void testVerifyCounterCorrect() {
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(COUNTER_CF);
fillCounterCF(cfs, 2);
SSTableReader sstable = cfs.getLiveSSTables().iterator().next();
try (Verifier verifier = new Verifier(cfs, sstable, false, Verifier.options().invokeDiskFailurePolicy(true).build())) {
verifier.verify();
} catch (CorruptSSTableException err) {
fail("Unexpected CorruptSSTableException");
}
}
use of org.apache.cassandra.db.compaction.Verifier in project cassandra by apache.
the class VerifyTest method testExtendedVerifyCounterCorrect.
@Test
public void testExtendedVerifyCounterCorrect() {
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(COUNTER_CF2);
fillCounterCF(cfs, 2);
SSTableReader sstable = cfs.getLiveSSTables().iterator().next();
try (Verifier verifier = new Verifier(cfs, sstable, false, Verifier.options().invokeDiskFailurePolicy(true).extendedVerification(true).build())) {
verifier.verify();
} catch (CorruptSSTableException err) {
fail("Unexpected CorruptSSTableException");
}
}
use of org.apache.cassandra.db.compaction.Verifier in project cassandra by apache.
the class VerifyTest method testExtendedVerifyCorrectUncompressed.
@Test
public void testExtendedVerifyCorrectUncompressed() {
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF4);
fillCF(cfs, 2);
SSTableReader sstable = cfs.getLiveSSTables().iterator().next();
try (Verifier verifier = new Verifier(cfs, sstable, false, Verifier.options().extendedVerification(true).invokeDiskFailurePolicy(true).build())) {
verifier.verify();
} catch (CorruptSSTableException err) {
fail("Unexpected CorruptSSTableException");
}
}
Aggregations