Interface SingleRangeMixin
- All Superinterfaces:
AutoCloseable,LongSizedDataStructure,OrderedKeys,SafeCloseable
- All Known Implementing Classes:
SingleRangeOrderedKeys
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.utils.OrderedKeys
OrderedKeys.Iterator -
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.utils.OrderedKeys
EMPTY -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanFor as long as the consumer wants more keys, call accept on the consumer with the individual key instances in this OrderedKeys, in increasing order.default booleanFor as long as the consumer wants more ranges, call accept on the consumer with the individual key ranges in this OrderedKeys, in increasing order.default longGet an estimate of the average (mean) length of runs of adjacent keys in thisOrderedKeys.default OrderedKeysgetOrderedKeysByKeyRange(long startKeyInclusive, long endKeyInclusive) Get an ordered subset of the keys in thisOrderedKeysfor a key range.default OrderedKeysgetOrderedKeysByPosition(long startPositionInclusive, long length) Get an ordered subset of the keys in thisOrderedKeysfor a position range.default OrderedKeys.IteratorGet anOrderedKeys.Iteratorover thisOrderedKeys.default booleanHelper to tell you if this is one contiguous range.longrangeEnd()default longlonglongsize()Get the number of keys in thisOrderedKeys.Methods inherited from interface com.illumon.iris.db.util.LongSizedDataStructure
intSize, intSizeMethods inherited from interface com.illumon.iris.db.v2.utils.OrderedKeys
asIndex, asKeyIndicesChunk, asKeyRangesChunk, close, fillKeyIndicesChunk, fillKeyRangesChunk, firstKey, forAllLongRanges, forAllLongs, isEmpty, lastKey
-
Method Details
-
forEachLong
Description copied from interface:OrderedKeysFor as long as the consumer wants more keys, call accept on the consumer with the individual key instances in this OrderedKeys, in increasing order.- Specified by:
forEachLongin interfaceOrderedKeys- Parameters:
lc- a consumer to feed the individual key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
forEachLongRange
Description copied from interface:OrderedKeysFor as long as the consumer wants more ranges, call accept on the consumer with the individual key ranges in this OrderedKeys, in increasing order.- Specified by:
forEachLongRangein interfaceOrderedKeys- Parameters:
larc- a consumer to feed the individual key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
getOrderedKeysByPosition
Description copied from interface:OrderedKeysGet an ordered subset of the keys in this
OrderedKeysfor a position range. The result will contain the set of keys inthisthat lie at positions in the half-open range [startPositionInclusive,startPositionInclusive + length). The returned reference is owned by the caller, who should callclose()when it is done with it.- Specified by:
getOrderedKeysByPositionin interfaceOrderedKeys- Parameters:
startPositionInclusive- The position of the first key to includelength- The number of keys to include- Returns:
- The subset as an
OrderedKeys, which may bethis
-
getOrderedKeysByKeyRange
Description copied from interface:OrderedKeysGet an ordered subset of the keys in this
OrderedKeysfor a key range. The returned set will be the intersection of the keys inthiswith the keys in the closed interval [startKeyInclusive,endKeyInclusive]. The returned reference is owned by the caller, who should callclose()when it is done with it.- Specified by:
getOrderedKeysByKeyRangein interfaceOrderedKeys- Parameters:
startKeyInclusive- The minimum key to includeendKeyInclusive- The maximum key to include- Returns:
- The subset as an
OrderedKeys, which may bethis
-
getOrderedKeysIterator
Description copied from interface:OrderedKeysGet anOrderedKeys.Iteratorover thisOrderedKeys.- Specified by:
getOrderedKeysIteratorin interfaceOrderedKeys- Returns:
- A new iterator, positioned at the first key
-
rangesCountUpperBound
default long rangesCountUpperBound() -
getAverageRunLengthEstimate
default long getAverageRunLengthEstimate()Description copied from interface:OrderedKeysGet an estimate of the average (mean) length of runs of adjacent keys in this
OrderedKeys.Implementations should strive to keep this method efficient (O(1) preferred) at the expense of accuracy.
Empty
OrderedKeysshould return an arbitrary valid value, usually 1.- Specified by:
getAverageRunLengthEstimatein interfaceOrderedKeys- Returns:
- An estimate of the average run length in this
OrderedKeys, in [1,size()]
-
isContiguous
default boolean isContiguous()Description copied from interface:OrderedKeysHelper to tell you if this is one contiguous range.- Specified by:
isContiguousin interfaceOrderedKeys
-
size
long size()Description copied from interface:OrderedKeysGet the number of keys in thisOrderedKeys.- Specified by:
sizein interfaceLongSizedDataStructure- Specified by:
sizein interfaceOrderedKeys- Returns:
- The size, in [0,
Long.MAX_VALUE]
-
rangeStart
long rangeStart() -
rangeEnd
long rangeEnd()
-