Interface RowSequence
- All Superinterfaces:
AutoCloseable,LongSizedDataStructure,SafeCloseable
- All Known Subinterfaces:
RowSet,SingleRangeMixin,TrackingRowSet,TrackingWritableRowSet,WritableRowSet
- All Known Implementing Classes:
RowSequenceAsChunkImpl,RowSequenceKeyRangesChunkImpl,RowSequenceRowKeysChunkImpl,RspRowSequence,ShiftedRowSequence,SingleRangeRowSequence,SortedRangesRowSequence,TrackingWritableRowSetImpl,WritableRowSetImpl
long row keys.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIterator for consuming anRowSequenceby ordered subsets. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGet aLongChunkrepresentation of the individual row keys in thisRowSequence.Get aLongChunkrepresentation of row key ranges in thisRowSequence.asRowSet()Get aRowSetrepresentation of thisRowSequence.default voidclose()Free any resources associated with this object.voidfillRowKeyChunk(WritableLongChunk<? super OrderedRowKeys> chunkToFill) Fill the suppliedWritableLongChunkwith individual row keys from thisRowSequence.voidfillRowKeyRangesChunk(WritableLongChunk<OrderedRowKeyRanges> chunkToFill) Fill the suppliedWritableLongChunkwith row key ranges from thisRowSequence.longGet the first row key in thisRowSequence.default voiddefault voidbooleanFor as long as the consumer wants more row keys, call accept on the consumer with the individual row key instances in this RowSequence, in increasing order.booleanFor as long as the consumer wants more ranges, call accept on the consumer with the individual row key ranges in this RowSequence, in increasing order.longGet an estimate of the average (mean) length of runs of adjacent row keys in thisRowSequence.getRowSequenceByKeyRange(long startRowKeyInclusive, long endRowKeyInclusive) Get an ordered subset of the row keys in thisRowSequencefor a row key range.getRowSequenceByPosition(long startPositionInclusive, long length) Get an ordered subset of the row keys in thisRowSequencefor a position range.Get anRowSequence.Iteratorover thisRowSequence.default booleanHelper to tell you if this is one contiguous range.booleanisEmpty()True if the size of thisRowSequenceis zero.longGet the last row key in thisRowSequence.longsize()Get the number of row keys in thisRowSequence.Methods inherited from interface io.deephaven.util.datastructures.LongSizedDataStructure
intSize, intSize
-
Field Details
-
NULL_ROW_KEY
static final long NULL_ROW_KEYThe null row key.- See Also:
-
-
Method Details
-
getRowSequenceIterator
RowSequence.Iterator getRowSequenceIterator()Get anRowSequence.Iteratorover thisRowSequence.- Returns:
- A new iterator, positioned at the first row key
-
getRowSequenceByPosition
Get an ordered subset of the row keys in this
RowSequencefor a position range. The result will contain the set of row 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.- Parameters:
startPositionInclusive- The position of the first row key to includelength- The number of row keys to include- Returns:
- The subset as an
RowSequence, which may bethis
-
getRowSequenceByKeyRange
Get an ordered subset of the row keys in this
RowSequencefor a row key range. The returned set will be the intersection of the row keys inthiswith the row keys in the closed interval [startRowKeyInclusive,endRowKeyInclusive]. The returned reference is owned by the caller, who should callclose()when it is done with it.- Parameters:
startRowKeyInclusive- The minimum row key to includeendRowKeyInclusive- The maximum row key to include- Returns:
- The subset as an
RowSequence, which may bethis
-
asRowSet
RowSet asRowSet()Get aRowSetrepresentation of thisRowSequence. -
asRowKeyChunk
LongChunk<OrderedRowKeys> asRowKeyChunk()Get aLongChunkrepresentation of the individual row keys in thisRowSequence.- Returns:
- A
LongChunkcontaining the row keys in thisRowSequence - ApiNote:
- This
RowSequenceowns the result, which is valid only as long as thisRowSequenceremains valid. You must not mutate the result.
-
asRowKeyRangesChunk
LongChunk<OrderedRowKeyRanges> asRowKeyRangesChunk()Get aLongChunkrepresentation of row key ranges in thisRowSequence.- Returns:
- A
LongChunkcontaining the row key ranges in thisRowSequence - ApiNote:
- This
RowSequenceowns the result, which is valid only as long as thisRowSequenceremains valid. You must not mutate the result.
-
fillRowKeyChunk
Fill the supplied
WritableLongChunkwith individual row keys from thisRowSequence.The chunk's capacity is assumed to be big enough.
- Parameters:
chunkToFill- A chunk to fill with individual row keys
-
fillRowKeyRangesChunk
Fill the supplied
WritableLongChunkwith row key ranges from thisRowSequence.The chunk's capacity is assumed to be big enough.
- Parameters:
chunkToFill- A chunk to fill with row key ranges
-
isEmpty
boolean isEmpty()True if the size of thisRowSequenceis zero.- Returns:
- True if there are no elements in this
RowSequence.
-
firstRowKey
long firstRowKey()Get the first row key in thisRowSequence.- Returns:
- The first row key, or
NULL_ROW_KEYif there is none.
-
lastRowKey
long lastRowKey()Get the last row key in thisRowSequence.- Returns:
- The last row key, or
NULL_ROW_KEYif there is none.
-
size
long size()Get the number of row keys in thisRowSequence.- Specified by:
sizein interfaceLongSizedDataStructure- Returns:
- The size, in [0,
Long.MAX_VALUE]
-
isContiguous
default boolean isContiguous()Helper to tell you if this is one contiguous range. -
getAverageRunLengthEstimate
long getAverageRunLengthEstimate()Get an estimate of the average (mean) length of runs of adjacent row keys in this
RowSequence.Implementations should strive to keep this method efficient (O(1) preferred) at the expense of accuracy.
Empty
RowSequenceshould return an arbitrary valid value, usually 1.- Returns:
- An estimate of the average run length in this
RowSequence, in [1,size()]
-
forEachRowKey
For as long as the consumer wants more row keys, call accept on the consumer with the individual row key instances in this RowSequence, in increasing order.- Parameters:
lac- a consumer to feed the individual row key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
forEachRowKeyRange
For as long as the consumer wants more ranges, call accept on the consumer with the individual row key ranges in this RowSequence, in increasing order.- Parameters:
larc- a consumer to feed the individual row key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
forAllRowKeys
-
forAllRowKeyRanges
-
close
default void close()Free any resources associated with this object.
Using any
RowSequencemethods afterclose()is an error and may produce exceptions or undefined results.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-