Package org.opensearch.cluster.node
Class DiscoveryNodeRole
java.lang.Object
org.opensearch.cluster.node.DiscoveryNodeRole
- All Implemented Interfaces:
Comparable<DiscoveryNodeRole>
@PublicApi(since="1.0.0")
public abstract class DiscoveryNodeRole
extends Object
implements Comparable<DiscoveryNodeRole>
Represents a node role.
- Opensearch.api:
-
Field Summary
Modifier and TypeFieldDescriptionstatic SortedSet
<DiscoveryNodeRole> The built-in node roles.static final DiscoveryNodeRole
Represents the role for a cluster-manager-eligible node.static final DiscoveryNodeRole
Represents the role for a data node.static final DiscoveryNodeRole
Represents the role for an ingest node.static final DiscoveryNodeRole
Deprecated.static final String
static final DiscoveryNodeRole
static final org.opensearch.Version
The version thatREMOTE_CLUSTER_CLIENT_ROLE
is introduced.static final DiscoveryNodeRole
Represents the role for a search node, which is dedicated to provide search capability. -
Constructor Summary
ModifierConstructorDescriptionprotected
DiscoveryNodeRole
(String roleName, String roleNameAbbreviation) protected
DiscoveryNodeRole
(String roleName, String roleNameAbbreviation, boolean canContainData) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether a node with this role can contain data.final int
final boolean
getCompatibilityRole
(org.opensearch.Version nodeVersion) When serializing aDiscoveryNodeRole
, the role may not be available to nodes of previous versions, where the role had not yet been added.final int
hashCode()
boolean
Deprecated.As of 2.0, because promoting inclusive language.final boolean
boolean
isEnabledByDefault
(Settings settings) final boolean
Whether this role is known by this node, or is anDiscoveryNodeRole.UnknownRole
.final String
roleName()
The name of the role.final String
The abbreviation of the name of the role.final String
toString()
void
validateRole
(List<DiscoveryNodeRole> roles) Validate the role is compatible with the other roles in the list, when assigning the list of roles to a node.
-
Field Details
-
MASTER_ROLE_DEPRECATION_MESSAGE
- See Also:
-
DATA_ROLE
Represents the role for a data node. -
INGEST_ROLE
Represents the role for an ingest node. -
MASTER_ROLE
Deprecated.As of 2.0, because promoting inclusive language, replaced byCLUSTER_MANAGER_ROLE
Represents the role for a cluster-manager-eligible node. -
CLUSTER_MANAGER_ROLE
Represents the role for a cluster-manager-eligible node. -
REMOTE_CLUSTER_CLIENT_ROLE
-
SEARCH_ROLE
Represents the role for a search node, which is dedicated to provide search capability. -
BUILT_IN_ROLES
The built-in node roles. -
REMOTE_CLUSTER_CLIENT_ROLE_VERSION
public static final org.opensearch.Version REMOTE_CLUSTER_CLIENT_ROLE_VERSIONThe version thatREMOTE_CLUSTER_CLIENT_ROLE
is introduced. Nodes before this version do not have that role even they can connect to remote clusters.
-
-
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
-
isKnownRole
public final boolean isKnownRole()Whether this role is known by this node, or is anDiscoveryNodeRole.UnknownRole
. -
isDynamicRole
public final boolean isDynamicRole() -
isEnabledByDefault
-
legacySetting
-
getCompatibilityRole
When serializing aDiscoveryNodeRole
, 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. -
validateRole
Validate the role is compatible with the other roles in the list, when assigning the list of roles to a node. AnIllegalArgumentException
is expected to be thrown, if the role can't coexist with the other roles.- Parameters:
roles
- aList
ofDiscoveryNodeRole
that a node is going to have
-
equals
-
hashCode
public final int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<DiscoveryNodeRole>
-
toString
-
isClusterManager
Deprecated.As of 2.0, because promoting inclusive language. MASTER_ROLE is deprecated.Check if the role isCLUSTER_MANAGER_ROLE
orMASTER_ROLE
.- Returns:
- true if the node role is
CLUSTER_MANAGER_ROLE
orMASTER_ROLE
-
CLUSTER_MANAGER_ROLE