Package org.apache.druid.discovery
Class NodeRole
java.lang.Object
org.apache.druid.discovery.NodeRole
Defines the 'role' of a Druid service, utilized to strongly type announcement and service discovery.
Originally, this was an enum to add type safety for discovery and announcement purposes, but was expanded
into a class to allow for extensibility while retaining the type safety of using defined types instead of raw
strings. As such, this class tries to mimic the interface provided by the previous enum.
Built in node roles define a
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NodeRolestatic final Stringstatic final NodeRolestatic final Stringstatic final NodeRolestatic final Stringstatic final NodeRolestatic final Stringstatic final NodeRolestatic final Stringstatic final NodeRolestatic final Stringstatic final NodeRolestatic final Stringstatic final NodeRolestatic final String -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
COORDINATOR_JSON_NAME
- See Also:
-
HISTORICAL_JSON_NAME
- See Also:
-
BROKER_JSON_NAME
- See Also:
-
OVERLORD_JSON_NAME
- See Also:
-
PEON_JSON_NAME
- See Also:
-
ROUTER_JSON_NAME
- See Also:
-
MIDDLE_MANAGER_JSON_NAME
- See Also:
-
INDEXER_JSON_NAME
- See Also:
-
COORDINATOR
-
HISTORICAL
-
BROKER
-
OVERLORD
-
PEON
-
ROUTER
-
MIDDLE_MANAGER
-
INDEXER
-
-
Constructor Details
-
NodeRole
Create a custom node role. Known Druid node roles should ALWAYS use the built-in static node roles: (COORDINATOR,OVERLORD,ROUTER,BROKERINDEXER,MIDDLE_MANAGER,HISTORICAL) instead of constructing a new instance.
-
-
Method Details