Module org.elasticsearch.server
Class TransportCleanupRepositoryAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
org.elasticsearch.action.support.HandledTransportAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
org.elasticsearch.action.support.master.TransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
org.elasticsearch.action.admin.cluster.repositories.cleanup.TransportCleanupRepositoryAction
- All Implemented Interfaces:
ActionWithReservedState<CleanupRepositoryRequest>
public final class TransportCleanupRepositoryAction
extends TransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
Repository cleanup action for repository implementations based on
BlobStoreRepository.
The steps taken by the repository cleanup operation are as follows:
- Check that there are no running repository cleanup, snapshot create, or snapshot delete actions
and add an entry for the repository that is to be cleaned up to
RepositoryCleanupInProgress - Run cleanup actions on the repository. Note, these are executed exclusively on the master node.
For the precise operations execute see
BlobStoreRepository.cleanup(long, org.elasticsearch.index.IndexVersion, org.elasticsearch.action.ActionListener<org.elasticsearch.common.blobstore.DeleteResult>) - Remove the entry in
RepositoryCleanupInProgressin the first step.
BlobStoreRepository.cleanup(long, org.elasticsearch.index.IndexVersion, org.elasticsearch.action.ActionListener<org.elasticsearch.common.blobstore.DeleteResult>) ensures that the repository state id has not changed between creation of the cluster state entry
and any delete/write operations. TODO: This will not work if we also want to clean up at the shard level as those will involve writes
as well as deletes.-
Field Summary
FieldsFields inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
clusterService, executor, threadPool, transportServiceFields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager -
Constructor Summary
ConstructorsConstructorDescriptionTransportCleanupRepositoryAction(TransportService transportService, ClusterService clusterService, RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters) -
Method Summary
Modifier and TypeMethodDescriptionprotected ClusterBlockExceptioncheckBlock(CleanupRepositoryRequest request, ClusterState state) protected voidmasterOperation(Task task, CleanupRepositoryRequest request, ClusterState state, ActionListener<CleanupRepositoryResponse> listener) Methods inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
doExecute, localExecute, validateForReservedStateMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, executeDirect, localOnlyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.reservedstate.ActionWithReservedState
modifiedKeys, reservedStateHandlerName, validateForReservedState
-
Field Details
-
TYPE
-
-
Constructor Details
-
TransportCleanupRepositoryAction
@Inject public TransportCleanupRepositoryAction(TransportService transportService, ClusterService clusterService, RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters)
-
-
Method Details
-
masterOperation
protected void masterOperation(Task task, CleanupRepositoryRequest request, ClusterState state, ActionListener<CleanupRepositoryResponse> listener) - Specified by:
masterOperationin classTransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
-
checkBlock
- Specified by:
checkBlockin classTransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
-