public enum ServerType extends Enum<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 and Description |
|---|
BRIDGE |
BROKER |
HISTORICAL |
INDEXER_EXECUTOR |
REALTIME |
| Modifier and Type | Method and Description |
|---|---|
static ServerType |
fromString(String type) |
boolean |
isSegmentBroadcastTarget()
Indicates this type of node is able to be a target of segment broadcast.
|
abstract boolean |
isSegmentReplicationTarget()
Indicates this type of node is able to be a target of segment replication.
|
abstract boolean |
isSegmentServer()
Indicates this type of node is serving segments that are meant to be the target of fan-out by a Broker.
|
String |
toString() |
static ServerType |
valueOf(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.
|
public static final ServerType HISTORICAL
public static final ServerType BRIDGE
public static final ServerType INDEXER_EXECUTOR
public static final ServerType REALTIME
public static final ServerType BROKER
public static ServerType[] values()
for (ServerType c : ServerType.values()) System.out.println(c);
public static ServerType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract boolean isSegmentReplicationTarget()
LoadRulepublic boolean isSegmentBroadcastTarget()
public abstract boolean isSegmentServer()
public static ServerType fromString(String type)
public String toString()
toString in class Enum<ServerType>Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.