Class RowSequenceRowKeysChunkImpl
- All Implemented Interfaces:
RowSequence
,LongSizedDataStructure
,SafeCloseable
,AutoCloseable
-
Field Summary
Fields inherited from interface io.deephaven.engine.rowset.RowSequence
NULL_ROW_KEY
-
Method Summary
Modifier and TypeMethodDescriptionfinal LongChunk<OrderedRowKeys>
Get aLongChunk
representation of the individual row keys in thisRowSequence
.final LongChunk<OrderedRowKeyRanges>
Get aLongChunk
representation of row key ranges in thisRowSequence
.final RowSet
asRowSet()
Get aRowSet
representation of thisRowSequence
.void
close()
Free any resources associated with this object.final void
fillRowKeyChunk
(WritableLongChunk<? super OrderedRowKeys> chunkToFill) Fill the suppliedWritableLongChunk
with individual row keys from thisRowSequence
.final void
fillRowKeyRangesChunk
(WritableLongChunk<OrderedRowKeyRanges> chunkToFill) Fill the suppliedWritableLongChunk
with row key ranges from thisRowSequence
.long
Get the first row key in thisRowSequence
.boolean
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.boolean
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.long
Get an estimate of the average (mean) length of runs of adjacent row keys in thisRowSequence
.final RowSequence
getRowSequenceByKeyRange
(long startRowKeyInclusive, long endRowKeyInclusive) Get an ordered subset of the row keys in thisRowSequence
for a row key range.final RowSequence
getRowSequenceByPosition
(long startPositionInclusive, long length) Get an ordered subset of the row keys in thisRowSequence
for a position range.final RowSequence.Iterator
Get anRowSequence.Iterator
over thisRowSequence
.boolean
isEmpty()
True if the size of thisRowSequence
is zero.long
Get the last row key in thisRowSequence
.static RowSequenceRowKeysChunkImpl
makeByTaking
(WritableLongChunk<OrderedRowKeys> backingChunkToOwn) static RowSequenceRowKeysChunkImpl
makeByWrapping
(LongChunk<OrderedRowKeys> backingChunk) final long
size()
Get the number of row keys in thisRowSequence
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.util.datastructures.LongSizedDataStructure
intSize, intSize
Methods inherited from interface io.deephaven.engine.rowset.RowSequence
forAllRowKeyRanges, forAllRowKeys, isContiguous
-
Method Details
-
makeByWrapping
-
makeByTaking
public static RowSequenceRowKeysChunkImpl makeByTaking(WritableLongChunk<OrderedRowKeys> backingChunkToOwn) -
getRowSequenceIterator
Description copied from interface:RowSequence
Get anRowSequence.Iterator
over thisRowSequence
.- Specified by:
getRowSequenceIterator
in interfaceRowSequence
- Returns:
- A new iterator, positioned at the first row key
-
getRowSequenceByPosition
Description copied from interface:RowSequence
Get an ordered subset of the row keys in this
RowSequence
for a position range. The result will contain the set of row keys inthis
that 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:
getRowSequenceByPosition
in interfaceRowSequence
- 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
public final RowSequence getRowSequenceByKeyRange(long startRowKeyInclusive, long endRowKeyInclusive) Description copied from interface:RowSequence
Get an ordered subset of the row keys in this
RowSequence
for a row key range. The returned set will be the intersection of the row keys inthis
with 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.- Specified by:
getRowSequenceByKeyRange
in interfaceRowSequence
- Parameters:
startRowKeyInclusive
- The minimum row key to includeendRowKeyInclusive
- The maximum row key to include- Returns:
- The subset as an
RowSequence
, which may bethis
-
asRowSet
Description copied from interface:RowSequence
Get aRowSet
representation of thisRowSequence
.- Specified by:
asRowSet
in interfaceRowSequence
- Returns:
- A
RowSet
representation for the same row keys in the same order
-
asRowKeyChunk
Description copied from interface:RowSequence
Get aLongChunk
representation of the individual row keys in thisRowSequence
.- Specified by:
asRowKeyChunk
in interfaceRowSequence
- Returns:
- A
LongChunk
containing the row keys in thisRowSequence
-
asRowKeyRangesChunk
Description copied from interface:RowSequence
Get aLongChunk
representation of row key ranges in thisRowSequence
.- Specified by:
asRowKeyRangesChunk
in interfaceRowSequence
- Returns:
- A
LongChunk
containing the row key ranges in thisRowSequence
-
fillRowKeyChunk
Description copied from interface:RowSequence
Fill the supplied
WritableLongChunk
with individual row keys from thisRowSequence
.The chunk's capacity is assumed to be big enough.
- Specified by:
fillRowKeyChunk
in interfaceRowSequence
- Parameters:
chunkToFill
- A chunk to fill with individual row keys
-
fillRowKeyRangesChunk
Description copied from interface:RowSequence
Fill the supplied
WritableLongChunk
with row key ranges from thisRowSequence
.The chunk's capacity is assumed to be big enough.
- Specified by:
fillRowKeyRangesChunk
in interfaceRowSequence
- Parameters:
chunkToFill
- A chunk to fill with row key ranges
-
isEmpty
public boolean isEmpty()Description copied from interface:RowSequence
True if the size of thisRowSequence
is zero.- Specified by:
isEmpty
in interfaceRowSequence
- Returns:
- True if there are no elements in this
RowSequence
.
-
firstRowKey
public long firstRowKey()Description copied from interface:RowSequence
Get the first row key in thisRowSequence
.- Specified by:
firstRowKey
in interfaceRowSequence
- Returns:
- The first row key, or
RowSequence.NULL_ROW_KEY
if there is none.
-
lastRowKey
public long lastRowKey()Description copied from interface:RowSequence
Get the last row key in thisRowSequence
.- Specified by:
lastRowKey
in interfaceRowSequence
- Returns:
- The last row key, or
RowSequence.NULL_ROW_KEY
if there is none.
-
size
public final long size()Description copied from interface:RowSequence
Get the number of row keys in thisRowSequence
.- Specified by:
size
in interfaceLongSizedDataStructure
- Specified by:
size
in interfaceRowSequence
- Returns:
- The size, in [0,
Long.MAX_VALUE
]
-
getAverageRunLengthEstimate
public long getAverageRunLengthEstimate()Description copied from interface:RowSequence
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
RowSequence
should return an arbitrary valid value, usually 1.- Specified by:
getAverageRunLengthEstimate
in interfaceRowSequence
- Returns:
- An estimate of the average run length in this
RowSequence
, in [1,size()
]
-
forEachRowKey
Description copied from interface:RowSequence
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.- Specified by:
forEachRowKey
in interfaceRowSequence
- Parameters:
lc
- a consumer to feed the individual row key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
forEachRowKeyRange
Description copied from interface:RowSequence
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.- Specified by:
forEachRowKeyRange
in interfaceRowSequence
- Parameters:
lc
- a consumer to feed the individual row key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
close
public void close()Description copied from interface:RowSequence
Free any resources associated with this object.
Using any
RowSequence
methods afterclose()
is an error and may produce exceptions or undefined results.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRowSequence
- Specified by:
close
in interfaceSafeCloseable
-