KeyStoreTxn<K, V, T> class
abstract
Handle passed to a transaction(body) callback. Within the
body, mutations recorded via this handle are buffered in memory;
reads via this handle see the buffered state on top of the
underlying keystore. At successful body completion the buffered
mutations are applied to the keystore (and changes events
fire). If the body throws, the buffered mutations are dropped
and no events fire.
Hive's atomicity is best-effort: writes are durable per
underlying box flush, but a process crash mid-commit can leave
the keystore with a subset of the buffered ops applied. A
future SQL backend will provide true atomicity via
BEGIN IMMEDIATE / COMMIT.
Lifetime: the handle is valid only for the duration of the body
callback. Calling any method on it after transaction(...)
returns is undefined behaviour.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
exists(
K key) → Future< bool> -
Returns
trueifkeywould resolve to a value within this transaction's view. Reflects buffered writes / deletions on top of the underlying keystore. -
get(
K key) → Future< V?> -
Returns the value
keywould resolve to within this transaction's view. Reflects any buffered write (the buffered value), buffered deletion (null), or otherwise the value already in the underlying keystore. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
K key, V value, T metadata) → Future< void> -
Buffer a write of
value(withmetadata) underkey. Visible to subsequent get / exists calls on the same handle; applied to the underlying keystore at commit. -
remove(
K key) → Future< void> -
Buffer a deletion of
key. Subsequent exists returnsfalse; subsequent get returnsnull. The actual delete happens at commit. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited