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 Details

    • ExecutingStoreOperation

      protected ExecutingStoreOperation(StoreContext storeContext)
      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

      public final T apply() throws IOException
      Apply calls execute().
      Specified by:
      apply in interface org.apache.hadoop.util.functional.CallableRaisingIOE<T>
      Returns:
      the result.
      Throws:
      IOException - IO problem
    • execute

      public abstract T execute() throws IOException
      Execute the operation. Subclasses MUST call executeOnlyOnce() 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.