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


Java RoutingAllocation.shouldIgnoreShardForNode方法代码示例

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


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

示例1: canAllocate

import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; //导入方法依赖的package包/类
@Override
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
    if (allocation.shouldIgnoreShardForNode(shardRouting.shardId(), node.nodeId())) {
        return Decision.NO;
    }
    Decision.Multi ret = new Decision.Multi();
    for (AllocationDecider allocationDecider : allocations) {
        Decision decision = allocationDecider.canAllocate(shardRouting, node, allocation);
        // short track if a NO is returned.
        if (decision == Decision.NO) {
            if (logger.isTraceEnabled()) {
                logger.trace("Can not allocate [{}] on node [{}] due to [{}]", shardRouting, node.node(), allocationDecider.getClass().getSimpleName());
            }
            // short circuit only if debugging is not enabled
            if (!allocation.debugDecision()) {
                return decision;
            } else {
                ret.add(decision);
            }
        } else if (decision != Decision.ALWAYS
                    && (allocation.getDebugMode() != EXCLUDE_YES_DECISIONS || decision.type() != Decision.Type.YES)) {
            // the assumption is that a decider that returns the static instance Decision#ALWAYS
            // does not really implements canAllocate
            ret.add(decision);
        }
    }
    return ret;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:29,代码来源:AllocationDeciders.java

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

示例3: canAllocate

import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; //导入方法依赖的package包/类
@Override
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
    if (allocation.shouldIgnoreShardForNode(shardRouting.shardId(), node.nodeId())) {
        return Decision.NO;
    }
    Decision.Multi ret = new Decision.Multi();
    for (AllocationDecider allocationDecider : allocations) {
        Decision decision = allocationDecider.canAllocate(shardRouting, node, allocation);
        // short track if a NO is returned.
        if (decision == Decision.NO) {
            if (logger.isTraceEnabled()) {
                logger.trace("Can not allocate [{}] on node [{}] due to [{}]", shardRouting, node.nodeId(), allocationDecider.getClass().getSimpleName());
            }
            // short circuit only if debugging is not enabled
            if (!allocation.debugDecision()) {
                return decision;
            } else {
                ret.add(decision);
            }
        } else if (decision != Decision.ALWAYS) {
            // the assumption is that a decider that returns the static instance Decision#ALWAYS
            // does not really implements canAllocate
            ret.add(decision);
        }
    }
    return ret;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:28,代码来源:AllocationDeciders.java

示例4: 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) {
            ret.add(decision);
        }
    }
    return ret;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:28,代码来源:AllocationDeciders.java


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