本文整理汇总了Java中org.apache.cassandra.repair.RepairParallelism.values方法的典型用法代码示例。如果您正苦于以下问题:Java RepairParallelism.values方法的具体用法?Java RepairParallelism.values怎么用?Java RepairParallelism.values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.repair.RepairParallelism
的用法示例。
在下文中一共展示了RepairParallelism.values方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: forceRepairAsync
import org.apache.cassandra.repair.RepairParallelism; //导入方法依赖的package包/类
public int forceRepairAsync(String keyspace, int parallelismDegree, Collection<String> dataCenters, Collection<String> hosts, boolean primaryRange, boolean fullRepair, String... columnFamilies)
{
if (parallelismDegree < 0 || parallelismDegree > RepairParallelism.values().length - 1)
{
throw new IllegalArgumentException("Invalid parallelism degree specified: " + parallelismDegree);
}
Collection<Range<Token>> ranges;
if (primaryRange)
{
// when repairing only primary range, neither dataCenters nor hosts can be set
if (dataCenters == null && hosts == null)
ranges = getPrimaryRanges(keyspace);
// except dataCenters only contain local DC (i.e. -local)
else if (dataCenters != null && dataCenters.size() == 1 && dataCenters.contains(DatabaseDescriptor.getLocalDataCenter()))
ranges = getPrimaryRangesWithinDC(keyspace);
else
throw new IllegalArgumentException("You need to run primary range repair on all nodes in the cluster.");
}
else
{
ranges = getLocalRanges(keyspace);
}
return forceRepairAsync(keyspace, RepairParallelism.values()[parallelismDegree], dataCenters, hosts, ranges, fullRepair, columnFamilies);
}
示例2: forceRepairRangeAsync
import org.apache.cassandra.repair.RepairParallelism; //导入方法依赖的package包/类
public int forceRepairRangeAsync(String beginToken, String endToken, String keyspaceName, int parallelismDegree, Collection<String> dataCenters, Collection<String> hosts, boolean fullRepair, String... columnFamilies)
{
if (parallelismDegree < 0 || parallelismDegree > RepairParallelism.values().length - 1)
{
throw new IllegalArgumentException("Invalid parallelism degree specified: " + parallelismDegree);
}
Collection<Range<Token>> repairingRange = createRepairRangeFrom(beginToken, endToken);
logger.info("starting user-requested repair of range {} for keyspace {} and column families {}",
repairingRange, keyspaceName, columnFamilies);
RepairParallelism parallelism = RepairParallelism.values()[parallelismDegree];
return forceRepairAsync(keyspaceName, parallelism, dataCenters, hosts, repairingRange, fullRepair, columnFamilies);
}