if ( allocation.routingNodes().hasInactiveShards() ) { return allocation.decision(Decision.NO, NAME, "the cluster has inactive shards and cluster setting [%s] is set to [%s]",
@Override public Decision canRebalance(RoutingAllocation allocation) { if (type == ClusterRebalanceType.INDICES_PRIMARIES_ACTIVE) { // check if there are unassigned primaries. if (allocation.routingNodes().hasUnassignedPrimaries()) { return allocation.decision(Decision.NO, NAME, "cluster has unassigned primary shards"); } // check if there are initializing primaries that don't have a relocatingNodeId entry. if (allocation.routingNodes().hasInactivePrimaries()) { return allocation.decision(Decision.NO, NAME, "cluster has inactive primary shards"); } return allocation.decision(Decision.YES, NAME, "all primary shards are active"); } if (type == ClusterRebalanceType.INDICES_ALL_ACTIVE) { // check if there are unassigned shards. if (allocation.routingNodes().hasUnassignedShards()) { return allocation.decision(Decision.NO, NAME, "cluster has unassigned shards"); } // in case all indices are assigned, are there initializing shards which // are not relocating? if (allocation.routingNodes().hasInactiveShards()) { return allocation.decision(Decision.NO, NAME, "cluster has inactive shards"); } } // type == Type.ALWAYS return allocation.decision(Decision.YES, NAME, "all shards are active"); } }
if ( allocation.routingNodes().hasInactiveShards() ) { return allocation.decision(Decision.NO, NAME, "the cluster has inactive shards and cluster setting [%s] is set to [%s]",
if ( allocation.routingNodes().hasInactiveShards() ) { return allocation.decision(Decision.NO, NAME, "the cluster has inactive shards and cluster setting [%s] is set to [%s]",
if ( allocation.routingNodes().hasInactiveShards() ) { return allocation.decision(Decision.NO, NAME, "the cluster has inactive shards and cluster setting [%s] is set to [%s]",