public interface AsyncCompareAndSwapOperation
AbstractCompareAndSwapBasedProxyManager typically performs in reaction to user request.
The typical flow is following:
getStateData(Optional)compareAndSwap(byte[], byte[], RemoteBucketState, Optional)| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
compareAndSwap(byte[] originalData,
byte[] newData,
RemoteBucketState newState,
Optional<Long> timeoutNanos)
Compares and swap data associated with key
|
CompletableFuture<Optional<byte[]>> |
getStateData(Optional<Long> timeoutNanos)
Reads data if it exists
|
CompletableFuture<Optional<byte[]>> getStateData(Optional<Long> timeoutNanos)
timeoutNanos - optional timeout in nanosecondsCompletableFuture<Boolean> compareAndSwap(byte[] originalData, byte[] newData, RemoteBucketState newState, Optional<Long> timeoutNanos)
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.timeoutNanos - optional timeout in nanosecondstrue if data changed, false if another parallel transaction achieved success instead of current transactionCopyright © 2024. All rights reserved.