Class FilterRepository
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,LifecycleComponent,Releasable,Repository
public class FilterRepository extends java.lang.Object implements Repository
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.repositories.Repository
Repository.Factory -
Constructor Summary
Constructors Constructor Description FilterRepository(Repository in) -
Method Summary
Modifier and Type Method Description voidaddLifecycleListener(LifecycleListener listener)voidclose()voiddeleteSnapshot(SnapshotId snapshotId, long repositoryStateId, boolean writeShardGens, ActionListener<java.lang.Void> listener)Deletes snapshotvoidendVerification(java.lang.String verificationToken)Called at the end of repository verification process.voidfinalizeSnapshot(SnapshotId snapshotId, ShardGenerations shardGenerations, long startTime, java.lang.String failure, int totalShards, java.util.List<SnapshotShardFailure> shardFailures, long repositoryStateId, boolean includeGlobalState, MetaData metaData, java.util.Map<java.lang.String,java.lang.Object> userMetadata, boolean writeShardGens, ActionListener<SnapshotInfo> listener)Finalizes snapshotting processRepositoryMetaDatagetMetadata()Returns metadata about this repository.voidgetRepositoryData(ActionListener<RepositoryData> listener)Returns aRepositoryDatato describe the data in the repository, including the snapshots and the indices across all snapshots found in the repository.longgetRestoreThrottleTimeInNanos()Returns restore throttle time in nanosecondsIndexShardSnapshotStatusgetShardSnapshotStatus(SnapshotId snapshotId, IndexId indexId, ShardId shardId)Retrieve shard snapshot status for the stored snapshotMetaDatagetSnapshotGlobalMetaData(SnapshotId snapshotId)Returns global metadata associated with the snapshot.IndexMetaDatagetSnapshotIndexMetaData(SnapshotId snapshotId, IndexId index)Returns the index metadata associated with the snapshot.SnapshotInfogetSnapshotInfo(SnapshotId snapshotId)Reads snapshot description from repository.longgetSnapshotThrottleTimeInNanos()Returns snapshot throttle time in nanosecondsvoidinitializeSnapshot(SnapshotId snapshotId, java.util.List<IndexId> indices, MetaData metaData)Starts snapshotting processbooleanisReadOnly()Returns true if the repository supports only read operationsLifecycle.StatelifecycleState()voidremoveLifecycleListener(LifecycleListener listener)voidrestoreShard(Store store, SnapshotId snapshotId, IndexId indexId, ShardId snapshotShardId, RecoveryState recoveryState, ActionListener<java.lang.Void> listener)Restores snapshot of the shard.voidsnapshotShard(Store store, MapperService mapperService, SnapshotId snapshotId, IndexId indexId, org.apache.lucene.index.IndexCommit snapshotIndexCommit, IndexShardSnapshotStatus snapshotStatus, boolean writeShardGens, ActionListener<java.lang.String> listener)Creates a snapshot of the shard based on the index commit point.voidstart()java.lang.StringstartVerification()Verifies repository on the master node and returns the verification token.voidstop()voidupdateState(ClusterState state)Update the repository with the incoming cluster state.voidverify(java.lang.String verificationToken, DiscoveryNode localNode)Verifies repository settings on data node.
-
Constructor Details
-
Method Details
-
getMetadata
Description copied from interface:RepositoryReturns metadata about this repository.- Specified by:
getMetadatain interfaceRepository
-
getSnapshotInfo
Description copied from interface:RepositoryReads snapshot description from repository.- Specified by:
getSnapshotInfoin interfaceRepository- Parameters:
snapshotId- snapshot id- Returns:
- information about snapshot
-
getSnapshotGlobalMetaData
Description copied from interface:RepositoryReturns global metadata associated with the snapshot.- Specified by:
getSnapshotGlobalMetaDatain interfaceRepository- Parameters:
snapshotId- the snapshot id to load the global metadata from- Returns:
- the global metadata about the snapshot
-
getSnapshotIndexMetaData
public IndexMetaData getSnapshotIndexMetaData(SnapshotId snapshotId, IndexId index) throws java.io.IOExceptionDescription copied from interface:RepositoryReturns the index metadata associated with the snapshot.- Specified by:
getSnapshotIndexMetaDatain interfaceRepository- Parameters:
snapshotId- the snapshot id to load the index metadata fromindex- theIndexIdto load the metadata from- Returns:
- the index metadata about the given index for the given snapshot
- Throws:
java.io.IOException
-
getRepositoryData
Description copied from interface:RepositoryReturns aRepositoryDatato describe the data in the repository, including the snapshots and the indices across all snapshots found in the repository. Throws aRepositoryExceptionif there was an error in reading the data.- Specified by:
getRepositoryDatain interfaceRepository
-
initializeSnapshot
public void initializeSnapshot(SnapshotId snapshotId, java.util.List<IndexId> indices, MetaData metaData)Description copied from interface:RepositoryStarts snapshotting process- Specified by:
initializeSnapshotin interfaceRepository- Parameters:
snapshotId- snapshot idindices- list of indices to be snapshottedmetaData- cluster metadata
-
finalizeSnapshot
public void finalizeSnapshot(SnapshotId snapshotId, ShardGenerations shardGenerations, long startTime, java.lang.String failure, int totalShards, java.util.List<SnapshotShardFailure> shardFailures, long repositoryStateId, boolean includeGlobalState, MetaData metaData, java.util.Map<java.lang.String,java.lang.Object> userMetadata, boolean writeShardGens, ActionListener<SnapshotInfo> listener)Description copied from interface:RepositoryFinalizes snapshotting processThis method is called on master after all shards are snapshotted.
- Specified by:
finalizeSnapshotin interfaceRepository- Parameters:
snapshotId- snapshot idshardGenerations- updated shard generationsstartTime- start time of the snapshotfailure- global failure reason or nulltotalShards- total number of shardsshardFailures- list of shard failuresrepositoryStateId- the unique id identifying the state of the repository when the snapshot beganincludeGlobalState- include cluster global statemetaData- cluster metadatauserMetadata- user metadatawriteShardGens- if shard generations should be written to the repositorylistener- listener to be called on completion of the snapshot
-
deleteSnapshot
public void deleteSnapshot(SnapshotId snapshotId, long repositoryStateId, boolean writeShardGens, ActionListener<java.lang.Void> listener)Description copied from interface:RepositoryDeletes snapshot- Specified by:
deleteSnapshotin interfaceRepository- Parameters:
snapshotId- snapshot idrepositoryStateId- the unique id identifying the state of the repository when the snapshot deletion beganwriteShardGens- if shard generations should be written to the repositorylistener- completion listener
-
getSnapshotThrottleTimeInNanos
public long getSnapshotThrottleTimeInNanos()Description copied from interface:RepositoryReturns snapshot throttle time in nanoseconds- Specified by:
getSnapshotThrottleTimeInNanosin interfaceRepository
-
getRestoreThrottleTimeInNanos
public long getRestoreThrottleTimeInNanos()Description copied from interface:RepositoryReturns restore throttle time in nanoseconds- Specified by:
getRestoreThrottleTimeInNanosin interfaceRepository
-
startVerification
public java.lang.String startVerification()Description copied from interface:RepositoryVerifies repository on the master node and returns the verification token.If the verification token is not null, it's passed to all data nodes for verification. If it's null - no additional verification is required
- Specified by:
startVerificationin interfaceRepository- Returns:
- verification token that should be passed to all Index Shard Repositories for additional verification or null
-
endVerification
public void endVerification(java.lang.String verificationToken)Description copied from interface:RepositoryCalled at the end of repository verification process.This method should perform all necessary cleanup of the temporary files created in the repository
- Specified by:
endVerificationin interfaceRepository- Parameters:
verificationToken- verification request generated byRepository.startVerification()command
-
verify
Description copied from interface:RepositoryVerifies repository settings on data node.- Specified by:
verifyin interfaceRepository- Parameters:
verificationToken- value returned byRepository.startVerification()localNode- the local node information, for inclusion in verification errors
-
isReadOnly
public boolean isReadOnly()Description copied from interface:RepositoryReturns true if the repository supports only read operations- Specified by:
isReadOnlyin interfaceRepository- Returns:
- true if the repository is read/only
-
snapshotShard
public void snapshotShard(Store store, MapperService mapperService, SnapshotId snapshotId, IndexId indexId, org.apache.lucene.index.IndexCommit snapshotIndexCommit, IndexShardSnapshotStatus snapshotStatus, boolean writeShardGens, ActionListener<java.lang.String> listener)Description copied from interface:RepositoryCreates a snapshot of the shard based on the index commit point.The index commit point can be obtained by using
Engine.acquireLastIndexCommit(boolean)method. Repository implementations shouldn't release the snapshot index commit point. It is done by the method caller.As snapshot process progresses, implementation of this method should update
IndexShardSnapshotStatusobject and checkIndexShardSnapshotStatus.isAborted()to see if the snapshot process should be aborted.- Specified by:
snapshotShardin interfaceRepository- Parameters:
store- store to be snapshottedmapperService- the shards mapper servicesnapshotId- snapshot idindexId- id for the index being snapshottedsnapshotIndexCommit- commit pointsnapshotStatus- snapshot statuslistener- listener invoked on completion
-
restoreShard
public void restoreShard(Store store, SnapshotId snapshotId, IndexId indexId, ShardId snapshotShardId, RecoveryState recoveryState, ActionListener<java.lang.Void> listener)Description copied from interface:RepositoryRestores snapshot of the shard.The index can be renamed on restore, hence different
shardIdandsnapshotShardIdare supplied.- Specified by:
restoreShardin interfaceRepository- Parameters:
store- the store to restore the index intosnapshotId- snapshot idindexId- id of the index in the repository from which the restore is occurringsnapshotShardId- shard id (in the snapshot)recoveryState- recovery statelistener- listener to invoke once done
-
getShardSnapshotStatus
public IndexShardSnapshotStatus getShardSnapshotStatus(SnapshotId snapshotId, IndexId indexId, ShardId shardId)Description copied from interface:RepositoryRetrieve shard snapshot status for the stored snapshot- Specified by:
getShardSnapshotStatusin interfaceRepository- Parameters:
snapshotId- snapshot idindexId- the snapshotted index id for the shard to get status forshardId- shard id- Returns:
- snapshot status
-
updateState
Description copied from interface:RepositoryUpdate the repository with the incoming cluster state. This method is invoked fromRepositoriesService.applyClusterState(org.elasticsearch.cluster.ClusterChangedEvent)and thus the same semantics as withClusterStateApplier.applyClusterState(org.elasticsearch.cluster.ClusterChangedEvent)apply for theClusterStatethat is passed here.- Specified by:
updateStatein interfaceRepository- Parameters:
state- new cluster state
-
lifecycleState
- Specified by:
lifecycleStatein interfaceLifecycleComponent
-
addLifecycleListener
- Specified by:
addLifecycleListenerin interfaceLifecycleComponent
-
removeLifecycleListener
- Specified by:
removeLifecycleListenerin interfaceLifecycleComponent
-
start
public void start()- Specified by:
startin interfaceLifecycleComponent
-
stop
public void stop()- Specified by:
stopin interfaceLifecycleComponent
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceReleasable
-