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,
RemoteBucketState newState)
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, RemoteBucketState newState)
originalData - previous bucket state(can be null).newData - new bucket statenewState - new state of bucket - can be used to extract additional data is useful for persistence or logging.true if data changed, false if another parallel transaction achieved success instead of current transactionCopyright © 2022. All rights reserved.