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
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.Version, org.elasticsearch.action.ActionListener<org.elasticsearch.repositories.RepositoryCleanupResult>) - Remove the entry in
RepositoryCleanupInProgressin the first step.
BlobStoreRepository.cleanup(long, org.elasticsearch.Version, org.elasticsearch.action.ActionListener<org.elasticsearch.repositories.RepositoryCleanupResult>) 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, transportServiceFields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, taskManager -
Constructor Summary
ConstructorsConstructorDescriptionTransportCleanupRepositoryAction(TransportService transportService, ClusterService clusterService, RepositoriesService repositoriesService, SnapshotsService snapshotsService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected ClusterBlockExceptioncheckBlock(CleanupRepositoryRequest request, ClusterState state)protected voidmasterOperation(CleanupRepositoryRequest request, ClusterState state, ActionListener<CleanupRepositoryResponse> listener)Methods inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
doExecute, getMasterActionName, localExecute, masterOperationMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Constructor Details
-
TransportCleanupRepositoryAction
@Inject public TransportCleanupRepositoryAction(TransportService transportService, ClusterService clusterService, RepositoriesService repositoriesService, SnapshotsService snapshotsService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Details
-
masterOperation
protected void masterOperation(CleanupRepositoryRequest request, ClusterState state, ActionListener<CleanupRepositoryResponse> listener)- Specified by:
masterOperationin classTransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
-
checkBlock
- Specified by:
checkBlockin classTransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
-