Class FileRestoreContext
- java.lang.Object
-
- org.elasticsearch.repositories.blobstore.FileRestoreContext
-
public abstract class FileRestoreContext extends java.lang.ObjectThis 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 intbufferSizeprotected static org.apache.logging.log4j.Loggerloggerprotected RecoveryStaterecoveryStateprotected java.lang.StringrepositoryNameprotected ShardIdshardIdprotected SnapshotIdsnapshotId
-
Constructor Summary
Constructors Modifier Constructor Description protectedFileRestoreContext(java.lang.String repositoryName, ShardId shardId, SnapshotId snapshotId, RecoveryState recoveryState, int bufferSize)Constructs new restore context
-
Method Summary
Modifier and Type Method Description protected abstract java.io.InputStreamfileInputStream(BlobStoreIndexShardSnapshot.FileInfo fileInfo)voidrestore(SnapshotFiles snapshotFiles, Store store)Performs restore operationprotected voidrestoreFiles(java.util.List<BlobStoreIndexShardSnapshot.FileInfo> filesToRecover, Store store)
-
-
-
Field Detail
-
logger
protected static final org.apache.logging.log4j.Logger logger
-
repositoryName
protected final java.lang.String repositoryName
-
recoveryState
protected final RecoveryState recoveryState
-
snapshotId
protected final SnapshotId snapshotId
-
shardId
protected final ShardId shardId
-
bufferSize
protected final int bufferSize
-
-
Constructor Detail
-
FileRestoreContext
protected FileRestoreContext(java.lang.String repositoryName, ShardId shardId, SnapshotId snapshotId, RecoveryState recoveryState, int bufferSize)Constructs new restore context- Parameters:
shardId- shard id to restore intosnapshotId- snapshot idrecoveryState- recovery state to report progressbufferSize- buffer size for restore
-
-
Method Detail
-
restore
public void restore(SnapshotFiles snapshotFiles, Store store) throws java.io.IOException
Performs restore operation- Throws:
java.io.IOException
-
restoreFiles
protected void restoreFiles(java.util.List<BlobStoreIndexShardSnapshot.FileInfo> filesToRecover, Store store) throws java.io.IOException
- Throws:
java.io.IOException
-
fileInputStream
protected abstract java.io.InputStream fileInputStream(BlobStoreIndexShardSnapshot.FileInfo fileInfo)
-
-