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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceMinimal 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_KEYFields 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.longfindPrev(long rowKey) Returns the position in[0..(size-1)]where the row key is found in the previous value of this.longSame asfirstRowKey(), as of the end of the previous update graph cycle.longgetPrev(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.Indexerobject previously associated with this TrackingRowSet.<INDEXER_TYPE extends TrackingRowSet.Indexer>
INDEXER_TYPEindexer(@NotNull Function<TrackingRowSet, INDEXER_TYPE> indexerFactory) Get an opaqueTrackingRowSet.Indexerobject previously associated with this TrackingRowSet, or set and get one created withindexerFactoryif this is the first invocation.default intGet the size of this TrackingRowSet as of the end of the previous update graph cycle, constrained to be between0and 2147483647.longSame 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.longsizePrev()Get the size of this TrackingRowSet as of the end of the previous update graph cycle.default TrackingWritableRowSetCast this RowSet reference to aWritableRowSet.Methods inherited from interface io.deephaven.base.log.LogOutputAppendable
appendMethods inherited from interface io.deephaven.util.datastructures.LongSizedDataStructure
intSize, intSizeMethods inherited from interface io.deephaven.engine.rowset.RowSequence
asRowKeyChunk, asRowKeyRangesChunk, asRowSet, fillRowKeyChunk, fillRowKeyRangesChunk, forAllRowKeyRanges, forEachRowKeyRange, getAverageRunLengthEstimate, getRowSequenceByKeyRange, getRowSequenceByPosition, getRowSequenceIterator, isContiguousMethods 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 between0and 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 beclosedby 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 returnedRowSetmust 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 between0andsizePrev() - 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.Indexerobject previously associated with this TrackingRowSet, or set and get one created withindexerFactoryif 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.Indexerobject previously associated with this TrackingRowSet.- Returns:
- An opaque indexer object associated with this TrackingRowSet, or
nullif none has been set
-
writableCast
Description copied from interface:RowSetCast this RowSet reference to a
WritableRowSet.- Specified by:
writableCastin interfaceRowSet- Returns:
thiscast to aWritableRowSet
-