public class HdfsBackupRepository extends Object implements BackupRepository
BackupRepository.PathType
Constructor and Description |
---|
HdfsBackupRepository() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
copyFileFrom(Directory sourceDir,
String fileName,
URI dest)
Copy a file from specified
sourceDir to the destination repository (i.e. |
void |
copyFileTo(URI sourceRepo,
String fileName,
Directory dest)
Copy a file from specified
sourceRepo to the destination directory (i.e. |
void |
createDirectory(URI path)
This method creates a directory at the specified path.
|
OutputStream |
createOutput(URI path)
This method returns a OutputStream instance for the specified
path |
URI |
createURI(String location)
This method returns the URI representation for the specified path.
|
void |
deleteDirectory(URI path)
This method deletes a directory at the specified path.
|
boolean |
exists(URI path)
This method checks if the specified path exists in this repository.
|
<T> T |
getConfigProperty(String name)
This method returns the value of the specified configuration property.
|
BackupRepository.PathType |
getPathType(URI path)
This method returns the type of a specified 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 dirPath,
String fileName,
IOContext ctx)
This method returns a Lucene input stream reading an existing file.
|
URI |
resolve(URI baseUri,
String... pathComponents)
This method resolves a URI using the specified path components (as method arguments).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBackupLocation
public void init(NamedList args)
init
in interface NamedListInitializedPlugin
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public <T> T getConfigProperty(String name)
BackupRepository
getConfigProperty
in interface BackupRepository
public URI createURI(String location)
BackupRepository
createURI
in interface BackupRepository
location
- The path specified by the user.public URI resolve(URI baseUri, String... pathComponents)
BackupRepository
resolve
in interface BackupRepository
baseUri
- The base URI to use for creating the pathpathComponents
- The directory (or file-name) to be included in the URI.public boolean exists(URI path) throws IOException
BackupRepository
exists
in interface BackupRepository
path
- The path whose existence needs to be checked.IOException
- in case of errorspublic BackupRepository.PathType getPathType(URI path) throws IOException
BackupRepository
getPathType
in interface BackupRepository
path
- The path whose type needs to be checked.IOException
- in case of errorspublic String[] listAll(URI path) throws IOException
BackupRepository
listAll
in interface BackupRepository
path
- The directory pathIOException
- in case of errorspublic IndexInput openInput(URI dirPath, String fileName, IOContext ctx) throws IOException
BackupRepository
openInput
in interface BackupRepository
dirPath
- The parent directory of the file to be readfileName
- The name of the file to be readctx
- the Lucene IO contextIOException
- in case of errorspublic OutputStream createOutput(URI path) throws IOException
BackupRepository
path
createOutput
in interface BackupRepository
path
- The path for which OutputStream needs to be createdpath
IOException
- in case of errorspublic void createDirectory(URI path) throws IOException
BackupRepository
createDirectory
in interface BackupRepository
path
- The path where the directory needs to be created.IOException
- in case of errorspublic void deleteDirectory(URI path) throws IOException
BackupRepository
deleteDirectory
in interface BackupRepository
path
- The path referring to the directory to be deleted.IOException
- in case of errorspublic void copyFileFrom(Directory sourceDir, String fileName, URI dest) throws IOException
BackupRepository
sourceDir
to the destination repository (i.e. backup).copyFileFrom
in interface BackupRepository
sourceDir
- The source directory hosting the file to be copied.fileName
- The name of the file to by copieddest
- The destination backup location.IOException
- in case of errorspublic void copyFileTo(URI sourceRepo, String fileName, Directory dest) throws IOException
BackupRepository
sourceRepo
to the destination directory (i.e. restore).copyFileTo
in interface BackupRepository
sourceRepo
- The source URI hosting the file to be copied.fileName
- The name of the file to by copieddest
- The destination where the file should be copied.IOException
- in case of errors.Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.