public class ShardsAllocators extends AbstractComponent implements ShardsAllocator
ShardsAllocator class offers methods for allocating shard within a cluster.
These methods include moving shards and re-balancing the cluster. It also allows management
of shards by their state.deprecationLogger, logger, settings| Constructor and Description |
|---|
ShardsAllocators(GatewayAllocator allocator) |
ShardsAllocators(Settings settings,
GatewayAllocator allocator) |
ShardsAllocators(Settings settings,
GatewayAllocator gatewayAllocator,
ShardsAllocator allocator) |
| 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 |
moveShards(RoutingAllocation allocation)
Move started shards that can not be allocated to a node anymore
|
protected long |
nanoTime() |
boolean |
rebalance(RoutingAllocation allocation)
Rebalancing number of shards on all nodes
|
logDeprecatedSetting, logRemovedSetting, nodeNamepublic ShardsAllocators(GatewayAllocator allocator)
public ShardsAllocators(Settings settings, GatewayAllocator allocator)
@Inject public ShardsAllocators(Settings settings, GatewayAllocator gatewayAllocator, ShardsAllocator allocator)
public void applyStartedShards(StartedRerouteAllocation allocation)
ShardsAllocatorShardRoutingState.STARTED from ShardRoutingState.RELOCATING
this allocator might apply some cleanups on the node that used to hold the shard.applyStartedShards in interface ShardsAllocatorallocation - all started shardspublic void applyFailedShards(FailedRerouteAllocation allocation)
ShardsAllocatorapplyFailedShards in interface ShardsAllocatorallocation - all failed shardspublic boolean allocateUnassigned(RoutingAllocation allocation)
ShardsAllocatorallocateUnassigned in interface ShardsAllocatorallocation - current node allocationtrue if the allocation has changed, otherwise falseprotected long nanoTime()
public boolean rebalance(RoutingAllocation allocation)
ShardsAllocatorrebalance in interface ShardsAllocatorallocation - current node allocationtrue if the allocation has changed, otherwise falsepublic boolean moveShards(RoutingAllocation allocation)
ShardsAllocatormoveShards in interface ShardsAllocatorallocation - current node allocationtrue if the allocation has changed, otherwise falseCopyright © 2009–2017. All rights reserved.