- All Superinterfaces:
AutoCloseable
Invariants, verified by the TCK: the ranges of a key are pairwise disjoint and strictly increasing in completion
order (S1); the first range of a new key starts at initialOffset, once (S2); the returned range is
authoritative (S3); gaps are allowed, duplicates never (S4); values stay in [0, Long.MAX_VALUE) (S5); a sealed
key is never recreated (S6).
Failures (R1-spi-03): an operation that fails for another reason than its outcome throws a
RuntimeException of the backend's choosing (a driver exception, or the store's own wrapper of one). A timeout
is recognised with StoreTimeoutException.isTimeout(Throwable), whether the backend
throws a StoreTimeoutException or one as the cause; the runtime counts those as store timeouts. No common
base class is promised beyond RuntimeException.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Atomically reserves[start, start + size); a missing key is created atinitialOffset.default booleanSeals the key: every laterreserve(java.lang.String, long, long)fails and the key's value is kept.
-
Method Details
-
reserve
Atomically reserves[start, start + size); a missing key is created atinitialOffset.- Parameters:
key- the range key,{namespace}/{generator}or{namespace}/{generator}/{period}size- the size of the range, positiveinitialOffset- where the first range of a new key starts- Returns:
- the reserved range
- Throws:
RangeSealedException- if the key is sealedRangeExhaustedException- if the range would passLong.MAX_VALUE
-
seal
Seals the key: every laterreserve(java.lang.String, long, long)fails and the key's value is kept. Optional.- Parameters:
key- the range key- Returns:
- whether the store sealed the key; false if it does not support sealing
-
close
default void close()- Specified by:
closein interfaceAutoCloseable
-