Class TrackingWritableRowSetImpl
- All Implemented Interfaces:
LogOutputAppendable
,RowSequence
,RowSet
,TrackingRowSet
,TrackingWritableRowSet
,WritableRowSet
,LongSizedDataStructure
,SafeCloseable
,Externalizable
,Serializable
,AutoCloseable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.rowset.RowSequence
RowSequence.Iterator
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
Nested classes/interfaces inherited from interface io.deephaven.engine.rowset.TrackingRowSet
TrackingRowSet.Indexer
-
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Free any resources associated with this object.copyPrev()
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.void
Initializes our previous value from the current value.long
Same aslastRowKey()
, as of the end of the previous update graph cycle.protected void
prev()
Access the read-only value of this TrackingRowSet as of the end of the previous update graph cycle.void
readExternal
(@NotNull ObjectInput in) long
sizePrev()
Get the size of this TrackingRowSet as of the end of the previous update graph cycle.Destructively convert this WritableRowSet into aTrackingWritableRowSet
.Methods inherited from class io.deephaven.engine.rowset.impl.WritableRowSetImpl
addToBuilderFromImpl, append, asRowSet, clear, compact, containsRange, copy, equals, fillRowKeyChunk, fillRowKeyRangesChunk, find, firstRowKey, forEachRowKey, forEachRowKeyRange, get, getAverageRunLengthEstimate, getInnerSet, getInnerSet, getKeysForPositions, getRowSequenceByKeyRange, getRowSequenceByPosition, getRowSequenceIterator, insert, insert, insert, insertRange, insertWithShift, intersect, invert, isEmpty, iterator, lastRowKey, minus, overlaps, overlapsRange, postMutationHook, rangeIterator, rangesCountUpperBound, remove, remove, remove, removeRange, resetTo, retain, retainRange, reverseIterator, searchIterator, shift, shiftInPlace, size, subSetByKeyRange, subSetByPositionRange, subSetForPositions, subSetForPositions, subSetForReversePositions, subsetOf, toString, toString, union, update, validate, writeExternal, writeImpl
Methods inherited from class io.deephaven.engine.rowset.impl.RowSequenceAsChunkImpl
asRowKeyChunk, asRowKeyRangesChunk, closeRowSequenceAsChunkImpl, invalidateRowSequenceAsChunkImpl, runsUpperBound
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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
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, union, validate, validate
Methods inherited from interface io.deephaven.engine.rowset.TrackingRowSet
intSizePrev, writableCast
Methods inherited from interface io.deephaven.engine.rowset.WritableRowSet
clear, compact, extract, insert, insert, insert, insertRange, insertWithShift, remove, remove, remove, removeRange, resetTo, retain, retainRange, shiftInPlace, trackingCast, update
-
Constructor Details
-
TrackingWritableRowSetImpl
public TrackingWritableRowSetImpl() -
TrackingWritableRowSetImpl
-
-
Method Details
-
indexer
public <INDEXER_TYPE extends TrackingRowSet.Indexer> INDEXER_TYPE indexer(@NotNull @NotNull Function<TrackingRowSet, INDEXER_TYPE> indexerFactory) Description copied from interface:TrackingRowSet
Get an opaqueTrackingRowSet.Indexer
object previously associated with this TrackingRowSet, or set and get one created withindexerFactory
if this is the first invocation.- Specified by:
indexer
in interfaceTrackingRowSet
- 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
Description copied from interface:TrackingRowSet
Get an opaqueTrackingRowSet.Indexer
object previously associated with this TrackingRowSet.- Specified by:
indexer
in interfaceTrackingRowSet
- Returns:
- An opaque indexer object associated with this TrackingRowSet, or
null
if none has been set
-
preMutationHook
protected void preMutationHook()- Overrides:
preMutationHook
in classWritableRowSetImpl
-
toTracking
Description copied from interface:WritableRowSet
Destructively convert this WritableRowSet into a
TrackingWritableRowSet
.This is really only suitable when the caller "owns" this WritableRowSet. Programming errors may occur if the any code holds onto references to
this
rather than the result, because there may be ambiguity about resource ownership.Implementations are free to transfer ownership of resources from this object to the result. As such, it is an error to directly use this object afterwards; callers must instead use the returned result.
It is an error to invoke this on an instance that is already tracking.
- Specified by:
toTracking
in interfaceWritableRowSet
- Overrides:
toTracking
in classWritableRowSetImpl
- Returns:
- A
TrackingWritableRowSet
constructed from this WritableRowSet, orthis
if already tracking
-
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 interfaceRowSet
- Specified by:
close
in interfaceSafeCloseable
- Overrides:
close
in classWritableRowSetImpl
-
initializePreviousValue
public void initializePreviousValue()Description copied from interface:TrackingWritableRowSet
Initializes our previous value from the current value.This call is used by operations that manipulate a TrackingWritableRowSet while constructing it, but need to set the state at the end of the initial operation to the current state.
Calling this in other circumstances will yield undefined results.
- Specified by:
initializePreviousValue
in interfaceTrackingWritableRowSet
-
sizePrev
public long sizePrev()Description copied from interface:TrackingRowSet
Get the size of this TrackingRowSet as of the end of the previous update graph cycle.- Specified by:
sizePrev
in interfaceTrackingRowSet
- Returns:
- The previous size
-
copyPrev
Description copied from interface:TrackingRowSet
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.- Specified by:
copyPrev
in interfaceTrackingRowSet
- Returns:
- A copy of the previous value
-
prev
Description copied from interface:TrackingRowSet
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.- Specified by:
prev
in interfaceTrackingRowSet
- Returns:
- A read-only view of the previous value, owned by this TrackingRowSet
-
getPrev
public long getPrev(long rowPosition) Description copied from interface:TrackingRowSet
Same asget(rowPosition)
, as of the end of the previous update graph cycle.- Specified by:
getPrev
in interfaceTrackingRowSet
- Parameters:
rowPosition
- A row position in this RowSet between0
andsizePrev() - 1
.- Returns:
- The row key previously at the supplied row position
-
findPrev
public long findPrev(long rowKey) Description copied from interface:TrackingRowSet
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.- Specified by:
findPrev
in interfaceTrackingRowSet
- 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
-
firstRowKeyPrev
public long firstRowKeyPrev()Description copied from interface:TrackingRowSet
Same asfirstRowKey()
, as of the end of the previous update graph cycle.- Specified by:
firstRowKeyPrev
in interfaceTrackingRowSet
- Returns:
- The previous first row key
-
lastRowKeyPrev
public long lastRowKeyPrev()Description copied from interface:TrackingRowSet
Same aslastRowKey()
, as of the end of the previous update graph cycle.- Specified by:
lastRowKeyPrev
in interfaceTrackingRowSet
- Returns:
- The previous last row key
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classWritableRowSetImpl
- Throws:
IOException
-