Package org.elasticsearch.repositories
Class RepositoriesService
- java.lang.Object
-
- org.elasticsearch.repositories.RepositoriesService
-
- All Implemented Interfaces:
ClusterStateApplier
public class RepositoriesService extends java.lang.Object implements ClusterStateApplier
Service responsible for maintaining and providing access to snapshot repositories on nodes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RepositoriesService.RegisterRepositoryRequest
Register repository requeststatic class
RepositoriesService.UnregisterRepositoryRequest
Unregister repository requeststatic class
RepositoriesService.VerifyResponse
Verify repository request
-
Constructor Summary
Constructors Constructor Description RepositoriesService(Settings settings, ClusterService clusterService, TransportService transportService, java.util.Map<java.lang.String,Repository.Factory> typesRegistry, java.util.Map<java.lang.String,Repository.Factory> internalTypesRegistry, ThreadPool threadPool)
-
Method Summary
Modifier and Type Method Description void
applyClusterState(ClusterChangedEvent event)
Checks if new repositories appeared in or disappeared from cluster metadata and updates current list of repositories accordingly.void
registerInternalRepository(java.lang.String name, java.lang.String type)
void
registerRepository(RepositoriesService.RegisterRepositoryRequest request, ActionListener<ClusterStateUpdateResponse> listener)
Registers new repository in the clusterRepository
repository(java.lang.String repositoryName)
Returns registered repositoryvoid
unregisterInternalRepository(java.lang.String name)
void
unregisterRepository(RepositoriesService.UnregisterRepositoryRequest request, ActionListener<ClusterStateUpdateResponse> listener)
Unregisters repository in the clustervoid
verifyRepository(java.lang.String repositoryName, ActionListener<RepositoriesService.VerifyResponse> listener)
-
-
-
Constructor Detail
-
RepositoriesService
public RepositoriesService(Settings settings, ClusterService clusterService, TransportService transportService, java.util.Map<java.lang.String,Repository.Factory> typesRegistry, java.util.Map<java.lang.String,Repository.Factory> internalTypesRegistry, ThreadPool threadPool)
-
-
Method Detail
-
registerRepository
public void registerRepository(RepositoriesService.RegisterRepositoryRequest request, ActionListener<ClusterStateUpdateResponse> listener)
Registers new repository in the clusterThis method can be only called on the master node. It tries to create a new repository on the master and if it was successful it adds new repository to cluster metadata.
- Parameters:
request
- register repository requestlistener
- register repository listener
-
unregisterRepository
public void unregisterRepository(RepositoriesService.UnregisterRepositoryRequest request, ActionListener<ClusterStateUpdateResponse> listener)
Unregisters repository in the clusterThis method can be only called on the master node. It removes repository information from cluster metadata.
- Parameters:
request
- unregister repository requestlistener
- unregister repository listener
-
verifyRepository
public void verifyRepository(java.lang.String repositoryName, ActionListener<RepositoriesService.VerifyResponse> listener)
-
applyClusterState
public void applyClusterState(ClusterChangedEvent event)
Checks if new repositories appeared in or disappeared from cluster metadata and updates current list of repositories accordingly.- Specified by:
applyClusterState
in interfaceClusterStateApplier
- Parameters:
event
- cluster changed event
-
repository
public Repository repository(java.lang.String repositoryName)
Returns registered repositoryThis method is called only on the master node
- Parameters:
repositoryName
- repository name- Returns:
- registered repository
- Throws:
RepositoryMissingException
- if repository with such name isn't registered
-
registerInternalRepository
public void registerInternalRepository(java.lang.String name, java.lang.String type)
-
unregisterInternalRepository
public void unregisterInternalRepository(java.lang.String name)
-
-