Package org.apache.hadoop.fs.s3a.impl
Class ExecutingStoreOperation<T>
java.lang.Object
org.apache.hadoop.fs.s3a.impl.AbstractStoreOperation
org.apache.hadoop.fs.s3a.impl.ExecutingStoreOperation<T>
- Type Parameters:
T- return type of executed operation.
- All Implemented Interfaces:
org.apache.hadoop.util.functional.CallableRaisingIOE<T>
- Direct Known Subclasses:
CopyFromLocalOperation,DeleteOperation,GetContentSummaryOperation,MkdirOperation,RenameOperation
public abstract class ExecutingStoreOperation<T>
extends AbstractStoreOperation
implements org.apache.hadoop.util.functional.CallableRaisingIOE<T>
A subclass of
AbstractStoreOperation which
provides a method execute() that may be invoked
exactly once.
It declares itself a CallableRaisingIOE and
can be handed straight to methods which take those
as parameters.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExecutingStoreOperation(StoreContext storeContext) Constructor.protectedExecutingStoreOperation(StoreContext storeContext, org.apache.hadoop.fs.store.audit.AuditSpan auditSpan) Constructor. -
Method Summary
Methods 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
-
ExecutingStoreOperation
Constructor. Picks up the active audit span from the store context and stores it for later.- Parameters:
storeContext- store context.
-
ExecutingStoreOperation
protected ExecutingStoreOperation(StoreContext storeContext, org.apache.hadoop.fs.store.audit.AuditSpan auditSpan) Constructor.- Parameters:
storeContext- store context.auditSpan- active span
-
-
Method Details
-
apply
Apply callsexecute().- Specified by:
applyin interfaceorg.apache.hadoop.util.functional.CallableRaisingIOE<T>- Returns:
- the result.
- Throws:
IOException- IO problem
-
execute
Execute the operation. Subclasses MUST callexecuteOnlyOnce()so as to force the (atomic) re-entrancy check.- Returns:
- the result.
- Throws:
IOException- IO problem
-
executeOnlyOnce
protected void executeOnlyOnce()Check that the operation has not been invoked twice. This is an atomic check. After the check: activates the span.- Throws:
IllegalStateException- on a second invocation.
-