Search in sources :

Example 26 with Component

use of org.apache.cassandra.io.sstable.Component in project eiger by wlloyd.

the class ColumnFamilyStoreTest method testBackupAfterFlush.

@Test
public void testBackupAfterFlush() throws Throwable {
    ColumnFamilyStore cfs = insertKey1Key2();
    for (int version = 1; version <= 2; ++version) {
        Descriptor existing = new Descriptor(cfs.directories.getDirectoryForNewSSTables(1), "Keyspace2", "Standard1", version, false);
        Descriptor desc = new Descriptor(Directories.getBackupsDirectory(existing), "Keyspace2", "Standard1", version, false);
        for (Component c : new Component[] { Component.DATA, Component.PRIMARY_INDEX, Component.FILTER, Component.STATS }) assertTrue("can not find backedup file:" + desc.filenameFor(c), new File(desc.filenameFor(c)).exists());
    }
}
Also used : Descriptor(org.apache.cassandra.io.sstable.Descriptor) DatabaseDescriptor(org.apache.cassandra.config.DatabaseDescriptor) Component(org.apache.cassandra.io.sstable.Component) File(java.io.File) Test(org.junit.Test)

Aggregations

Component (org.apache.cassandra.io.sstable.Component)26 Descriptor (org.apache.cassandra.io.sstable.Descriptor)16 File (org.apache.cassandra.io.util.File)15 SSTableReader (org.apache.cassandra.io.sstable.format.SSTableReader)12 DatabaseDescriptor (org.apache.cassandra.config.DatabaseDescriptor)10 IOException (java.io.IOException)5 ColumnFamilyStore (org.apache.cassandra.db.ColumnFamilyStore)5 Test (org.junit.Test)5 File (java.io.File)4 Directories (org.apache.cassandra.db.Directories)4 StatsMetadata (org.apache.cassandra.io.sstable.metadata.StatsMetadata)4 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 Set (java.util.Set)3 LifecycleTransaction (org.apache.cassandra.db.lifecycle.LifecycleTransaction)3 MetadataCollector (org.apache.cassandra.io.sstable.metadata.MetadataCollector)3 AlwaysPresentFilter (org.apache.cassandra.utils.AlwaysPresentFilter)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 Path (java.nio.file.Path)2 Collection (java.util.Collection)2