本文整理汇总了Java中org.apache.cassandra.db.compaction.LeveledCompactionStrategy类的典型用法代码示例。如果您正苦于以下问题:Java LeveledCompactionStrategy类的具体用法?Java LeveledCompactionStrategy怎么用?Java LeveledCompactionStrategy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LeveledCompactionStrategy类属于org.apache.cassandra.db.compaction包,在下文中一共展示了LeveledCompactionStrategy类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: snapshotWithoutFlush
import org.apache.cassandra.db.compaction.LeveledCompactionStrategy; //导入依赖的package包/类
public void snapshotWithoutFlush(String snapshotName)
{
for (ColumnFamilyStore cfs : concatWithIndexes())
{
DataTracker.View currentView = cfs.markCurrentViewReferenced();
try
{
for (SSTableReader ssTable : currentView.sstables)
{
File snapshotDirectory = Directories.getSnapshotDirectory(ssTable.descriptor, snapshotName);
ssTable.createLinks(snapshotDirectory.getPath()); // hard links
if (logger.isDebugEnabled())
logger.debug("Snapshot for " + table + " keyspace data file " + ssTable.getFilename() +
" created in " + snapshotDirectory);
}
if (cfs.compactionStrategy instanceof LeveledCompactionStrategy)
cfs.directories.snapshotLeveledManifest(snapshotName);
}
finally
{
SSTableReader.releaseReferences(currentView.sstables);
}
}
}
示例2: checkManifest
import org.apache.cassandra.db.compaction.LeveledCompactionStrategy; //导入依赖的package包/类
private static void checkManifest(AbstractCompactionStrategy strategy, ColumnFamilyStore cfs, Collection<SSTableReader> sstables)
{
WrappingCompactionStrategy wrappingStrategy = (WrappingCompactionStrategy)strategy;
int maxSizeInMB = (int)((cfs.getCompactionStrategy().getMaxSSTableBytes()) / (1024L * 1024L));
if (wrappingStrategy.getWrappedStrategies().size() == 2 && wrappingStrategy.getWrappedStrategies().iterator().next() instanceof LeveledCompactionStrategy)
{
System.out.println("Checking leveled manifest");
Predicate<SSTableReader> repairedPredicate = new Predicate<SSTableReader>()
{
@Override
public boolean apply(SSTableReader sstable)
{
return sstable.isRepaired();
}
};
List<SSTableReader> repaired = Lists.newArrayList(Iterables.filter(sstables, repairedPredicate));
List<SSTableReader> unRepaired = Lists.newArrayList(Iterables.filter(sstables, Predicates.not(repairedPredicate)));
LeveledManifest repairedManifest = LeveledManifest.create(cfs, maxSizeInMB, repaired);
for (int i = 1; i < repairedManifest.getLevelCount(); i++)
{
repairedManifest.repairOverlappingSSTables(i);
}
LeveledManifest unRepairedManifest = LeveledManifest.create(cfs, maxSizeInMB, unRepaired);
for (int i = 1; i < unRepairedManifest.getLevelCount(); i++)
{
unRepairedManifest.repairOverlappingSSTables(i);
}
}
}
示例3: getBloomFilterFpChance
import org.apache.cassandra.db.compaction.LeveledCompactionStrategy; //导入依赖的package包/类
public double getBloomFilterFpChance()
{
// we disallow bFFPC==null starting in 1.2.1 but tolerated it before that
return (bloomFilterFpChance == null || bloomFilterFpChance == 0)
? compactionStrategyClass == LeveledCompactionStrategy.class ? 0.1 : 0.01
: bloomFilterFpChance;
}
示例4: lcs
import org.apache.cassandra.db.compaction.LeveledCompactionStrategy; //导入依赖的package包/类
public static CompactionParams lcs(Map<String, String> options)
{
return create(LeveledCompactionStrategy.class, options);
}
示例5: defaultBloomFilterFbChance
import org.apache.cassandra.db.compaction.LeveledCompactionStrategy; //导入依赖的package包/类
double defaultBloomFilterFbChance()
{
return klass.equals(LeveledCompactionStrategy.class) ? 0.1 : 0.01;
}
示例6: getUnleveledSSTables
import org.apache.cassandra.db.compaction.LeveledCompactionStrategy; //导入依赖的package包/类
public int getUnleveledSSTables()
{
return this.compactionStrategy instanceof LeveledCompactionStrategy
? ((LeveledCompactionStrategy) this.compactionStrategy).getLevelSize(0)
: 0;
}
示例7: getSSTableCountPerLevel
import org.apache.cassandra.db.compaction.LeveledCompactionStrategy; //导入依赖的package包/类
public int[] getSSTableCountPerLevel()
{
return compactionStrategy instanceof LeveledCompactionStrategy
? ((LeveledCompactionStrategy) compactionStrategy).getAllLevelSize()
: null;
}