本文整理汇总了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;
}
示例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;
}
示例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;
}