Package org.apache.hadoop.fs.s3a.impl
Class MkdirOperation
java.lang.Object
org.apache.hadoop.fs.s3a.impl.AbstractStoreOperation
org.apache.hadoop.fs.s3a.impl.ExecutingStoreOperation<Boolean>
org.apache.hadoop.fs.s3a.impl.MkdirOperation
- All Implemented Interfaces:
org.apache.hadoop.util.functional.CallableRaisingIOE<Boolean>
The mkdir operation.
A walk up the ancestor list halting as soon as a directory (good)
or file (bad) is found.
Optimized with the expectation that there is a marker up the path
or (ultimately) a sibling of the path being created.
It performs the directory listing probe ahead of the simple object HEAD
call for this reason -the object is the failure mode which SHOULD NOT
be encountered on normal execution.
Magic paths are handled specially
- The only path check is for a directory already existing there.
- No ancestors are checked
- Parent markers are never deleted, irrespective of FS settings
- One LIST
- If needed, one PUT
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallbacks used by mkdir. -
Constructor Summary
ConstructorsConstructorDescriptionMkdirOperation(StoreContext storeContext, org.apache.hadoop.fs.Path dir, MkdirOperation.MkdirCallbacks callbacks, boolean isMagicPath, boolean performanceMkdir) Initialize Mkdir Operation context for S3A. -
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
-
MkdirOperation
public MkdirOperation(StoreContext storeContext, org.apache.hadoop.fs.Path dir, MkdirOperation.MkdirCallbacks callbacks, boolean isMagicPath, boolean performanceMkdir) Initialize Mkdir Operation context for S3A.- Parameters:
storeContext- Store context.dir- Dir path of the directory.callbacks- MkdirCallbacks object used by the Mkdir operation.isMagicPath- True if the path is magic commit path.performanceMkdir- If true, skip validation of the parent directory structure.
-
-
Method Details
-
execute
Make the given path and all non-existent parents into directories.- Specified by:
executein classExecutingStoreOperation<Boolean>- Returns:
- true if a directory was created or already existed
- Throws:
org.apache.hadoop.fs.FileAlreadyExistsException- there is a file at the path specifiedIOException- other IO problems
-