Package org.apache.hadoop.fs.s3a.impl
Class CopyFromLocalOperation
java.lang.Object
org.apache.hadoop.fs.s3a.impl.AbstractStoreOperation
org.apache.hadoop.fs.s3a.impl.ExecutingStoreOperation<Void>
org.apache.hadoop.fs.s3a.impl.CopyFromLocalOperation
- All Implemented Interfaces:
org.apache.hadoop.util.functional.CallableRaisingIOE<Void>
Implementation of CopyFromLocalOperation.
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:
- all source files and directories are scanned through;
- the LARGEST_N_FILES start uploading;
- the remaining files are shuffled and uploaded;
- any remaining empty directory is uploaded too to preserve local tree structure.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefine the contract forCopyFromLocalOperationto interact with any external resources. -
Constructor Summary
ConstructorsConstructorDescriptionCopyFromLocalOperation(StoreContext storeContext, org.apache.hadoop.fs.Path source, org.apache.hadoop.fs.Path destination, boolean deleteSource, boolean overwrite, CopyFromLocalOperation.CopyFromLocalOperationCallbacks callbacks) -
Method Summary
Methods inherited from class org.apache.hadoop.fs.s3a.impl.ExecutingStoreOperation
apply, executeOnlyOnceMethods inherited from class org.apache.hadoop.fs.s3a.impl.AbstractStoreOperation
activateAuditSpan, getAuditSpan, getStoreContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.util.functional.CallableRaisingIOE
unchecked
-
Constructor Details
-
CopyFromLocalOperation
public CopyFromLocalOperation(StoreContext storeContext, org.apache.hadoop.fs.Path source, org.apache.hadoop.fs.Path destination, boolean deleteSource, boolean overwrite, CopyFromLocalOperation.CopyFromLocalOperationCallbacks callbacks)
-
-
Method Details
-
execute
Executes theCopyFromLocalOperation.- Specified by:
executein classExecutingStoreOperation<Void>- Returns:
- the result.
- Throws:
IOException- - if there are any failures with upload or deletion of files. CheckCopyFromLocalOperation.CopyFromLocalOperationCallbacksfor 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 directory
-