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


Java RepairParallelism.SEQUENTIAL属性代码示例

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


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

示例1: 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

示例2: 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

示例3: 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.SEQUENTIAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。