本文整理汇总了Java中org.apache.cassandra.db.compaction.LeveledManifest.getLevelCount方法的典型用法代码示例。如果您正苦于以下问题:Java LeveledManifest.getLevelCount方法的具体用法?Java LeveledManifest.getLevelCount怎么用?Java LeveledManifest.getLevelCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.db.compaction.LeveledManifest
的用法示例。
在下文中一共展示了LeveledManifest.getLevelCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkManifest
import org.apache.cassandra.db.compaction.LeveledManifest; //导入方法依赖的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);
}
}
}
示例2: checkManifest
import org.apache.cassandra.db.compaction.LeveledManifest; //导入方法依赖的package包/类
private static void checkManifest(LeveledManifest manifest)
{
System.out.println(String.format("Checking leveled manifest"));
for (int i = 1; i <= manifest.getLevelCount(); ++i)
manifest.repairOverlappingSSTables(i);
}