Module org.elasticsearch.server
Class TransportCleanupRepositoryAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<Request,Response>
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
RepositoryCleanupInProgress
in 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
Fields inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
clusterService, executor, indexNameExpressionResolver, threadPool, transportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager
-
Constructor Summary
ConstructorDescriptionTransportCleanupRepositoryAction
(TransportService transportService, ClusterService clusterService, RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected ClusterBlockException
checkBlock
(CleanupRepositoryRequest request, ClusterState state) protected void
masterOperation
(Task task, CleanupRepositoryRequest request, ClusterState state, ActionListener<CleanupRepositoryResponse> listener) Methods inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
doExecute, localExecute
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, localOnly
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.ActionWithReservedState
modifiedKeys, reservedStateHandlerName, validateForReservedState
-
Constructor Details
-
TransportCleanupRepositoryAction
@Inject public TransportCleanupRepositoryAction(TransportService transportService, ClusterService clusterService, RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Details
-
masterOperation
protected void masterOperation(Task task, CleanupRepositoryRequest request, ClusterState state, ActionListener<CleanupRepositoryResponse> listener) - Specified by:
masterOperation
in classTransportMasterNodeAction<CleanupRepositoryRequest,
CleanupRepositoryResponse>
-
checkBlock
- Specified by:
checkBlock
in classTransportMasterNodeAction<CleanupRepositoryRequest,
CleanupRepositoryResponse>
-