Package org.apache.solr.s3
Class S3BackupRepository
java.lang.Object
org.apache.solr.core.backup.repository.AbstractBackupRepository
org.apache.solr.s3.S3BackupRepository
- All Implemented Interfaces:
Closeable,AutoCloseable,BackupRepository,NamedListInitializedPlugin
A concrete implementation of
BackupRepository interface supporting backup/restore of Solr
indexes to S3.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.solr.core.backup.repository.BackupRepository
BackupRepository.PathType -
Field Summary
Fields inherited from class org.apache.solr.core.backup.repository.AbstractBackupRepository
config, PARAM_VERIFY_CHECKSUM, shouldVerifyChecksum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcopyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, URI dest, String destFileName) Copy an index file from specifiedsourceDirto the destination repository (i.e.voidcopyIndexFileTo(URI sourceDir, String sourceFileName, org.apache.lucene.store.Directory dest, String destFileName) Copy an index file from specifiedsourceRepoto the destination directory (i.e.voidcreateDirectory(URI path) createDirectoryURI(String location) createOutput(URI path) voiddelete(URI path, Collection<String> files) voiddeleteDirectory(URI path) boolean<T> TgetConfigProperty(String name) getPathType(URI path) voidinit(org.apache.solr.common.util.NamedList<?> args) String[]This method returns all the entries (files and directories) in the specified directory.org.apache.lucene.store.IndexInputresolveDirectory(URI baseUri, String... pathComponents) Methods inherited from class org.apache.solr.core.backup.repository.AbstractBackupRepository
copyIndexFileFrom, getBooleanConfigMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.core.backup.repository.BackupRepository
checksum, copyFileFrom, copyFileNoChecksum, copyFileTo, getBackupLocation, listAllOrEmpty
-
Constructor Details
-
S3BackupRepository
public S3BackupRepository()
-
-
Method Details
-
init
public void init(org.apache.solr.common.util.NamedList<?> args) - Specified by:
initin interfaceNamedListInitializedPlugin- Overrides:
initin classAbstractBackupRepository
-
getConfigProperty
-
createURI
-
createDirectoryURI
-
resolve
-
resolveDirectory
-
createDirectory
- Throws:
IOException
-
deleteDirectory
- Throws:
IOException
-
delete
- Throws:
IOException
-
exists
- Throws:
IOException
-
openInput
public org.apache.lucene.store.IndexInput openInput(URI path, String fileName, org.apache.lucene.store.IOContext ctx) throws IOException - Throws:
IOException
-
createOutput
- Throws:
IOException
-
listAll
This method returns all the entries (files and directories) in the specified directory.- Parameters:
path- The directory path- Returns:
- an array of strings, one for each entry in the directory
- Throws:
IOException
-
getPathType
- Throws:
IOException
-
copyIndexFileFrom
public void copyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, URI dest, String destFileName) throws IOException Copy an index file from specifiedsourceDirto the destination repository (i.e. backup).- Parameters:
sourceDir- The source directory hosting the file to be copied.sourceFileName- The name of the file to be copieddest- The destination backup location.- Throws:
IOException- in case of errorsorg.apache.lucene.index.CorruptIndexException- in case checksum of the file does not match with precomputed checksum stored at the end of the file
-
copyIndexFileTo
public void copyIndexFileTo(URI sourceDir, String sourceFileName, org.apache.lucene.store.Directory dest, String destFileName) throws IOException Copy an index file from specifiedsourceRepoto the destination directory (i.e. restore).- Parameters:
sourceDir- The source URI hosting the file to be copied.dest- The destination where the file should be copied.- Throws:
IOException- in case of errors.
-
close
public void close()
-