本文整理汇总了Java中org.apache.cassandra.io.sstable.Component.DATA属性的典型用法代码示例。如果您正苦于以下问题:Java Component.DATA属性的具体用法?Java Component.DATA怎么用?Java Component.DATA使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.cassandra.io.sstable.Component
的用法示例。
在下文中一共展示了Component.DATA属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBackupAfterFlush
@Test
public void testBackupAfterFlush() throws Throwable
{
ColumnFamilyStore cfs = Keyspace.open(KEYSPACE2).getColumnFamilyStore(CF_STANDARD1);
new RowUpdateBuilder(cfs.metadata, 0, ByteBufferUtil.bytes("key1")).clustering("Column1").add("val", "asdf").build().applyUnsafe();
cfs.forceBlockingFlush();
new RowUpdateBuilder(cfs.metadata, 0, ByteBufferUtil.bytes("key2")).clustering("Column1").add("val", "asdf").build().applyUnsafe();
cfs.forceBlockingFlush();
for (int version = 1; version <= 2; ++version)
{
Descriptor existing = new Descriptor(cfs.getDirectories().getDirectoryForNewSSTables(), KEYSPACE2, CF_STANDARD1, version);
Descriptor desc = new Descriptor(Directories.getBackupsDirectory(existing), KEYSPACE2, CF_STANDARD1, version);
for (Component c : new Component[]{ Component.DATA, Component.PRIMARY_INDEX, Component.FILTER, Component.STATS })
assertTrue("Cannot find backed-up file:" + desc.filenameFor(c), new File(desc.filenameFor(c)).exists());
}
}
示例2: testBackupAfterFlush
@Test
public void testBackupAfterFlush() throws Throwable
{
ColumnFamilyStore cfs = insertKey1Key2();
for (int version = 1; version <= 2; ++version)
{
Descriptor existing = new Descriptor(cfs.directories.getDirectoryForNewSSTables(), "Keyspace2", "Standard1", version, Descriptor.Type.FINAL);
Descriptor desc = new Descriptor(Directories.getBackupsDirectory(existing), "Keyspace2", "Standard1", version, Descriptor.Type.FINAL);
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());
}
}
示例3: createFakeSSTable
private static void createFakeSSTable(File dir, String cf, int gen, boolean temp, List<File> addTo) throws IOException
{
Descriptor desc = new Descriptor(dir, KS, cf, gen, temp ? Descriptor.Type.TEMP : Descriptor.Type.FINAL);
for (Component c : new Component[]{ Component.DATA, Component.PRIMARY_INDEX, Component.FILTER })
{
File f = new File(desc.filenameFor(c));
f.createNewFile();
addTo.add(f);
}
}
示例4: createFakeSSTable
private static void createFakeSSTable(File dir, String cf, int gen, boolean temp, List<File> addTo) throws IOException
{
Descriptor desc = new Descriptor(dir, KS, cf, gen, temp);
for (Component c : new Component[]{ Component.DATA, Component.PRIMARY_INDEX, Component.FILTER })
{
File f = new File(desc.filenameFor(c));
f.createNewFile();
addTo.add(f);
}
}
示例5: createFakeSSTable
private static void createFakeSSTable(File dir, String cf, int gen, List<File> addTo) throws IOException
{
Descriptor desc = new Descriptor(dir, KS, cf, gen);
for (Component c : new Component[]{ Component.DATA, Component.PRIMARY_INDEX, Component.FILTER })
{
File f = new File(desc.filenameFor(c));
f.createNewFile();
addTo.add(f);
}
}
示例6: testBackupAfterFlush
@Test
public void testBackupAfterFlush() throws Throwable
{
ColumnFamilyStore cfs = insertKey1Key2();
for (int version = 1; version <= 2; ++version)
{
Descriptor existing = new Descriptor(cfs.directories.getDirectoryForNewSSTables(), KEYSPACE2, CF_STANDARD1, version, Descriptor.Type.FINAL);
Descriptor desc = new Descriptor(Directories.getBackupsDirectory(existing), KEYSPACE2, CF_STANDARD1, version, Descriptor.Type.FINAL);
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());
}
}
示例7: accept
/**
* {@inheritDoc}
*/
@Override
public boolean accept(Path path) {
if (path == null) {
return false;
}
// Try and get the component and the descriptor from the filename
Descriptor desc;
Component component;
try {
File parentFile = new File(path.getParent().toString());
Pair<Descriptor, Component> descCompPair = Component.fromFilename(parentFile,
path.getName());
desc = descCompPair.left;
component = descCompPair.right;
} catch (RuntimeException e) {
return false;
}
if (component != Component.DATA || desc.type.isTemporary) {
return false;
} else {
// these parameters are allowed to be null, but if set, we must match
return (operatingCF == null || desc.cfname.equals(operatingCF)) &&
(operatingKeyspace == null || desc.ksname.equals(operatingKeyspace));
}
}
示例8: testBackupAfterFlush
@Test
public void testBackupAfterFlush() throws Throwable
{
insertKey1Key2();
File backupDir = new File(DatabaseDescriptor.getDataFileLocationForTable("Keyspace2", 0), "backups");
for (int version = 1; version <= 2; ++version)
{
Descriptor desc = new Descriptor(backupDir, "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());
}
}