Interface NonTransactionalDatabaseAdapter.CasOp<R>
-
- Enclosing class:
- NonTransactionalDatabaseAdapter<CONFIG extends NonTransactionalDatabaseAdapterConfig>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface NonTransactionalDatabaseAdapter.CasOp<R>"Body" of a Compare-And-Swap loop that returns the value to apply.NonTransactionalDatabaseAdapter.casOpLoop(String, NamedRef, CasOpVariant, CasOp, Supplier)then tries to perform the Compare-And-Swap using the known "current value", as passed via thepointerparameter toapply(NonTransactionalOperationContext, RefPointer, Consumer, Consumer), and the "new value" from the return value.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NonTransactionalDatabaseAdapter.CasOpResult<R>apply(NonTransactionalOperationContext ctx, org.projectnessie.versioned.persist.serialize.AdapterTypes.RefPointer refPointer, java.util.function.Consumer<org.projectnessie.versioned.Hash> branchCommits, java.util.function.Consumer<org.projectnessie.versioned.Hash> newKeyLists)Applies an operation within a CAS-loop.
-
-
-
Method Detail
-
apply
NonTransactionalDatabaseAdapter.CasOpResult<R> apply(NonTransactionalOperationContext ctx, org.projectnessie.versioned.persist.serialize.AdapterTypes.RefPointer refPointer, java.util.function.Consumer<org.projectnessie.versioned.Hash> branchCommits, java.util.function.Consumer<org.projectnessie.versioned.Hash> newKeyLists) throws org.projectnessie.versioned.VersionStoreException
Applies an operation within a CAS-loop. The implementation gets the current ref-pointer and must return aNonTransactionalDatabaseAdapter.CasOpResultwith the reference's new HEAD and function to configure the ref-log entry.- Parameters:
ctx- operation contextrefPointer- information about the target named referencebranchCommits- if more commits than the one returned via the return value were optimistically written, those must be passed to this consumer.newKeyLists- IDs of optimistically writtenKeyListEntityentities must be passed to this consumer.- Returns:
- "new value" that
NonTransactionalDatabaseAdapter.casOpLoop(String, NamedRef, CasOpVariant, CasOp, Supplier)tries to apply - Throws:
org.projectnessie.versioned.VersionStoreException
-
-