Class ReservedComposableIndexTemplateAction
- All Implemented Interfaces:
ReservedClusterStateHandler<org.elasticsearch.action.admin.indices.template.reservedstate.ReservedComposableIndexTemplateAction.ComponentsAndComposables>
ReservedClusterStateHandler
is responsible for reserved state
CRUD operations on composable index templates and component templates, e.g. file based settings.
Internally it uses MetadataIndexTemplateService
to add, update and delete both composable
index templates and component templates. The reserved state handler is implemented as a joint handler
for both component templates and composable index templates, because of the inherent interdependencies
of the two separate types. For example, one cannot create composable index templates without first the
component definitions being in the cluster state, however, the opposite is true when deleting. This
circular dependency makes it impossible for separation of the two handlers.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionReservedComposableIndexTemplateAction
(MetadataIndexTemplateService indexTemplateService, IndexScopedSettings indexScopedSettings) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Removes the reserved cluster state prefix from the component template namestatic String
Removes the reserved cluster state prefix from the composable index template nameorg.elasticsearch.action.admin.indices.template.reservedstate.ReservedComposableIndexTemplateAction.ComponentsAndComposables
fromXContent
(XContentParser parser) The parse content method which is called during parsing of file based content.name()
Unique identifier for the handler.static String
reservedComponentName
(String name) Prefixes the component template name with a prefix for storage in the cluster statestatic String
Prefixes the composable index template name with a prefix for storage in the cluster statetransform
(Object source, TransformState prevState) The transformation method implemented by the handler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.reservedstate.ReservedClusterStateHandler
dependencies, optionalDependencies, validate
-
Field Details
-
NAME
- See Also:
-
COMPONENTS
- See Also:
-
COMPOSABLES
- See Also:
-
COMPOSABLE_PREFIX
- See Also:
-
-
Constructor Details
-
ReservedComposableIndexTemplateAction
public ReservedComposableIndexTemplateAction(MetadataIndexTemplateService indexTemplateService, IndexScopedSettings indexScopedSettings)
-
-
Method Details
-
name
Description copied from interface:ReservedClusterStateHandler
Unique identifier for the handler.The handler name is a unique identifier that is matched to a section in a cluster state update content. The reserved cluster state updates are done as a single cluster state update and the cluster state is typically supplied as a combined content, unlike the REST handlers. This name must match a desired content key name in the combined cluster state update, e.g. "ilm" or "cluster_settings" (for persistent cluster settings update).
- Specified by:
name
in interfaceReservedClusterStateHandler<org.elasticsearch.action.admin.indices.template.reservedstate.ReservedComposableIndexTemplateAction.ComponentsAndComposables>
- Returns:
- a String with the handler name, e.g "ilm".
-
reservedComponentName
Prefixes the component template name with a prefix for storage in the cluster state- Parameters:
name
- component template name- Returns:
- prefixed component template name for storage in the reserved cluster state
-
componentNameFromReservedName
Removes the reserved cluster state prefix from the component template nameOnce the prefix is removed we can use the name for conflict validation in
TransportPutComponentTemplateAction
andTransportDeleteComponentTemplateAction
- Parameters:
name
- the prefixed reserved component template name- Returns:
- the un-prefixed component template name used for conflict validation at REST
-
reservedComposableIndexName
Prefixes the composable index template name with a prefix for storage in the cluster state- Parameters:
name
- composable index template name- Returns:
- prefixed composable index template name for storage in the reserved cluster state
-
composableIndexNameFromReservedName
Removes the reserved cluster state prefix from the composable index template nameOnce the prefix is removed we can use the name for conflict validation in
TransportPutComposableIndexTemplateAction
andTransportDeleteComposableIndexTemplateAction
- Parameters:
name
- the prefixed reserved composable index template name- Returns:
- the un-prefixed composable index template name used for conflict validation at REST
-
transform
Description copied from interface:ReservedClusterStateHandler
The transformation method implemented by the handler.The transform method of the handler should apply the necessary changes to the cluster state as it normally would in a REST handler. One difference is that the transform method in an reserved state handler must perform all CRUD operations of the cluster state in one go. For that reason, we supply a wrapper class to the cluster state called
TransformState
, which contains the current cluster state as well as any previous keys set by this handler on prior invocation.- Specified by:
transform
in interfaceReservedClusterStateHandler<org.elasticsearch.action.admin.indices.template.reservedstate.ReservedComposableIndexTemplateAction.ComponentsAndComposables>
- Parameters:
source
- The parsed information specific to this handler from the combined cluster state contentprevState
- The previous cluster state and keys set by this handler (if any)- Returns:
- The modified state and the current keys set by this handler
- Throws:
Exception
-
fromXContent
public org.elasticsearch.action.admin.indices.template.reservedstate.ReservedComposableIndexTemplateAction.ComponentsAndComposables fromXContent(XContentParser parser) throws IOException Description copied from interface:ReservedClusterStateHandler
The parse content method which is called during parsing of file based content.The immutable state can be provided as XContent, which means that each handler needs to implement a method to convert an XContent to an object it can consume later in transform
- Specified by:
fromXContent
in interfaceReservedClusterStateHandler<org.elasticsearch.action.admin.indices.template.reservedstate.ReservedComposableIndexTemplateAction.ComponentsAndComposables>
- Parameters:
parser
- the XContent parser we are parsing from- Returns:
- Throws:
IOException
-