Class DataTier
java.lang.Object
org.elasticsearch.cluster.routing.allocation.DataTier
The
DataTier
class encapsulates the formalization of the "content",
"hot", "warm", and "cold" tiers as node roles. In contains the
roles themselves as well as helpers for validation and determining if a node
has a tier configured.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This setting provider injects the setting allocating all newly created indices withindex.routing.allocation.include._tier: "data_hot"
unless the user overrides the setting while the index is being created (in a create index request for instance) -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Compares the provided tiers for coldness order (eg.static Set<DiscoveryNode>
dataNodesWithoutAllDataRoles
(ClusterState clusterState) Checks each data node in the cluster state to see whether it has the explicit data role or if it has all data tiers (e.g.static String
getPreferredTiersConfiguration
(String targetTier) Based on the provided target tier it will return a comma separated list of preferred tiers.static Settings
getPreferredTiersConfigurationSettings
(String targetTier) static boolean
isColdNode
(DiscoveryNode discoveryNode) static boolean
isContentNode
(DiscoveryNode discoveryNode) static boolean
isExplicitDataTier
(Settings settings) Returns true iff the given settings have a data tier setting configuredstatic boolean
isFrozenNode
(Set<DiscoveryNodeRole> roles) static boolean
isFrozenNode
(DiscoveryNode discoveryNode) static boolean
isHotNode
(DiscoveryNode discoveryNode) static boolean
isWarmNode
(DiscoveryNode discoveryNode) parseTierList
(String tiers) static boolean
validTierName
(String tierName) Returns true if the given tier name is a valid tier
-
Field Details
-
DATA_CONTENT
- See Also:
-
DATA_HOT
- See Also:
-
DATA_WARM
- See Also:
-
DATA_COLD
- See Also:
-
DATA_FROZEN
- See Also:
-
ALL_DATA_TIERS
-
ENFORCE_DEFAULT_TIER_PREFERENCE
- See Also:
-
ENFORCE_DEFAULT_TIER_PREFERENCE_SETTING
-
TIER_PREFERENCE
- See Also:
-
DATA_TIER_SETTING_VALIDATOR
-
TIER_PREFERENCE_SETTING
-
-
Constructor Details
-
DataTier
public DataTier()
-
-
Method Details
-
validTierName
Returns true if the given tier name is a valid tier -
getPreferredTiersConfiguration
Based on the provided target tier it will return a comma separated list of preferred tiers. ie. if `data_cold` is the target tier, it will return `data_cold,data_warm,data_hot`. This is usually used in conjunction withTIER_PREFERENCE_SETTING
. -
getPreferredTiersConfigurationSettings
-
isExplicitDataTier
Returns true iff the given settings have a data tier setting configured -
isContentNode
-
isHotNode
-
isWarmNode
-
isColdNode
-
isFrozenNode
-
isFrozenNode
-
parseTierList
-
compare
Compares the provided tiers for coldness order (eg. warm is colder than hot). Similar toComparator.compare(Object, Object)
returns -1 if tier1 is colder than tier2 (ie. compare("data_cold", "data_hot")) 0 if tier1 is as cold as tier2 (ie. tier1.equals(tier2) ) 1 if tier1 is warmer than tier2 (ie. compare("data_hot", "data_cold")) The provided tiers parameters must be valid data tiers values (ie.ALL_DATA_TIERS
. NOTE: `data_content` is treated as "equal to data_hot" in the tiers hierarchy. If invalid tier names are passed the result is non-deterministic. -
dataNodesWithoutAllDataRoles
Checks each data node in the cluster state to see whether it has the explicit data role or if it has all data tiers (e.g. 'data_hot', 'data_warm', etc). The former condition being treated as a shortcut for the latter condition (see DataTierAllocationDecider#allocationAllowed(String, Set)) for details, as well as the various DataTier#isFooNode(DiscoveryNode) methods.- Parameters:
clusterState
- the cluster state- Returns:
- a set of data nodes that do not have all data roles
-