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


Java RepairParallelism.PARALLEL属性代码示例

本文整理汇总了Java中org.apache.cassandra.repair.RepairParallelism.PARALLEL属性的典型用法代码示例。如果您正苦于以下问题:Java RepairParallelism.PARALLEL属性的具体用法?Java RepairParallelism.PARALLEL怎么用?Java RepairParallelism.PARALLEL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.cassandra.repair.RepairParallelism的用法示例。


在下文中一共展示了RepairParallelism.PARALLEL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: forceRepairAsync

public int forceRepairAsync(String keyspace, RepairParallelism parallelismDegree, Collection<String> dataCenters, Collection<String> hosts, Collection<Range<Token>> ranges, boolean fullRepair, String... columnFamilies)
{
    if (ranges.isEmpty() || Keyspace.open(keyspace).getReplicationStrategy().getReplicationFactor() < 2)
        return 0;

    int cmd = nextRepairCommand.incrementAndGet();
    if (ranges.size() > 0)
    {
        if (FBUtilities.isWindows() && parallelismDegree != RepairParallelism.PARALLEL)
        {
            logger.warn("Snapshot-based repair is not yet supported on Windows.  Reverting to parallel repair.");
            parallelismDegree = RepairParallelism.PARALLEL;
        }
        new Thread(createRepairTask(cmd, keyspace, ranges, parallelismDegree, dataCenters, hosts, fullRepair, columnFamilies)).start();
    }
    return cmd;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:17,代码来源:StorageService.java

示例2: RepairOption

public RepairOption(RepairParallelism parallelism, boolean primaryRange, boolean incremental, boolean trace, int jobThreads, Collection<Range<Token>> ranges, boolean isSubrangeRepair)
{
    if (FBUtilities.isWindows() &&
        (DatabaseDescriptor.getDiskAccessMode() != Config.DiskAccessMode.standard || DatabaseDescriptor.getIndexAccessMode() != Config.DiskAccessMode.standard) &&
        parallelism == RepairParallelism.SEQUENTIAL)
    {
        logger.warn("Sequential repair disabled when memory-mapped I/O is configured on Windows. Reverting to parallel.");
        this.parallelism = RepairParallelism.PARALLEL;
    }
    else
        this.parallelism = parallelism;

    this.primaryRange = primaryRange;
    this.incremental = incremental;
    this.trace = trace;
    this.jobThreads = jobThreads;
    this.ranges.addAll(ranges);
    this.isSubrangeRepair = isSubrangeRepair;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:19,代码来源:RepairOption.java

示例3: execute

@Override
public void execute(NodeProbe probe)
{
    List<String> keyspaces = parseOptionalKeyspace(args, probe);
    String[] cfnames = parseOptionalColumnFamilies(args);

    if (primaryRange && (!specificDataCenters.isEmpty() || !specificHosts.isEmpty()))
        throw new RuntimeException("Primary range repair should be performed on all nodes in the cluster.");

    for (String keyspace : keyspaces)
    {
        try
        {
            RepairParallelism parallelismDegree = RepairParallelism.SEQUENTIAL;
            if (parallel)
                parallelismDegree = RepairParallelism.PARALLEL;
            else if (dcParallel)
                parallelismDegree = RepairParallelism.DATACENTER_AWARE;

            Collection<String> dataCenters = null;
            Collection<String> hosts = null;
            if (!specificDataCenters.isEmpty())
                dataCenters = newArrayList(specificDataCenters);
            else if (localDC)
                dataCenters = newArrayList(probe.getDataCenter());
            else if(!specificHosts.isEmpty())
                hosts = newArrayList(specificHosts);
            if (!startToken.isEmpty() || !endToken.isEmpty())
                probe.forceRepairRangeAsync(System.out, keyspace, parallelismDegree, dataCenters,hosts, startToken, endToken, !incrementalRepair);
            else
                probe.forceRepairAsync(System.out, keyspace, parallelismDegree, dataCenters, hosts, primaryRange, !incrementalRepair, cfnames);
        } catch (Exception e)
        {
            throw new RuntimeException("Error occurred during repair", e);
        }
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:37,代码来源:NodeTool.java

示例4: execute

@Override
public void execute(NodeProbe probe)
{
    List<String> keyspaces = parseOptionalKeyspace(args, probe, KeyspaceSet.NON_LOCAL_STRATEGY);
    String[] cfnames = parseOptionalTables(args);

    if (primaryRange && (!specificDataCenters.isEmpty() || !specificHosts.isEmpty()))
        throw new RuntimeException("Primary range repair should be performed on all nodes in the cluster.");

    for (String keyspace : keyspaces)
    {
        // avoid repairing system_distributed by default (CASSANDRA-9621)
        if ((args == null || args.isEmpty()) && ONLY_EXPLICITLY_REPAIRED.contains(keyspace))
            continue;

        Map<String, String> options = new HashMap<>();
        RepairParallelism parallelismDegree = RepairParallelism.PARALLEL;
        if (sequential)
            parallelismDegree = RepairParallelism.SEQUENTIAL;
        else if (dcParallel)
            parallelismDegree = RepairParallelism.DATACENTER_AWARE;
        options.put(RepairOption.PARALLELISM_KEY, parallelismDegree.getName());
        options.put(RepairOption.PRIMARY_RANGE_KEY, Boolean.toString(primaryRange));
        options.put(RepairOption.INCREMENTAL_KEY, 
                // Scylla does not support incremental repair, so its always full. 
                //Boolean.toString(!fullRepair)
                "false"
                );
        options.put(RepairOption.JOB_THREADS_KEY, Integer.toString(numJobThreads));
        options.put(RepairOption.TRACE_KEY, Boolean.toString(trace));
        options.put(RepairOption.COLUMNFAMILIES_KEY, StringUtils.join(cfnames, ","));
        if (!startToken.isEmpty() || !endToken.isEmpty())
        {
            options.put(RepairOption.RANGES_KEY, startToken + ":" + endToken);
        }
        if (localDC)
        {
            options.put(RepairOption.DATACENTERS_KEY, StringUtils.join(newArrayList(probe.getDataCenter()), ","));
        }
        else
        {
            options.put(RepairOption.DATACENTERS_KEY, StringUtils.join(specificDataCenters, ","));
        }
        options.put(RepairOption.HOSTS_KEY, StringUtils.join(specificHosts, ","));
        try
        {
            probe.repairAsync(System.out, keyspace, options);
        } catch (Exception e)
        {
            throw new RuntimeException("Error occurred during repair", e);
        }
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:53,代码来源:Repair.java


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