T
- return type of executed operation.public abstract class ExecutingStoreOperation<T> extends AbstractStoreOperation implements org.apache.hadoop.util.functional.CallableRaisingIOE<T>
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.Modifier | Constructor and Description |
---|---|
protected |
ExecutingStoreOperation(StoreContext storeContext)
Constructor.
|
protected |
ExecutingStoreOperation(StoreContext storeContext,
org.apache.hadoop.fs.store.audit.AuditSpan auditSpan)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
T |
apply()
Apply calls
execute() . |
abstract T |
execute()
Execute the operation.
|
protected void |
executeOnlyOnce()
Check that the operation has not been invoked twice.
|
activateAuditSpan, getAuditSpan, getStoreContext
protected ExecutingStoreOperation(StoreContext storeContext)
storeContext
- store context.protected ExecutingStoreOperation(StoreContext storeContext, org.apache.hadoop.fs.store.audit.AuditSpan auditSpan)
storeContext
- store context.auditSpan
- active spanpublic final T apply() throws IOException
execute()
.apply
in interface org.apache.hadoop.util.functional.CallableRaisingIOE<T>
IOException
- IO problempublic abstract T execute() throws IOException
executeOnlyOnce()
so as to force
the (atomic) re-entrancy check.IOException
- IO problemprotected void executeOnlyOnce()
IllegalStateException
- on a second invocation.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.