public interface ShardsAllocator
ShardsAllocator is the main entry point for shard allocation on nodes in the cluster.
The allocator makes basic decision where a shard instance will be allocated, if already allocated instances
need to relocate to other nodes due to node failures or due to rebalancing decisions.
|Modifier and Type||Method and Description|
Allocates shards to nodes in the cluster.
Returns the decision for where a shard should reside in the cluster.
void allocate(RoutingAllocation allocation)
allocation- current node allocation
ShardAllocationDecision decideShardAllocation(ShardRouting shard, RoutingAllocation allocation)
AllocateUnassignedDecisionwill be non-null. If the shard is not in the unassigned state, then the
MoveDecisionwill be non-null. This method is primarily used by the cluster allocation explain API to provide detailed explanations for the allocation of a single shard. Implementations of the
allocate(RoutingAllocation)method may use the results of this method implementation to decide on allocating shards in the routing table to the cluster. If an implementation of this interface does not support explaining decisions for a single shard through the cluster explain API, then this method should throw a