当前位置: 首页>>代码示例>>Java>>正文


Java RepairParallelism.values方法代码示例

本文整理汇总了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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:26,代码来源:StorageService.java

示例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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:15,代码来源:StorageService.java


注:本文中的org.apache.cassandra.repair.RepairParallelism.values方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。