Package org.elasticsearch.cluster.node
Class DiscoveryNodeRole
java.lang.Object
org.elasticsearch.cluster.node.DiscoveryNodeRole
- All Implemented Interfaces:
Comparable<DiscoveryNodeRole>
Represents a node role.
-
Field Summary
Modifier and TypeFieldDescriptionstatic DiscoveryNodeRole
Represents the role for a cold node.static DiscoveryNodeRole
Represents the role for a content node.static DiscoveryNodeRole
Represents the role for a frozen node.static DiscoveryNodeRole
Represents the role for a hot node.static DiscoveryNodeRole
Represents the role for a data node.static DiscoveryNodeRole
Represents the role for a warm node.static DiscoveryNodeRole
Represents the role for an ingest node.static DiscoveryNodeRole
Represents the role for a master-eligible node.static DiscoveryNodeRole
Represents the role for a machine learning node.static DiscoveryNodeRole
Represents the role for a node that can be a remote cluster client.static DiscoveryNodeRole
Represents the role for a transform node.static DiscoveryNodeRole
Represents the role for a voting-only node. -
Constructor Summary
ModifierConstructorDescriptionprotected
DiscoveryNodeRole(String roleName, String roleNameAbbreviation)
protected
DiscoveryNodeRole(String roleName, String roleNameAbbreviation, boolean canContainData)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether a node with this role can contain data.int
boolean
static DiscoveryNodeRole
getRoleFromRoleName(String roleName)
Get a representation of the role with the given role name, if such a role exists, otherwise an exception is thrown.int
hashCode()
boolean
isEnabledByDefault(Settings settings)
Whether or not the role is enabled by default given the specified settingsstatic Optional<DiscoveryNodeRole>
maybeGetRoleFromRoleName(String roleName)
Get an optional representing the role with the given role name, if such a role exists.roleName()
The name of the role.The abbreviation of the name of the role.The set of possible role names.static SortedSet<DiscoveryNodeRole>
roles()
The possible node roles.toString()
void
validateRoles(List<DiscoveryNodeRole> roles)
Validate this role against all configured roles.
-
Field Details
-
DATA_ROLE
Represents the role for a data node. -
DATA_CONTENT_NODE_ROLE
Represents the role for a content node. -
DATA_HOT_NODE_ROLE
Represents the role for a hot node. -
DATA_WARM_NODE_ROLE
Represents the role for a warm node. -
DATA_COLD_NODE_ROLE
Represents the role for a cold node. -
DATA_FROZEN_NODE_ROLE
Represents the role for a frozen node. -
INGEST_ROLE
Represents the role for an ingest node. -
MASTER_ROLE
Represents the role for a master-eligible node. -
VOTING_ONLY_NODE_ROLE
Represents the role for a voting-only node. -
REMOTE_CLUSTER_CLIENT_ROLE
Represents the role for a node that can be a remote cluster client. -
ML_ROLE
Represents the role for a machine learning node. -
TRANSFORM_ROLE
Represents the role for a transform node.
-
-
Constructor Details
-
DiscoveryNodeRole
-
DiscoveryNodeRole
-
-
Method Details
-
roleName
The name of the role.- Returns:
- the role name
-
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
-
isEnabledByDefault
Whether or not the role is enabled by default given the specified settings- Parameters:
settings
- the settings instance- Returns:
- true if the role is enabled by default given the specified settings, otherwise false
-
validateRoles
Validate this role against all configured roles. Implementors are expected to throw anIllegalArgumentException
when the combination of configured roles is invalid with this role.- Parameters:
roles
- the complete set of configured roles
-
equals
-
hashCode
public final int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<DiscoveryNodeRole>
-
toString
-
roles
The possible node roles.- Returns:
- an ordered, immutable set of possible roles
-
roleNames
The set of possible role names.- Returns:
- an ordered, immutable set of possible role names
-
maybeGetRoleFromRoleName
Get an optional representing the role with the given role name, if such a role exists.- Parameters:
roleName
- the role name to get the associated role representation for- Returns:
- an optional node role
-
getRoleFromRoleName
Get a representation of the role with the given role name, if such a role exists, otherwise an exception is thrown.- Parameters:
roleName
- the role name to get the associated role representation for- Returns:
- a node role
- Throws:
IllegalArgumentException
- if no node role with the given role name exists
-