public class CopyFromLocalOperation extends ExecutingStoreOperation<Void>
This operation copies a file or directory (recursively) from a local FS to an object store. Initially, this operation has been developed for S3 (s3a) interaction, however, there's minimal work needed for it to work with other stores.
How the uploading of files works:
Modifier and Type | Class and Description |
---|---|
static interface |
CopyFromLocalOperation.CopyFromLocalOperationCallbacks
Define the contract for
CopyFromLocalOperation to interact
with any external resources. |
Constructor and Description |
---|
CopyFromLocalOperation(StoreContext storeContext,
org.apache.hadoop.fs.Path source,
org.apache.hadoop.fs.Path destination,
boolean deleteSource,
boolean overwrite,
CopyFromLocalOperation.CopyFromLocalOperationCallbacks callbacks) |
Modifier and Type | Method and Description |
---|---|
Void |
execute()
Executes the
CopyFromLocalOperation . |
apply, executeOnlyOnce
activateAuditSpan, getAuditSpan, getStoreContext
public CopyFromLocalOperation(StoreContext storeContext, org.apache.hadoop.fs.Path source, org.apache.hadoop.fs.Path destination, boolean deleteSource, boolean overwrite, CopyFromLocalOperation.CopyFromLocalOperationCallbacks callbacks)
@Retries.RetryTranslated public Void execute() throws IOException, org.apache.hadoop.fs.PathExistsException
CopyFromLocalOperation
.execute
in class ExecutingStoreOperation<Void>
IOException
- - if there are any failures with upload or deletion
of files. Check CopyFromLocalOperation.CopyFromLocalOperationCallbacks
for specifics.org.apache.hadoop.fs.PathExistsException
- - if the path exists and no overwrite flag
is set OR if the source is file and destination is a directoryCopyright © 2008–2024 Apache Software Foundation. All rights reserved.