Package org.apache.hadoop.fs.store.audit
Class AuditingFunctions
java.lang.Object
org.apache.hadoop.fs.store.audit.AuditingFunctions
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 Summary
Modifier and TypeMethodDescriptionstatic <T> Callable<T>callableWithinAuditSpan(AuditSpan auditSpan, Callable<T> operation) Given a callable, return a new callable which activates and deactivates the span around the inner invocation.static <T> CallableRaisingIOE<T>withinAuditSpan(AuditSpan auditSpan, CallableRaisingIOE<T> operation) Given a callable, return a new callable which activates and deactivates the span around the inner invocation.static <T,R> FunctionRaisingIOE<T, R> withinAuditSpan(AuditSpan auditSpan, FunctionRaisingIOE<T, R> operation) Given a function, return a new function which activates and deactivates the span around the inner one.static InvocationRaisingIOEwithinAuditSpan(AuditSpan auditSpan, InvocationRaisingIOE operation) Given an invocation, return a new invocation which activates and deactivates the span around the inner invocation.
-
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 spanoperation- 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 spanoperation- 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 spanoperation- 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 spanoperation- operation- Returns:
- a new invocation.
-