Package io.deephaven.engine.rowset
Interface WritableRowSet
- All Superinterfaces:
AutoCloseable
,LogOutputAppendable
,LongSizedDataStructure
,RowSequence
,RowSet
,SafeCloseable
- All Known Subinterfaces:
TrackingWritableRowSet
- All Known Implementing Classes:
TrackingWritableRowSetImpl
,WritableRowSetImpl
-
Nested Class Summary
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 TypeMethodDescriptionvoid
clear()
void
compact()
May reclaim some unused memory.default @NotNull WritableRowSet
Removes all the keys from other RowSet that are present in this RowSet.void
insert
(long key) Add a single key to this RowSet if it's not already present.void
insert
(LongChunk<OrderedRowKeys> keys, int offset, int length) Add all of the (ordered) keys in a slice ofkeys
to this RowSet if they are not already present.void
Add all of the keys inadded
to this RowSet if they are not already present.void
insertRange
(long startKey, long endKey) Add all keys in a closed range to this RowSet if they are not already present.void
insertWithShift
(long shiftAmount, RowSet other) For each key in the provided RowSet, shift it by shiftAmount and insert it in the current RowSet.void
remove
(long key) Remove a single key from this RowSet if it's present.void
remove
(LongChunk<OrderedRowKeys> keys, int offset, int length) Remove all of the (ordered) keys in a slice ofkeys
from this RowSet if they are present.void
Remove all of the keys inremoved
that are present in this RowSet.void
removeRange
(long startKey, long endKey) Remove all keys in a closed range from this RowSet if they are present.void
Reset this RowSet to exactly match another RowSet.void
Modifies the RowSet by removing any keys not in the rowSetToIntersect argument.void
retainRange
(long startRowKey, long endRowKey) Modifies the RowSet by keeping only keys in the interval [startRowKey, endRowKey]void
shiftInPlace
(long shiftAmount) Destructively convert this WritableRowSet into aTrackingWritableRowSet
.default TrackingWritableRowSet
Cast this RowSet reference to aTrackingRowSet
.void
Simultaneously adds the keys from the first RowSet and removes the keys from the second one.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, union, validate, validate, writableCast
-
Method Details
-
insert
void insert(long key) Add a single key to this RowSet if it's not already present.- Parameters:
key
- The key to add
-
insertRange
void insertRange(long startKey, long endKey) Add all keys in a closed range to this RowSet if they are not already present.- Parameters:
startKey
- The first key to addendKey
- The last key to add (inclusive)
-
insert
Add all of the (ordered) keys in a slice ofkeys
to this RowSet if they are not already present.- Parameters:
keys
- TheLongChunk
ofOrderedRowKeys
to insertoffset
- The offset inkeys
to begin inserting keys fromlength
- The number of keys to insert
-
insert
Add all of the keys inadded
to this RowSet if they are not already present.- Parameters:
added
- The RowSet to add
-
remove
void remove(long key) Remove a single key from this RowSet if it's present.- Parameters:
key
- The key to remove
-
removeRange
void removeRange(long startKey, long endKey) Remove all keys in a closed range from this RowSet if they are present.- Parameters:
startKey
- The first key to removeendKey
- The last key to remove (inclusive)
-
remove
Remove all of the (ordered) keys in a slice ofkeys
from this RowSet if they are present.- Parameters:
keys
- TheLongChunk
ofOrderedRowKeys
to removeoffset
- The offset inkeys
to begin removing keys fromlength
- The number of keys to remove
-
remove
Remove all of the keys inremoved
that are present in this RowSet.- Parameters:
removed
- The RowSet to remove
-
update
Simultaneously adds the keys from the first RowSet and removes the keys from the second one. API assumption: the intersection of added and removed is empty. -
extract
Removes all the keys from other RowSet that are present in this RowSet.- Returns:
- a new RowSet representing the keys removed
-
retain
Modifies the RowSet by removing any keys not in the rowSetToIntersect argument.- Parameters:
rowSetToIntersect
- a rowSet with the keys to retain; any other keys not in rowSetToIntersect will be removed.
-
retainRange
void retainRange(long startRowKey, long endRowKey) Modifies the RowSet by keeping only keys in the interval [startRowKey, endRowKey]- Parameters:
startRowKey
- beginning of interval of keys to keep.endRowKey
- endRowKey of interval of keys to keep (inclusive).
-
clear
void clear() -
shiftInPlace
void shiftInPlace(long shiftAmount) -
insertWithShift
For each key in the provided RowSet, shift it by shiftAmount and insert it in the current RowSet.- Parameters:
shiftAmount
- the amount to add to each key in the RowSet argument before insertion.other
- the RowSet with the keys to shift and insert.
-
compact
void compact()May reclaim some unused memory. -
resetTo
Reset this RowSet to exactly match another RowSet. Subsequent modifications toother
will not changethis
.- Parameters:
other
- The RowSet to reset to
-
trackingCast
Description copied from interface:RowSet
Cast this RowSet reference to a
TrackingRowSet
.- Specified by:
trackingCast
in interfaceRowSet
- Returns:
this
cast to aTrackingRowSet
-
toTracking
TrackingWritableRowSet toTracking()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.
- Returns:
- A
TrackingWritableRowSet
constructed from this WritableRowSet, orthis
if already tracking
-