Package io.deephaven.engine.rowset
Interface TrackingRowSet
- All Superinterfaces:
AutoCloseable
,LogOutputAppendable
,LongSizedDataStructure
,RowSequence
,RowSet
,SafeCloseable
- All Known Subinterfaces:
TrackingWritableRowSet
- All Known Implementing Classes:
TrackingWritableRowSetImpl
RowSet
that internally tracks changes and maintains a consistent snapshot of its previous state, valid during
the updating
phase of its associated LogicalClock
.
Also adds support for hosting opaque index information.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Minimal interface for optional, opaque indexer objects hosted by TrackingRowSet instances.Nested classes/interfaces inherited from interface io.deephaven.engine.rowset.RowSet
RowSet.Evaluator<T extends Comparable<T>>, RowSet.Iterator, RowSet.RangeIterator, RowSet.SearchIterator, RowSet.TargetComparator
-
Field Summary
Fields inherited from interface io.deephaven.engine.rowset.RowSequence
NULL_ROW_KEY
Fields inherited from interface io.deephaven.engine.rowset.RowSet
EMPTY_ITERATOR
-
Method Summary
Modifier and TypeMethodDescriptioncopyPrev()
Get a copy of the value of this TrackingRowSet as of the end of the previous update graph cycle.long
findPrev
(long rowKey) Returns the position in[0..(size-1)]
where the row key is found in the previous value of this.long
Same asfirstRowKey()
, as of the end of the previous update graph cycle.long
getPrev
(long rowPosition) Same asget(rowPosition)
, as of the end of the previous update graph cycle.<INDEXER_TYPE extends TrackingRowSet.Indexer>
INDEXER_TYPEindexer()
Get an opaqueTrackingRowSet.Indexer
object previously associated with this TrackingRowSet.<INDEXER_TYPE extends TrackingRowSet.Indexer>
INDEXER_TYPEindexer
(@NotNull Function<TrackingRowSet, INDEXER_TYPE> indexerFactory) Get an opaqueTrackingRowSet.Indexer
object previously associated with this TrackingRowSet, or set and get one created withindexerFactory
if this is the first invocation.default int
Get the size of this TrackingRowSet as of the end of the previous update graph cycle, constrained to be between0
and 2147483647.long
Same aslastRowKey()
, as of the end of the previous update graph cycle.prev()
Access the read-only value of this TrackingRowSet as of the end of the previous update graph cycle.long
sizePrev()
Get the size of this TrackingRowSet as of the end of the previous update graph cycle.default TrackingWritableRowSet
Cast this RowSet reference to aWritableRowSet
.Methods inherited from interface io.deephaven.base.log.LogOutputAppendable
append
Methods inherited from interface io.deephaven.util.datastructures.LongSizedDataStructure
intSize, intSize
Methods inherited from interface io.deephaven.engine.rowset.RowSequence
asRowKeyChunk, asRowKeyRangesChunk, asRowSet, fillRowKeyChunk, fillRowKeyRangesChunk, forAllRowKeyRanges, forEachRowKeyRange, getAverageRunLengthEstimate, getRowSequenceByKeyRange, getRowSequenceByPosition, getRowSequenceIterator, isContiguous
Methods inherited from interface io.deephaven.engine.rowset.RowSet
close, containsRange, copy, find, firstRowKey, forAllRowKeys, forEachRowKey, get, getKeysForPositions, intersect, invert, invert, isEmpty, isFlat, isNonempty, isTracking, isWritable, iterator, lastRowKey, minus, overlaps, overlapsRange, rangeIterator, reverseIterator, searchIterator, shift, size, subSetByKeyRange, subSetByPositionRange, subSetForPositions, subSetForPositions, subSetForReversePositions, subsetOf, toRowKeyArray, toRowKeyArray, trackingCast, union, validate, validate
-
Method Details
-
sizePrev
long sizePrev()Get the size of this TrackingRowSet as of the end of the previous update graph cycle.- Returns:
- The previous size
-
intSizePrev
default int intSizePrev()Get the size of this TrackingRowSet as of the end of the previous update graph cycle, constrained to be between0
and 2147483647.- Returns:
- The previous size, as an
int
-
copyPrev
WritableRowSet copyPrev()Get a copy of the value of this TrackingRowSet as of the end of the previous update graph cycle. As in other operations that return aWritableRowSet
, the result must beclosed
by the caller when it is no longer needed. The result will never be aTrackingRowSet
; useWritableRowSet.toTracking()
on the result as needed.- Returns:
- A copy of the previous value
-
prev
RowSet prev()Access the read-only value of this TrackingRowSet as of the end of the previous update graph cycle. The returnedRowSet
must not be mutated orclosed
; it belongs to this TrackingRowSet. Callers should be sure to only use the result during the updating phase of a cycle, and never across logical clock phases/steps.- Returns:
- A read-only view of the previous value, owned by this TrackingRowSet
-
getPrev
long getPrev(long rowPosition) Same asget(rowPosition)
, as of the end of the previous update graph cycle.- Parameters:
rowPosition
- A row position in this RowSet between0
andsizePrev() - 1
.- Returns:
- The row key previously at the supplied row position
-
firstRowKeyPrev
long firstRowKeyPrev()Same asfirstRowKey()
, as of the end of the previous update graph cycle.- Returns:
- The previous first row key
-
lastRowKeyPrev
long lastRowKeyPrev()Same aslastRowKey()
, as of the end of the previous update graph cycle.- Returns:
- The previous last row key
-
findPrev
long findPrev(long rowKey) Returns the position in[0..(size-1)]
where the row key is found in the previous value of this. If not found, then return(-(position it would be) - 1)
, as in Array.binarySearch.- Parameters:
rowKey
- The row key to search for- Returns:
- A position from
[0..(size-1)]
if the row key was found. If the row key was not found, then(-position - 1)
as in Array.binarySearch
-
indexer
<INDEXER_TYPE extends TrackingRowSet.Indexer> INDEXER_TYPE indexer(@NotNull @NotNull Function<TrackingRowSet, INDEXER_TYPE> indexerFactory) Get an opaqueTrackingRowSet.Indexer
object previously associated with this TrackingRowSet, or set and get one created withindexerFactory
if this is the first invocation.- Parameters:
indexerFactory
- The indexer factory to be used if no indexer has been set previously- Returns:
- An opaque indexer object associated with this TrackingRowSet
-
indexer
Get an opaqueTrackingRowSet.Indexer
object previously associated with this TrackingRowSet.- Returns:
- An opaque indexer object associated with this TrackingRowSet, or
null
if none has been set
-
writableCast
Description copied from interface:RowSet
Cast this RowSet reference to a
WritableRowSet
.- Specified by:
writableCast
in interfaceRowSet
- Returns:
this
cast to aWritableRowSet
-