Module org.elasticsearch.xcore
Class DataTierAllocationDecider
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider
The
DataTierAllocationDecider is a custom allocation decider that behaves similar to the
FilterAllocationDecider, however it
is specific to the _tier setting for both the cluster and index level.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallocationAllowed(String tierName, Set<DiscoveryNodeRole> roles) canAllocate(IndexMetadata indexMetadata, RoutingNode node, RoutingAllocation allocation) canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) canRemain(IndexMetadata indexMetadata, ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) getPreferredTierFromDesiredNodes(List<String> prioritizedTiers, DiscoveryNodes discoveryNodes, DesiredNodes desiredNodes) Given a list of tiers in descending order, return the tier that's present in the desired nodes with the highest priority, if none is present returns anOptional.empty().preferredAvailableTier(List<String> prioritizedTiers, DiscoveryNodes nodes, DesiredNodes desiredNodes, NodesShutdownMetadata shutdownMetadata) Given a string of comma-separated prioritized tiers (highest priority first) and an allocation, find the highest priority tier for which nodes exist.shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation) static DecisionshouldFilter(IndexMetadata indexMd, DiscoveryNode node, DataTierAllocationDecider.PreferredTierFunction preferredTierFunction, RoutingAllocation allocation) Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocateReplicaWhenThereIsRetentionLease, canForceAllocateDuringReplace, canForceAllocatePrimary, canRebalance, canRebalance, getForcedInitialShardAllocationToNodes
-
Field Details
-
NAME
- See Also:
-
INSTANCE
-
-
Method Details
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) - Overrides:
canAllocatein classAllocationDecider
-
canAllocate
public Decision canAllocate(IndexMetadata indexMetadata, RoutingNode node, RoutingAllocation allocation) - Overrides:
canAllocatein classAllocationDecider
-
canRemain
public Decision canRemain(IndexMetadata indexMetadata, ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) - Overrides:
canRemainin classAllocationDecider
-
shouldAutoExpandToNode
public Decision shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation) - Overrides:
shouldAutoExpandToNodein classAllocationDecider
-
shouldFilter
public static Decision shouldFilter(IndexMetadata indexMd, DiscoveryNode node, DataTierAllocationDecider.PreferredTierFunction preferredTierFunction, RoutingAllocation allocation) -
preferredAvailableTier
public static Optional<String> preferredAvailableTier(List<String> prioritizedTiers, DiscoveryNodes nodes, DesiredNodes desiredNodes, NodesShutdownMetadata shutdownMetadata) Given a string of comma-separated prioritized tiers (highest priority first) and an allocation, find the highest priority tier for which nodes exist. If no nodes for any of the tiers are available, returns an emptyOptional<String>. This method takes into account the desired nodes in order to know if there are planned topology changes in the cluster that can remove a tier that's part of the cluster now. -
getPreferredTierFromDesiredNodes
public static Optional<String> getPreferredTierFromDesiredNodes(List<String> prioritizedTiers, DiscoveryNodes discoveryNodes, DesiredNodes desiredNodes) Given a list of tiers in descending order, return the tier that's present in the desired nodes with the highest priority, if none is present returns anOptional.empty(). -
allocationAllowed
-