public interface AsyncCompareAndSwapOperation
AbstractCompareAndSwapBasedProxyManager
typically performs in reaction to user request.
The typical flow is following:
getStateData()
compareAndSwap(byte[], byte[])
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Boolean> |
compareAndSwap(byte[] originalData,
byte[] newData)
Compares and swap data associated with key
|
CompletableFuture<Optional<byte[]>> |
getStateData()
Reads data if it exists
|
CompletableFuture<Optional<byte[]>> getStateData()
CompletableFuture<Boolean> compareAndSwap(byte[] originalData, byte[] newData)
originalData
- previous bucket state(can be null).newData
- new bucket statetrue
if data changed, false
if another parallel transaction achieved success instead of current transactionCopyright © 2021. All rights reserved.