public class DataTier extends Object
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.
  • Field Details

  • Constructor Details

    • DataTier

      public DataTier()
  • Method Details

    • validTierName

      public static boolean validTierName(String tierName)
      Returns true if the given tier name is a valid tier
    • getPreferredTiersConfiguration

      public static String getPreferredTiersConfiguration(String targetTier)
      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 with TIER_PREFERENCE_SETTING.
    • getPreferredTiersConfigurationSettings

      public static Settings getPreferredTiersConfigurationSettings(String targetTier)
    • isExplicitDataTier

      public static boolean isExplicitDataTier(Settings settings)
      Returns true iff the given settings have a data tier setting configured
    • isContentNode

      public static boolean isContentNode(DiscoveryNode discoveryNode)
    • isHotNode

      public static boolean isHotNode(DiscoveryNode discoveryNode)
    • isWarmNode

      public static boolean isWarmNode(DiscoveryNode discoveryNode)
    • isColdNode

      public static boolean isColdNode(DiscoveryNode discoveryNode)
    • isFrozenNode

      public static boolean isFrozenNode(DiscoveryNode discoveryNode)
    • isFrozenNode

      public static boolean isFrozenNode(Set<DiscoveryNodeRole> roles)
    • parseTierList

      public static List<String> parseTierList(String tiers)
    • compare

      public static int compare(String tier1, String tier2)
      Compares the provided tiers for coldness order (eg. warm is colder than hot). Similar to, 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

      public 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. '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.
      clusterState - the cluster state
      a set of data nodes that do not have all data roles