Enum ServerType
- java.lang.Object
-
- java.lang.Enum<ServerType>
-
- org.apache.druid.server.coordination.ServerType
-
- All Implemented Interfaces:
Serializable,Comparable<ServerType>
public enum ServerType extends Enum<ServerType>
This enum represents types of druid services that hold segments.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
NodeRolebecause 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 Enum Constant Description BRIDGEBROKERHISTORICALINDEXER_EXECUTORREALTIME
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ServerTypefromNodeRole(NodeRole nodeRole)static ServerTypefromString(String type)booleanisSegmentBroadcastTarget()Indicates this type of node is able to be a target of segment broadcast.abstract booleanisSegmentReplicationTarget()Indicates this type of node is able to be a target of segment replication.abstract booleanisSegmentServer()Indicates this type of node is serving segments that are meant to be the target of fan-out by a Broker.StringtoString()static ServerTypevalueOf(String name)Returns 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 Detail
-
HISTORICAL
public static final ServerType HISTORICAL
-
BRIDGE
public static final ServerType BRIDGE
-
INDEXER_EXECUTOR
public static final ServerType INDEXER_EXECUTOR
-
REALTIME
public static final ServerType REALTIME
-
BROKER
public static final ServerType BROKER
-
-
Method Detail
-
values
public static ServerType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ServerType c : ServerType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ServerType valueOf(String name)
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:
LoadRule
-
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
public static ServerType fromString(String type)
-
fromNodeRole
public static ServerType fromNodeRole(NodeRole nodeRole)
-
toString
public String toString()
- Overrides:
toStringin classEnum<ServerType>
-
-