public interface LockBasedTransaction
AbstractLockBasedProxyManager typically performs in reaction to user request.
The typical flow is following:
begin(Optional)lockAndGet(Optional)update(byte[], RemoteBucketState, Optional)unlock()commit(Optional)release()| Modifier and Type | Method and Description |
|---|---|
void |
begin(Optional<Long> timeoutNanos)
Begins transaction if underlying storage requires transactions.
|
void |
commit(Optional<Long> timeoutNanos)
Commits transaction if underlying storage requires transactions
|
void |
create(byte[] data,
RemoteBucketState state,
Optional<Long> timeoutNanos)
Creates the data by the key associated with this transaction.
|
byte[] |
lockAndGet(Optional<Long> timeoutNanos)
Locks data by the key associated with this transaction and returns data that is associated with the key.
|
void |
release()
Frees resources associated with this transaction
|
void |
rollback()
Rollbacks transaction if underlying storage requires transactions
|
void |
unlock()
Unlocks data by the key associated with this transaction.
|
void |
update(byte[] data,
RemoteBucketState newState,
Optional<Long> timeoutNanos)
Updates the data by the key associated with this transaction.
|
void begin(Optional<Long> timeoutNanos)
commit(Optional) or rollback() will be called if begin(Optional) returns successfully.timeoutNanos - optional timeout in nanosecondsvoid rollback()
void commit(Optional<Long> timeoutNanos)
timeoutNanos - optional timeout in nanosecondsbyte[] lockAndGet(Optional<Long> timeoutNanos)
unlock() will be called if lockAndGet(Optional) returns successfully.timeoutNanos - optional timeout in nanosecondsvoid unlock()
void create(byte[] data,
RemoteBucketState state,
Optional<Long> timeoutNanos)
data - bucket state to persistsstate - of bucket - can be used to extract additional data is useful for persistence or logging.timeoutNanos - optional timeout in nanosecondsvoid update(byte[] data,
RemoteBucketState newState,
Optional<Long> timeoutNanos)
data - bucket state to persistsnewState - new state of bucket - can be used to extract additional data is useful for persistence or logging.void release()
Copyright © 2024. All rights reserved.