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_KEYFields inherited from interface io.deephaven.engine.rowset.RowSet
EMPTY_ITERATOR -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidcompact()May reclaim some unused memory.default @NotNull WritableRowSetRemoves all the keys from other RowSet that are present in this RowSet.voidinsert(long key) Add a single key to this RowSet if it's not already present.voidinsert(LongChunk<OrderedRowKeys> keys, int offset, int length) Add all of the (ordered) keys in a slice ofkeysto this RowSet if they are not already present.voidAdd all of the keys inaddedto this RowSet if they are not already present.voidinsertRange(long startKey, long endKey) Add all keys in a closed range to this RowSet if they are not already present.voidinsertWithShift(long shiftAmount, RowSet other) For each key in the provided RowSet, shift it by shiftAmount and insert it in the current RowSet.voidremove(long key) Remove a single key from this RowSet if it's present.voidremove(LongChunk<OrderedRowKeys> keys, int offset, int length) Remove all of the (ordered) keys in a slice ofkeysfrom this RowSet if they are present.voidRemove all of the keys inremovedthat are present in this RowSet.voidremoveRange(long startKey, long endKey) Remove all keys in a closed range from this RowSet if they are present.voidReset this RowSet to exactly match another RowSet.voidModifies the RowSet by removing any keys not in the rowSetToIntersect argument.voidretainRange(long startRowKey, long endRowKey) Modifies the RowSet by keeping only keys in the interval [startRowKey, endRowKey]voidshiftInPlace(long shiftAmount) Destructively convert this WritableRowSet into aTrackingWritableRowSet.default TrackingWritableRowSetCast this RowSet reference to aTrackingRowSet.voidSimultaneously adds the keys from the first RowSet and removes the keys from the second one.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, 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 ofkeysto this RowSet if they are not already present.- Parameters:
keys- TheLongChunkofOrderedRowKeysto insertoffset- The offset inkeysto begin inserting keys fromlength- The number of keys to insert
-
insert
Add all of the keys inaddedto 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 ofkeysfrom this RowSet if they are present.- Parameters:
keys- TheLongChunkofOrderedRowKeysto removeoffset- The offset inkeysto begin removing keys fromlength- The number of keys to remove
-
remove
Remove all of the keys inremovedthat 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 tootherwill not changethis.- Parameters:
other- The RowSet to reset to
-
trackingCast
Description copied from interface:RowSetCast this RowSet reference to a
TrackingRowSet.- Specified by:
trackingCastin interfaceRowSet- Returns:
thiscast 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
thisrather 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
TrackingWritableRowSetconstructed from this WritableRowSet, orthisif already tracking
-