public class AllocationService extends AbstractComponent
AllocationService
keeps AllocationDeciders
to choose nodes
for shard allocation. This class also manages new nodes joining the cluster
and rerouting of shards.deprecationLogger, logger, settings
Constructor and Description |
---|
AllocationService(Settings settings,
AllocationDeciders allocationDeciders,
GatewayAllocator gatewayAllocator,
ShardsAllocator shardsAllocator,
ClusterInfoService clusterInfoService) |
Modifier and Type | Method and Description |
---|---|
RoutingAllocation.Result |
applyFailedShard(ClusterState clusterState,
ShardRouting failedShard) |
RoutingAllocation.Result |
applyFailedShards(ClusterState clusterState,
java.util.List<FailedRerouteAllocation.FailedShard> failedShards)
Applies the failed shards.
|
RoutingAllocation.Result |
applyStartedShards(ClusterState clusterState,
java.util.List<? extends ShardRouting> startedShards)
Applies the started shards.
|
RoutingAllocation.Result |
applyStartedShards(ClusterState clusterState,
java.util.List<? extends ShardRouting> startedShards,
boolean withReroute) |
protected RoutingAllocation.Result |
buildResultAndLogHealthChange(RoutingAllocation allocation,
java.lang.String reason) |
protected RoutingAllocation.Result |
buildResultAndLogHealthChange(RoutingAllocation allocation,
java.lang.String reason,
RoutingExplanations explanations) |
static void |
cancelShard(ESLogger logger,
ShardRouting cancelledShard,
UnassignedInfo unassignedInfo,
RoutingNodes routingNodes) |
protected long |
currentNanoTime()
override this to control time based decisions during allocation
|
RoutingAllocation.Result |
reroute(ClusterState clusterState,
AllocationCommands commands,
boolean explain,
boolean retryFailed) |
RoutingAllocation.Result |
reroute(ClusterState clusterState,
java.lang.String reason)
Reroutes the routing table based on the live nodes.
|
protected RoutingAllocation.Result |
reroute(ClusterState clusterState,
java.lang.String reason,
boolean debug)
Reroutes the routing table based on the live nodes.
|
logDeprecatedSetting, logRemovedSetting, nodeName
@Inject public AllocationService(Settings settings, AllocationDeciders allocationDeciders, GatewayAllocator gatewayAllocator, ShardsAllocator shardsAllocator, ClusterInfoService clusterInfoService)
public RoutingAllocation.Result applyStartedShards(ClusterState clusterState, java.util.List<? extends ShardRouting> startedShards)
If the same instance of the routing table is returned, then no change has been made.
public RoutingAllocation.Result applyStartedShards(ClusterState clusterState, java.util.List<? extends ShardRouting> startedShards, boolean withReroute)
protected RoutingAllocation.Result buildResultAndLogHealthChange(RoutingAllocation allocation, java.lang.String reason)
protected RoutingAllocation.Result buildResultAndLogHealthChange(RoutingAllocation allocation, java.lang.String reason, RoutingExplanations explanations)
public RoutingAllocation.Result applyFailedShard(ClusterState clusterState, ShardRouting failedShard)
public RoutingAllocation.Result applyFailedShards(ClusterState clusterState, java.util.List<FailedRerouteAllocation.FailedShard> failedShards)
If the same instance of the routing table is returned, then no change has been made.
public RoutingAllocation.Result reroute(ClusterState clusterState, AllocationCommands commands, boolean explain, boolean retryFailed)
public RoutingAllocation.Result reroute(ClusterState clusterState, java.lang.String reason)
If the same instance of the routing table is returned, then no change has been made.
protected RoutingAllocation.Result reroute(ClusterState clusterState, java.lang.String reason, boolean debug)
If the same instance of the routing table is returned, then no change has been made.
public static void cancelShard(ESLogger logger, ShardRouting cancelledShard, UnassignedInfo unassignedInfo, RoutingNodes routingNodes)
protected long currentNanoTime()