Package org.apache.solr.s3
Class S3BackupRepository
- java.lang.Object
- 
- org.apache.solr.s3.S3BackupRepository
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- BackupRepository,- NamedListInitializedPlugin
 
 public class S3BackupRepository extends Object implements BackupRepository A concrete implementation ofBackupRepositoryinterface supporting backup/restore of Solr indexes to S3.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.solr.core.backup.repository.BackupRepositoryBackupRepository.PathType
 
- 
 - 
Constructor SummaryConstructors Constructor Description S3BackupRepository()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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)URIcreateDirectoryURI(String location)OutputStreamcreateOutput(URI path)URIcreateURI(String location)voiddelete(URI path, Collection<String> files, boolean ignoreNoSuchFileException)voiddeleteDirectory(URI path)booleanexists(URI path)<T> TgetConfigProperty(String name)BackupRepository.PathTypegetPathType(URI path)voidinit(org.apache.solr.common.util.NamedList<?> args)String[]listAll(URI path)This method returns all the entries (files and directories) in the specified directory.org.apache.lucene.store.IndexInputopenInput(URI path, String fileName, org.apache.lucene.store.IOContext ctx)URIresolve(URI baseUri, String... pathComponents)URIresolveDirectory(URI baseUri, String... pathComponents)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.core.backup.repository.BackupRepositorychecksum, copyFileFrom, copyFileTo, copyIndexFileFrom, getBackupLocation, listAllOrEmpty
 
- 
 
- 
- 
- 
Method Detail- 
initpublic void init(org.apache.solr.common.util.NamedList<?> args) - Specified by:
- initin interface- NamedListInitializedPlugin
 
 - 
getConfigPropertypublic <T> T getConfigProperty(String name) - Specified by:
- getConfigPropertyin interface- BackupRepository
 
 - 
createURIpublic URI createURI(String location) - Specified by:
- createURIin interface- BackupRepository
 
 - 
createDirectoryURIpublic URI createDirectoryURI(String location) - Specified by:
- createDirectoryURIin interface- BackupRepository
 
 - 
resolvepublic URI resolve(URI baseUri, String... pathComponents) - Specified by:
- resolvein interface- BackupRepository
 
 - 
resolveDirectorypublic URI resolveDirectory(URI baseUri, String... pathComponents) - Specified by:
- resolveDirectoryin interface- BackupRepository
 
 - 
createDirectorypublic void createDirectory(URI path) throws IOException - Specified by:
- createDirectoryin interface- BackupRepository
- Throws:
- IOException
 
 - 
deleteDirectorypublic void deleteDirectory(URI path) throws IOException - Specified by:
- deleteDirectoryin interface- BackupRepository
- Throws:
- IOException
 
 - 
deletepublic void delete(URI path, Collection<String> files, boolean ignoreNoSuchFileException) throws IOException - Specified by:
- deletein interface- BackupRepository
- Throws:
- IOException
 
 - 
existspublic boolean exists(URI path) throws IOException - Specified by:
- existsin interface- BackupRepository
- Throws:
- IOException
 
 - 
openInputpublic org.apache.lucene.store.IndexInput openInput(URI path, String fileName, org.apache.lucene.store.IOContext ctx) throws IOException - Specified by:
- openInputin interface- BackupRepository
- Throws:
- IOException
 
 - 
createOutputpublic OutputStream createOutput(URI path) throws IOException - Specified by:
- createOutputin interface- BackupRepository
- Throws:
- IOException
 
 - 
listAllpublic String[] listAll(URI path) throws IOException This method returns all the entries (files and directories) in the specified directory.- Specified by:
- listAllin interface- BackupRepository
- Parameters:
- path- The directory path
- Returns:
- an array of strings, one for each entry in the directory
- Throws:
- IOException
 
 - 
getPathTypepublic BackupRepository.PathType getPathType(URI path) throws IOException - Specified by:
- getPathTypein interface- BackupRepository
- Throws:
- IOException
 
 - 
copyIndexFileFrompublic void copyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, URI dest, String destFileName) throws IOExceptionCopy an index file from specifiedsourceDirto the destination repository (i.e. backup).- Specified by:
- copyIndexFileFromin interface- BackupRepository
- Parameters:
- sourceDir- The source directory hosting the file to be copied.
- sourceFileName- The name of the file to be copied
- dest- The destination backup location.
- Throws:
- IOException- in case of errors
- org.apache.lucene.index.CorruptIndexException- in case checksum of the file does not match with precomputed checksum stored at the end of the file
 
 - 
copyIndexFileTopublic 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).- Specified by:
- copyIndexFileToin interface- BackupRepository
- 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.
 
 - 
closepublic void close() - Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 
- 
 
-