Interface SegmentedKeyValueStorageTransaction
public interface SegmentedKeyValueStorageTransaction
A transaction that can atomically commit a sequence of operations to a segmented key-value store.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()close the transactionvoidcommit()Performs an atomic commit of all the operations queued in the transaction.voidput(SegmentIdentifier segmentIdentifier, byte[] key, byte[] value) Associates the specified value with the specified key.voidremove(SegmentIdentifier segmentIdentifier, byte[] key) When the given key is present, the key and mapped value will be removed from storage.voidrollback()Reset the transaction to a state prior to any operations being queued.
-
Method Details
-
put
Associates the specified value with the specified key.If a previously value had been store against the given key, the old value is replaced by the given value.
- Parameters:
segmentIdentifier- the segment identifierkey- the given value is to be associated with.value- associated with the specified key.
-
remove
When the given key is present, the key and mapped value will be removed from storage.- Parameters:
segmentIdentifier- the segment identifierkey- the key and mapped value that will be removed.
-
commit
Performs an atomic commit of all the operations queued in the transaction.- Throws:
StorageException- problem was encountered preventing the commit
-
rollback
void rollback()Reset the transaction to a state prior to any operations being queued. -
close
void close()close the transaction
-