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 NodeRole |
COORDINATOR |
static NodeRole |
HISTORICAL |
static NodeRole |
INDEXER |
static NodeRole |
MIDDLE_MANAGER |
static NodeRole |
OVERLORD |
static NodeRole |
PEON |
static NodeRole |
ROUTER |
| 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) |
String |
getJsonName() |
int |
hashCode() |
String |
toString() |
static NodeRole[] |
values()
built-in node roles
|
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–2021 The Apache Software Foundation. All rights reserved.