Package org.apache.hadoop.fs.s3a.impl
Interface CopyFromLocalOperation.CopyFromLocalOperationCallbacks
- All Known Implementing Classes:
S3AFileSystem.CopyFromLocalCallbacksImpl
- Enclosing class:
- CopyFromLocalOperation
public static interface CopyFromLocalOperation.CopyFromLocalOperationCallbacks
Define the contract for
CopyFromLocalOperation to interact
with any external resources.-
Method Summary
Modifier and TypeMethodDescriptionvoidcopyLocalFileFromTo(File file, org.apache.hadoop.fs.Path source, org.apache.hadoop.fs.Path destination) Copy / Upload a file from a source path to a destination path.booleancreateEmptyDir(org.apache.hadoop.fs.Path path, StoreContext storeContext) Create empty directory at path.booleandeleteLocal(org.apache.hadoop.fs.Path path, boolean recursive) Delete file / directory at path.org.apache.hadoop.fs.FileStatusgetFileStatus(org.apache.hadoop.fs.Path path) Get the file status for a path.org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus>listLocalStatusIterator(org.apache.hadoop.fs.Path path) List all entries (files AND directories) for a path.pathToLocalFile(org.apache.hadoop.fs.Path path) Get the file from a path.
-
Method Details
-
listLocalStatusIterator
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> listLocalStatusIterator(org.apache.hadoop.fs.Path path) throws IOException List all entries (files AND directories) for a path.- Parameters:
path- - path to list- Returns:
- an iterator for all entries
- Throws:
IOException- - for any failure
-
getFileStatus
Get the file status for a path.- Parameters:
path- - target path- Returns:
- FileStatus
- Throws:
IOException- - for any failure
-
pathToLocalFile
Get the file from a path.- Parameters:
path- - target path- Returns:
- file at path
-
deleteLocal
Delete file / directory at path.- Parameters:
path- - target pathrecursive- - recursive deletion- Returns:
- boolean result of operation
- Throws:
IOException- for any failure
-
copyLocalFileFromTo
void copyLocalFileFromTo(File file, org.apache.hadoop.fs.Path source, org.apache.hadoop.fs.Path destination) throws IOException Copy / Upload a file from a source path to a destination path.- Parameters:
file- - target filesource- - source pathdestination- - destination path- Throws:
IOException- for any failure
-
createEmptyDir
boolean createEmptyDir(org.apache.hadoop.fs.Path path, StoreContext storeContext) throws IOException Create empty directory at path. Most likely an upload operation.- Parameters:
path- - target pathstoreContext- - store context- Returns:
- boolean result of operation
- Throws:
IOException- for any failure
-