Class DiscoveryNodeRole

java.lang.Object
org.elasticsearch.cluster.node.DiscoveryNodeRole
All Implemented Interfaces:
java.lang.Comparable<DiscoveryNodeRole>

public abstract class DiscoveryNodeRole
extends java.lang.Object
implements java.lang.Comparable<DiscoveryNodeRole>
Represents a node role.
  • Field Details

  • Constructor Details

    • DiscoveryNodeRole

      protected DiscoveryNodeRole​(java.lang.String roleName, java.lang.String roleNameAbbreviation)
    • DiscoveryNodeRole

      protected DiscoveryNodeRole​(java.lang.String roleName, java.lang.String roleNameAbbreviation, boolean canContainData)
  • Method Details

    • roleName

      public final java.lang.String roleName()
      The name of the role.
      Returns:
      the role name
    • roleNameAbbreviation

      public final java.lang.String roleNameAbbreviation()
      The abbreviation of the name of the role. This is used in the cat nodes API to display an abbreviated version of the name of the role.
      Returns:
      the role name abbreviation
    • canContainData

      public final boolean canContainData()
      Indicates whether a node with this role can contain data.
      Returns:
      true if a node with this role can contain data, otherwise false
    • isKnownRole

      public final boolean isKnownRole()
      Whether this role is known by this node, or is an DiscoveryNodeRole.UnknownRole.
    • isEnabledByDefault

      public boolean isEnabledByDefault​(Settings settings)
    • legacySetting

      public abstract Setting<java.lang.Boolean> legacySetting()
    • getCompatibilityRole

      public DiscoveryNodeRole getCompatibilityRole​(Version nodeVersion)
      When serializing a DiscoveryNodeRole, the role may not be available to nodes of previous versions, where the role had not yet been added. This method allows overriding the role that should be serialized when communicating to versions prior to the introduction of the discovery node role.
    • equals

      public final boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • compareTo

      public final int compareTo​(DiscoveryNodeRole o)
      Specified by:
      compareTo in interface java.lang.Comparable<DiscoveryNodeRole>
    • toString

      public final java.lang.String toString()
      Overrides:
      toString in class java.lang.Object