public interface ShardsAllocator
A 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 relocate to other nodes due to node failures or due to rebalancing decisions.
Modifier and Type | Method and Description |
---|---|
boolean |
allocateUnassigned(RoutingAllocation allocation)
Assign all unassigned shards to nodes
|
void |
applyFailedShards(FailedRerouteAllocation allocation)
Applies changes on failed nodes based on the implemented algorithm.
|
void |
applyStartedShards(StartedRerouteAllocation allocation)
Applies changes on started nodes based on the implemented algorithm.
|
boolean |
move(MutableShardRouting shardRouting,
RoutingNode node,
RoutingAllocation allocation)
Moves a shard from the given node to other node.
|
boolean |
rebalance(RoutingAllocation allocation)
Rebalancing number of shards on all nodes
|
void applyStartedShards(StartedRerouteAllocation allocation)
ShardRoutingState.STARTED
from ShardRoutingState.RELOCATING
this allocator might apply some cleanups on the node that used to hold the shard.allocation
- all started shards
void applyFailedShards(FailedRerouteAllocation allocation)
allocation
- all failed shards
boolean allocateUnassigned(RoutingAllocation allocation)
allocation
- current node allocationtrue
if the allocation has changed, otherwise false
boolean rebalance(RoutingAllocation allocation)
allocation
- current node allocationtrue
if the allocation has changed, otherwise false
boolean move(MutableShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
shardRouting
- the shard to movenode
- A node containing the shardallocation
- current node allocationtrue
if the allocation has changed, otherwise false
Copyright © 2009–2015. All rights reserved.