public class NodeRole extends Object
name that is distinct from jsonName, and is the previous value
which would occur when the enum was used in a 'toString' context. Custom node roles allow extension to participate
in announcement and discovery, but are limited to only using jsonName for both toString and JSON serde.
The historical context of why the enum was different from ServerType
(also called "node type" in various places) is because while they are essentially the same abstraction, merging them
could only increase the complexity and drop the code safety, because they name the same types differently
("peon" - "indexer-executor" and "middleManager" - "realtime") and both expose them via JSON APIs.
These abstractions can all potentially be merged when Druid updates to Jackson 2.9 that supports JsonAliases,
see https://github.com/apache/druid/issues/7152.| Modifier and Type | Field and Description |
|---|---|
static NodeRole |
BROKER |
static String |
BROKER_JSON_NAME |
static NodeRole |
COORDINATOR |
static String |
COORDINATOR_JSON_NAME |
static NodeRole |
HISTORICAL |
static String |
HISTORICAL_JSON_NAME |
static NodeRole |
INDEXER |
static String |
INDEXER_JSON_NAME |
static NodeRole |
MIDDLE_MANAGER |
static String |
MIDDLE_MANAGER_JSON_NAME |
static NodeRole |
OVERLORD |
static String |
OVERLORD_JSON_NAME |
static NodeRole |
PEON |
static String |
PEON_JSON_NAME |
static NodeRole |
ROUTER |
static String |
ROUTER_JSON_NAME |
| Constructor and Description |
|---|
NodeRole(String jsonName)
Create a custom node role.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
static NodeRole |
fromJsonName(String jsonName) |
com.google.inject.name.Named |
getDruidServiceInjectName() |
String |
getJsonName() |
int |
hashCode() |
String |
toString() |
static NodeRole[] |
values()
built-in node roles
|
public static final String COORDINATOR_JSON_NAME
public static final String HISTORICAL_JSON_NAME
public static final String BROKER_JSON_NAME
public static final String OVERLORD_JSON_NAME
public static final String PEON_JSON_NAME
public static final String ROUTER_JSON_NAME
public static final String MIDDLE_MANAGER_JSON_NAME
public static final String INDEXER_JSON_NAME
public static final NodeRole COORDINATOR
public static final NodeRole HISTORICAL
public static final NodeRole BROKER
public static final NodeRole OVERLORD
public static final NodeRole PEON
public static final NodeRole ROUTER
public static final NodeRole MIDDLE_MANAGER
public static final NodeRole INDEXER
public NodeRole(String jsonName)
COORDINATOR, OVERLORD, ROUTER, BROKERINDEXER,
MIDDLE_MANAGER, HISTORICAL) instead of constructing a new instance.Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.