public class S3BackupRepository extends Object implements BackupRepository
BackupRepository
interface supporting backup/restore of Solr
indexes to S3.BackupRepository.PathType
Constructor and Description |
---|
S3BackupRepository() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
copyIndexFileFrom(Directory sourceDir,
String sourceFileName,
URI dest,
String destFileName)
Copy an index file from specified
sourceDir to the destination repository (i.e. |
void |
copyIndexFileTo(URI sourceDir,
String sourceFileName,
Directory dest,
String destFileName)
Copy an index file from specified
sourceRepo to the destination directory (i.e. |
void |
createDirectory(URI path) |
URI |
createDirectoryURI(String location) |
OutputStream |
createOutput(URI path) |
URI |
createURI(String location) |
void |
delete(URI path,
Collection<String> files,
boolean ignoreNoSuchFileException) |
void |
deleteDirectory(URI path) |
boolean |
exists(URI path) |
<T> T |
getConfigProperty(String name) |
BackupRepository.PathType |
getPathType(URI path) |
void |
init(NamedList args) |
String[] |
listAll(URI path)
This method returns all the entries (files and directories) in the specified directory.
|
IndexInput |
openInput(URI path,
String fileName,
IOContext ctx) |
URI |
resolve(URI baseUri,
String... pathComponents) |
URI |
resolveDirectory(URI baseUri,
String... pathComponents) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checksum, copyFileFrom, copyFileTo, copyIndexFileFrom, getBackupLocation, listAllOrEmpty
public void init(NamedList args)
init
in interface NamedListInitializedPlugin
public <T> T getConfigProperty(String name)
getConfigProperty
in interface BackupRepository
public URI createURI(String location)
createURI
in interface BackupRepository
public URI createDirectoryURI(String location)
createDirectoryURI
in interface BackupRepository
public URI resolve(URI baseUri, String... pathComponents)
resolve
in interface BackupRepository
public URI resolveDirectory(URI baseUri, String... pathComponents)
resolveDirectory
in interface BackupRepository
public void createDirectory(URI path) throws IOException
createDirectory
in interface BackupRepository
IOException
public void deleteDirectory(URI path) throws IOException
deleteDirectory
in interface BackupRepository
IOException
public void delete(URI path, Collection<String> files, boolean ignoreNoSuchFileException) throws IOException
delete
in interface BackupRepository
IOException
public boolean exists(URI path) throws IOException
exists
in interface BackupRepository
IOException
public IndexInput openInput(URI path, String fileName, IOContext ctx) throws IOException
openInput
in interface BackupRepository
IOException
public OutputStream createOutput(URI path) throws IOException
createOutput
in interface BackupRepository
IOException
public String[] listAll(URI path) throws IOException
listAll
in interface BackupRepository
path
- The directory pathIOException
public BackupRepository.PathType getPathType(URI path) throws IOException
getPathType
in interface BackupRepository
IOException
public void copyIndexFileFrom(Directory sourceDir, String sourceFileName, URI dest, String destFileName) throws IOException
sourceDir
to the destination repository (i.e.
backup).copyIndexFileFrom
in interface BackupRepository
sourceDir
- The source directory hosting the file to be copied.sourceFileName
- The name of the file to be copieddest
- The destination backup location.IOException
- in case of errorsCorruptIndexException
- in case checksum of the file does not match with precomputed
checksum stored at the end of the filepublic void copyIndexFileTo(URI sourceDir, String sourceFileName, Directory dest, String destFileName) throws IOException
sourceRepo
to the destination directory (i.e.
restore).copyIndexFileTo
in interface BackupRepository
sourceDir
- The source URI hosting the file to be copied.dest
- The destination where the file should be copied.IOException
- in case of errors.public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.