Enum ServerType
- All Implemented Interfaces:
Serializable,Comparable<ServerType>
These types are externally visible (e.g., from the output of ServersResource.makeSimpleServer(org.apache.druid.client.DruidServer)).
For backwards compatibility, when presenting these types externally, the toString() representation of the enum should be used.
The toString() method converts the enum name() to lowercase and replaces underscores with hyphens,
which is the format expected for the server type string prior to the patch that introduced ServerType:
https://github.com/apache/druid/pull/4148
This is a historical occasion that this enum is different from NodeRole because
they are essentially the same abstraction, but merging them could only increase the complexity and drop the code
safety, because they name the same types differently ("indexer-executor" - "peon" and "realtime" - "middleManager")
and both expose them via JSON APIs.
These abstractions can probably be merged when Druid updates to Jackson 2.9 that supports JsonAliases, see
see https://github.com/apache/druid/issues/7152.
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerTypefromNodeRole(NodeRole nodeRole) static ServerTypefromString(String type) booleanIndicates this type of node is able to be a target of segment broadcast.abstract booleanIndicates this type of node is able to be a target of segment replication.abstract booleanIndicates this type of node is serving segments that are meant to be the target of fan-out by a Broker.toString()static ServerTypeReturns the enum constant of this type with the specified name.static ServerType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
HISTORICAL
-
BRIDGE
-
INDEXER_EXECUTOR
-
REALTIME
-
BROKER
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
isSegmentReplicationTarget
public abstract boolean isSegmentReplicationTarget()Indicates this type of node is able to be a target of segment replication.- Returns:
- true if it is available for replication
- See Also:
-
isSegmentBroadcastTarget
public boolean isSegmentBroadcastTarget()Indicates this type of node is able to be a target of segment broadcast.- Returns:
- true if it is available for broadcast.
-
isSegmentServer
public abstract boolean isSegmentServer()Indicates this type of node is serving segments that are meant to be the target of fan-out by a Broker. Nodes that return "true" here are often referred to as "data servers" or "data server processes". -
fromString
-
fromNodeRole
-
toString
- Overrides:
toStringin classEnum<ServerType>
-