Class ReservedRepositoryAction
- All Implemented Interfaces:
ReservedClusterStateHandler<List<PutRepositoryRequest>>
It is used by the ReservedClusterStateService to add/update or remove snapshot repositories. Typical usage for this action is in the context of file based settings.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionReservedRepositoryAction
(RepositoriesService repositoriesService) Creates a ReservedRepositoryAction -
Method Summary
Modifier and TypeMethodDescriptionfromXContent
(XContentParser parser) The parse content method which is called during parsing of file based content.name()
Unique identifier for the handler.transform
(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:
-
-
Constructor Details
-
ReservedRepositoryAction
Creates a ReservedRepositoryAction- Parameters:
repositoriesService
- requires RepositoriesService for the cluster state operations
-
-
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<List<PutRepositoryRequest>>
- Returns:
- a String with the handler name, e.g "ilm".
-
prepare
-
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<List<PutRepositoryRequest>>
- 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
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<List<PutRepositoryRequest>>
- Parameters:
parser
- the XContent parser we are parsing from- Returns:
- Throws:
IOException
-