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
RepositoryCleanupInProgress
in 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, indexNameExpressionResolver, threadPool, transportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager
-
Constructor Summary
Constructors Constructor Description TransportCleanupRepositoryAction(TransportService transportService, ClusterService clusterService, RepositoriesService repositoriesService, SnapshotsService snapshotsService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
Method Summary
Modifier and Type Method Description protected ClusterBlockException
checkBlock(CleanupRepositoryRequest request, ClusterState state)
protected java.lang.String
executor()
protected void
masterOperation(CleanupRepositoryRequest request, ClusterState state, ActionListener<CleanupRepositoryResponse> listener)
protected CleanupRepositoryResponse
read(StreamInput in)
Methods inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
doExecute, getMasterActionName, localExecute, masterOperation
Methods 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
-
executor
protected java.lang.String executor()- Specified by:
executor
in classTransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
-
read
- Specified by:
read
in classTransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
- Throws:
java.io.IOException
-
masterOperation
protected void masterOperation(CleanupRepositoryRequest request, ClusterState state, ActionListener<CleanupRepositoryResponse> listener)- Specified by:
masterOperation
in classTransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
-
checkBlock
- Specified by:
checkBlock
in classTransportMasterNodeAction<CleanupRepositoryRequest,CleanupRepositoryResponse>
-