Class FileRestoreContext
java.lang.Object
org.elasticsearch.repositories.blobstore.FileRestoreContext
public abstract class FileRestoreContext
extends java.lang.Object
This context will execute a file restore of the lucene files. It is primarily designed to be used to
restore from some form of a snapshot. It will setup a new store, identify files that need to be copied
for the source, and perform the copies. Implementers must implement the functionality of opening the
underlying file streams for snapshotted lucene file.
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.logging.log4j.Logger
logger
protected RecoveryState
recoveryState
protected java.lang.String
repositoryName
protected ShardId
shardId
protected SnapshotId
snapshotId
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileRestoreContext(java.lang.String repositoryName, ShardId shardId, SnapshotId snapshotId, RecoveryState recoveryState)
Constructs new restore context -
Method Summary
Modifier and Type Method Description void
restore(SnapshotFiles snapshotFiles, Store store, ActionListener<java.lang.Void> listener)
Performs restore operationprotected abstract void
restoreFiles(java.util.List<BlobStoreIndexShardSnapshot.FileInfo> filesToRecover, Store store, ActionListener<java.lang.Void> listener)
Restores given list ofBlobStoreIndexShardSnapshot.FileInfo
to the givenStore
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
logger
protected static final org.apache.logging.log4j.Logger logger -
repositoryName
protected final java.lang.String repositoryName -
recoveryState
-
snapshotId
-
shardId
-
-
Constructor Details
-
FileRestoreContext
protected FileRestoreContext(java.lang.String repositoryName, ShardId shardId, SnapshotId snapshotId, RecoveryState recoveryState)Constructs new restore context- Parameters:
shardId
- shard id to restore intosnapshotId
- snapshot idrecoveryState
- recovery state to report progress
-
-
Method Details
-
restore
public void restore(SnapshotFiles snapshotFiles, Store store, ActionListener<java.lang.Void> listener)Performs restore operation -
restoreFiles
protected abstract void restoreFiles(java.util.List<BlobStoreIndexShardSnapshot.FileInfo> filesToRecover, Store store, ActionListener<java.lang.Void> listener)Restores given list ofBlobStoreIndexShardSnapshot.FileInfo
to the givenStore
.- Parameters:
filesToRecover
- List of files to restorestore
- Store to restore into
-