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


Java RoutingAllocation.getDebugMode方法代码示例

本文整理汇总了Java中org.elasticsearch.cluster.routing.allocation.RoutingAllocation.getDebugMode方法的典型用法代码示例。如果您正苦于以下问题:Java RoutingAllocation.getDebugMode方法的具体用法?Java RoutingAllocation.getDebugMode怎么用?Java RoutingAllocation.getDebugMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.cluster.routing.allocation.RoutingAllocation的用法示例。


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

示例1: canRebalance

import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; //导入方法依赖的package包/类
@Override
public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation) {
    Decision.Multi ret = new Decision.Multi();
    for (AllocationDecider allocationDecider : allocations) {
        Decision decision = allocationDecider.canRebalance(shardRouting, allocation);
        // short track if a NO is returned.
        if (decision == Decision.NO) {
            if (!allocation.debugDecision()) {
                return decision;
            } else {
                ret.add(decision);
            }
        } else if (decision != Decision.ALWAYS
                    && (allocation.getDebugMode() != EXCLUDE_YES_DECISIONS || decision.type() != Decision.Type.YES)) {
            ret.add(decision);
        }
    }
    return ret;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:AllocationDeciders.java

示例2: canAllocate

import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; //导入方法依赖的package包/类
@Override
public Decision canAllocate(IndexMetaData indexMetaData, RoutingNode node, RoutingAllocation allocation) {
    Decision.Multi ret = new Decision.Multi();
    for (AllocationDecider allocationDecider : allocations) {
        Decision decision = allocationDecider.canAllocate(indexMetaData, node, allocation);
        // short track if a NO is returned.
        if (decision == Decision.NO) {
            if (!allocation.debugDecision()) {
                return decision;
            } else {
                ret.add(decision);
            }
        } else if (decision != Decision.ALWAYS
                    && (allocation.getDebugMode() != EXCLUDE_YES_DECISIONS || decision.type() != Decision.Type.YES)) {
            ret.add(decision);
        }
    }
    return ret;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:AllocationDeciders.java

示例3: canRemain

import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; //导入方法依赖的package包/类
@Override
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
    if (allocation.shouldIgnoreShardForNode(shardRouting.shardId(), node.nodeId())) {
        if (logger.isTraceEnabled()) {
            logger.trace("Shard [{}] should be ignored for node [{}]", shardRouting, node.nodeId());
        }
        return Decision.NO;
    }
    Decision.Multi ret = new Decision.Multi();
    for (AllocationDecider allocationDecider : allocations) {
        Decision decision = allocationDecider.canRemain(shardRouting, node, allocation);
        // short track if a NO is returned.
        if (decision == Decision.NO) {
            if (logger.isTraceEnabled()) {
                logger.trace("Shard [{}] can not remain on node [{}] due to [{}]", shardRouting, node.nodeId(), allocationDecider.getClass().getSimpleName());
            }
            if (!allocation.debugDecision()) {
                return decision;
            } else {
                ret.add(decision);
            }
        } else if (decision != Decision.ALWAYS
                    && (allocation.getDebugMode() != EXCLUDE_YES_DECISIONS || decision.type() != Decision.Type.YES)) {
            ret.add(decision);
        }
    }
    return ret;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:29,代码来源:AllocationDeciders.java


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