Class NodeShutdownAllocationDecider
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.NodeShutdownAllocationDecider
An allocation decider that prevents shards from being allocated to a
node that is in the process of shutting down.
In short: No shards can be allocated to, or remain on, a node which is
shutting down for removal. Primary shards cannot be allocated to, or remain
on, a node which is shutting down for restart.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncanAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Determines if a shard can be allocated to a particular node, based on whether that node is shutting down or not.canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Applies the same rules ascanAllocate(ShardRouting, RoutingNode, RoutingAllocation)
to determine if shards can remain on their current node.shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation)
Prevents indices from being auto-expanded to nodes which are in the process of shutting down, regardless of whether they're shutting down for restart or removal.Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocate, canForceAllocatePrimary, canRebalance, canRebalance
-
Constructor Details
-
NodeShutdownAllocationDecider
public NodeShutdownAllocationDecider()
-
-
Method Details
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Determines if a shard can be allocated to a particular node, based on whether that node is shutting down or not.- Overrides:
canAllocate
in classAllocationDecider
-
canRemain
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Applies the same rules ascanAllocate(ShardRouting, RoutingNode, RoutingAllocation)
to determine if shards can remain on their current node.- Overrides:
canRemain
in classAllocationDecider
-
shouldAutoExpandToNode
public Decision shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation)Prevents indices from being auto-expanded to nodes which are in the process of shutting down, regardless of whether they're shutting down for restart or removal.- Overrides:
shouldAutoExpandToNode
in classAllocationDecider
-