Class AuditingFunctions

java.lang.Object
org.apache.hadoop.fs.store.audit.AuditingFunctions

@Private @Unstable public final class AuditingFunctions extends Object
Static methods to assist in working with Audit Spans. the withinX calls take a span and a closure/function etc. and return a new function of the same types but which will activate and the span. They do not deactivate it afterwards to avoid accidentally deactivating the already-active span during a chain of operations in the same thread. All they do is ensure that the given span is guaranteed to be active when the passed in callable/function/invokable is evaluated.
  • Method Details

    • withinAuditSpan

      public static <T> CallableRaisingIOE<T> withinAuditSpan(@Nullable AuditSpan auditSpan, CallableRaisingIOE<T> operation)
      Given a callable, return a new callable which activates and deactivates the span around the inner invocation.
      Type Parameters:
      T - type of result
      Parameters:
      auditSpan - audit span
      operation - operation
      Returns:
      a new invocation.
    • withinAuditSpan

      public static InvocationRaisingIOE withinAuditSpan(@Nullable AuditSpan auditSpan, InvocationRaisingIOE operation)
      Given an invocation, return a new invocation which activates and deactivates the span around the inner invocation.
      Parameters:
      auditSpan - audit span
      operation - operation
      Returns:
      a new invocation.
    • withinAuditSpan

      public static <T, R> FunctionRaisingIOE<T,R> withinAuditSpan(@Nullable AuditSpan auditSpan, FunctionRaisingIOE<T,R> operation)
      Given a function, return a new function which activates and deactivates the span around the inner one.
      Type Parameters:
      T - Generics Type T.
      R - Generics Type R.
      Parameters:
      auditSpan - audit span
      operation - operation
      Returns:
      a new invocation.
    • callableWithinAuditSpan

      public static <T> Callable<T> callableWithinAuditSpan(@Nullable AuditSpan auditSpan, Callable<T> operation)
      Given a callable, return a new callable which activates and deactivates the span around the inner invocation.
      Type Parameters:
      T - type of result
      Parameters:
      auditSpan - audit span
      operation - operation
      Returns:
      a new invocation.