/** * Creates a move decision for when rebalancing the shard is not allowed. */ public static MoveDecision cannotRebalance(Decision canRebalanceDecision, AllocationDecision allocationDecision, int currentNodeRanking, List<NodeAllocationResult> nodeDecisions) { return new MoveDecision(null, canRebalanceDecision, allocationDecision, null, nodeDecisions, currentNodeRanking); }
/** * Creates a new move decision from this decision, plus adding a remain decision. */ public MoveDecision withRemainDecision(Decision canRemainDecision) { return new MoveDecision(canRemainDecision, clusterRebalanceDecision, allocationDecision, targetNode, nodeDecisions, currentNodeRanking); }
/** * Creates a move decision for the shard being able to remain on its current node, so the shard won't * be forced to move to another node. */ public static MoveDecision stay(Decision canRemainDecision) { if (canRemainDecision != null) { assert canRemainDecision.type() != Type.NO; return new MoveDecision(canRemainDecision, null, AllocationDecision.NO_ATTEMPT, null, null, 0); } else { return CACHED_STAY_DECISION; } }
/** * Creates a decision for whether to move the shard to a different node to form a better cluster balance. */ public static MoveDecision rebalance(Decision canRebalanceDecision, AllocationDecision allocationDecision, @Nullable DiscoveryNode assignedNode, int currentNodeRanking, List<NodeAllocationResult> nodeDecisions) { return new MoveDecision(null, canRebalanceDecision, allocationDecision, assignedNode, nodeDecisions, currentNodeRanking); }
public ShardAllocationDecision(StreamInput in) throws IOException { allocateDecision = new AllocateUnassignedDecision(in); moveDecision = new MoveDecision(in); }
/** * Creates a move decision for the shard not being allowed to remain on its current node. * * @param canRemainDecision the decision for whether the shard is allowed to remain on its current node * @param allocationDecision the {@link AllocationDecision} for moving the shard to another node * @param assignedNode the node where the shard should move to * @param nodeDecisions the node-level decisions that comprised the final decision, non-null iff explain is true * @return the {@link MoveDecision} for moving the shard to another node */ public static MoveDecision cannotRemain(Decision canRemainDecision, AllocationDecision allocationDecision, DiscoveryNode assignedNode, List<NodeAllocationResult> nodeDecisions) { assert canRemainDecision != null; assert canRemainDecision.type() != Type.YES : "create decision with MoveDecision#stay instead"; if (nodeDecisions == null && allocationDecision == AllocationDecision.NO) { // the final decision is NO (no node to move the shard to) and we are not in explain mode, return a cached version return CACHED_CANNOT_MOVE_DECISION; } else { assert ((assignedNode == null) == (allocationDecision != AllocationDecision.YES)); return new MoveDecision(canRemainDecision, null, allocationDecision, assignedNode, nodeDecisions, 0); } }
/** * Creates a new move decision from this decision, plus adding a remain decision. */ public MoveDecision withRemainDecision(Decision canRemainDecision) { return new MoveDecision(canRemainDecision, clusterRebalanceDecision, allocationDecision, targetNode, nodeDecisions, currentNodeRanking); }
/** * Creates a move decision for when rebalancing the shard is not allowed. */ public static MoveDecision cannotRebalance(Decision canRebalanceDecision, AllocationDecision allocationDecision, int currentNodeRanking, List<NodeAllocationResult> nodeDecisions) { return new MoveDecision(null, canRebalanceDecision, allocationDecision, null, nodeDecisions, currentNodeRanking); }
/** * Creates a move decision for when rebalancing the shard is not allowed. */ public static MoveDecision cannotRebalance(Decision canRebalanceDecision, AllocationDecision allocationDecision, int currentNodeRanking, List<NodeAllocationResult> nodeDecisions) { return new MoveDecision(null, canRebalanceDecision, allocationDecision, null, nodeDecisions, currentNodeRanking); }
/** * Creates a move decision for when rebalancing the shard is not allowed. */ public static MoveDecision cannotRebalance(Decision canRebalanceDecision, AllocationDecision allocationDecision, int currentNodeRanking, List<NodeAllocationResult> nodeDecisions) { return new MoveDecision(null, canRebalanceDecision, allocationDecision, null, nodeDecisions, currentNodeRanking); }
/** * Creates a new move decision from this decision, plus adding a remain decision. */ public MoveDecision withRemainDecision(Decision canRemainDecision) { return new MoveDecision(canRemainDecision, clusterRebalanceDecision, allocationDecision, targetNode, nodeDecisions, currentNodeRanking); }
/** * Creates a new move decision from this decision, plus adding a remain decision. */ public MoveDecision withRemainDecision(Decision canRemainDecision) { return new MoveDecision(canRemainDecision, clusterRebalanceDecision, allocationDecision, targetNode, nodeDecisions, currentNodeRanking); }
/** * Creates a move decision for the shard being able to remain on its current node, so the shard won't * be forced to move to another node. */ public static MoveDecision stay(Decision canRemainDecision) { if (canRemainDecision != null) { assert canRemainDecision.type() != Type.NO; return new MoveDecision(canRemainDecision, null, AllocationDecision.NO_ATTEMPT, null, null, 0); } else { return CACHED_STAY_DECISION; } }
/** * Creates a decision for whether to move the shard to a different node to form a better cluster balance. */ public static MoveDecision rebalance(Decision canRebalanceDecision, AllocationDecision allocationDecision, @Nullable DiscoveryNode assignedNode, int currentNodeRanking, List<NodeAllocationResult> nodeDecisions) { return new MoveDecision(null, canRebalanceDecision, allocationDecision, assignedNode, nodeDecisions, currentNodeRanking); }
/** * Creates a move decision for the shard being able to remain on its current node, so the shard won't * be forced to move to another node. */ public static MoveDecision stay(Decision canRemainDecision) { if (canRemainDecision != null) { assert canRemainDecision.type() != Type.NO; return new MoveDecision(canRemainDecision, null, AllocationDecision.NO_ATTEMPT, null, null, 0); } else { return CACHED_STAY_DECISION; } }
/** * Creates a decision for whether to move the shard to a different node to form a better cluster balance. */ public static MoveDecision rebalance(Decision canRebalanceDecision, AllocationDecision allocationDecision, @Nullable DiscoveryNode assignedNode, int currentNodeRanking, List<NodeAllocationResult> nodeDecisions) { return new MoveDecision(null, canRebalanceDecision, allocationDecision, assignedNode, nodeDecisions, currentNodeRanking); }
/** * Creates a move decision for the shard being able to remain on its current node, so the shard won't * be forced to move to another node. */ public static MoveDecision stay(Decision canRemainDecision) { if (canRemainDecision != null) { assert canRemainDecision.type() != Type.NO; return new MoveDecision(canRemainDecision, null, AllocationDecision.NO_ATTEMPT, null, null, 0); } else { return CACHED_STAY_DECISION; } }
public ShardAllocationDecision(StreamInput in) throws IOException { allocateDecision = new AllocateUnassignedDecision(in); moveDecision = new MoveDecision(in); }
/** * Creates a decision for whether to move the shard to a different node to form a better cluster balance. */ public static MoveDecision rebalance(Decision canRebalanceDecision, AllocationDecision allocationDecision, @Nullable DiscoveryNode assignedNode, int currentNodeRanking, List<NodeAllocationResult> nodeDecisions) { return new MoveDecision(null, canRebalanceDecision, allocationDecision, assignedNode, nodeDecisions, currentNodeRanking); }
public ShardAllocationDecision(StreamInput in) throws IOException { allocateDecision = new AllocateUnassignedDecision(in); moveDecision = new MoveDecision(in); }