Class RspBitmap
java.lang.Object
io.deephaven.engine.rowset.impl.RefCountedCow<T>
io.deephaven.engine.rowset.impl.rsp.RspArray<RspBitmap>
io.deephaven.engine.rowset.impl.rsp.RspBitmap
- All Implemented Interfaces:
OrderedLongSet
- Direct Known Subclasses:
DisposableRspBitmap
See header comment on RspArray for explanation on space partitioning.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.deephaven.engine.rowset.impl.rsp.RspArray
RspArray.ArraysBuf, RspArray.SpanCursor, RspArray.SpanCursorForward, RspArray.SpanViewNested classes/interfaces inherited from interface io.deephaven.engine.rowset.impl.OrderedLongSet
OrderedLongSet.BuilderSequential -
Field Summary
Fields inherited from class io.deephaven.engine.rowset.impl.rsp.RspArray
BITS_PER_BLOCK, BLOCK_LAST, BLOCK_SIZE, debug, FULL_BLOCK_SPAN_MARKER, spanInfos, spans, workDataPerThreadFields inherited from interface io.deephaven.engine.rowset.impl.OrderedLongSet
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(long val) addRange(long start, long end) addRangeExclusiveEnd(long start, long end) voidaddRangeUnsafe(long start, long end) intaddRangeUnsafeNoWriteCheck(int fromIdx, long start, long end) voidaddRangeUnsafeNoWriteCheck(long first, long last) addUnsafe(long val) voidaddUnsafeNoWriteCheck(long val) addValuesUnsafe(LongChunk<OrderedRowKeys> values, int offset, int length) voidaddValuesUnsafeNoWriteCheck(LongChunk<OrderedRowKeys> values, int offset, int length) static RspBitmapReturn the logical and of two bitmaps as a new bitmap.Removes every element from this bitmap that is not in the other bitmap.andEqualsUnsafe(RspBitmap other) static RspBitmapReturn the logical result of r1 and not r2 as a new bitmap.andNotEquals(RspBitmap other) andNotEqualsUnsafe(RspBitmap other) Remove every element in other from this bitmap.static RspBitmapandNotImpl(RspBitmap r1, RspBitmap r2) Return the logical result of r1 and not r2 as a new RspArray.append(long v) voidappendContainerUnsafeNoWriteCheck(long k, Container c) voidappendFullBlockSpanUnsafeNoWriteCheck(long k, long slen) appendRange(long start, long end) appendRangeUnsafe(long start, long end) voidappendRangeUnsafeNoWriteCheck(long start, long end) voidappendRangeUnsafeNoWriteCheck(long sHigh, long start, long end) voidappendShiftedUnsafeNoWriteCheck(long shiftAmount, RspArray other, boolean acquire) appendUnsafe(long v) voidappendUnsafeNoWriteCheck(long v) applyOffset(long offset) Apply an offset to every value in this bitmap, mutating it.applyOffsetImpl(long offset, Supplier<RspBitmap> onZeroOffset, Supplier<RspBitmap> onAlignedOffset) applyOffsetNoWriteCheck(long offset) applyOffsetOnNew(long offset) Apply an offset to every value in this bitmap, returning a new bitmap (original is not changed).static ContainercontainerForLowValueAndRange(int val, int start, int end) booleancontains(long val) deepCopy()Get a deep copy of the current object, not shared with anybody.booleanvoidvoidlongfirst()inthashCode()voidvoidvoidvoidinvert(LongRangeConsumer builder, RowSet.RangeIterator it, long maxPos) ixAppendRange(long startKey, long endKey) longbooleanixContainsRange(long start, long end) ixCowRef()longixFind(long key) longbooleanbooleanlongixGet(long pos) longvoidixGetKeysForPositions(PrimitiveIterator.OfLong inputPositions, LongConsumer outputKeys) ixGetRowSequenceByKeyRange(long startKeyInclusive, long endKeyInclusive) ixGetRowSequenceByPosition(long startPositionInclusive, long length) ixInsert(long key) ixInsert(OrderedLongSet other) ixInsertRange(long startKey, long endKey) final OrderedLongSetixInsertSecondHalf(LongChunk<OrderedRowKeys> values, int offset, int length) ixInsertWithShift(long shiftAmount, OrderedLongSet other) ixInsertWithShift(long shiftAmount, SortedRanges sr) ixIntersectOnNew(OrderedLongSet other) ixInvertOnNew(OrderedLongSet keys, long maximumPosition) Invert the given OrderedLongSet.booleanlongixMinusOnNew(OrderedLongSet other) booleanixOverlaps(OrderedLongSet other) booleanixOverlapsRange(long start, long end) longintvoidixRemove(long key) ixRemove(OrderedLongSet other) ixRemoveRange(long startKey, long endKey) final OrderedLongSetixRemoveSecondHalf(LongChunk<OrderedRowKeys> values, int offset, int length) ixRetain(OrderedLongSet other) ixRetainRange(long start, long end) ixRetainRangeNoWriteCheck(long start, long end) ixShiftInPlace(long shiftAmount) ixShiftOnNew(long shiftAmount) ixSubindexByKeyOnNew(long startKey, long endKey) ixSubindexByPosOnNew(long startPos, long endPosExclusive) booleanixSubsetOf(OrderedLongSet other) ixUnionOnNew(OrderedLongSet other) ixUpdate(OrderedLongSet added, OrderedLongSet removed) ixUpdateNoWriteCheck(OrderedLongSet added, OrderedLongSet removed) voidixValidate(String failMsg) longlast()protected final RspBitmapmake()protected final RspBitmapstatic RspBitmapstatic RspBitmapmakeSingle(long v) static RspBitmapmakeSingleRange(long start, long end) static RspBitmapReturn the logical or of two bitmaps as a new bitmap.Add every element on other to this bitmap.orEqualsShifted(long shiftAmount, RspBitmap other) For every key on other, add (key + shiftAmount) to this bitmap.orEqualsShiftedUnsafe(long shiftAmount, RspBitmap other) For every key on other, add (key + shiftAmount) to this bitmap.orEqualsUnsafe(RspBitmap other) Add every element on other to this bitmap.remove(long val) removeRange(long start, long end) removeRangeUnsafe(long start, long end) removeUnsafe(long val) removeUnsafeNoWriteCheck(long val) voidremoveUnsafeNoWriteCheck(long val, long blockKey, int i) protected RspBitmapself()Derived classes should implement self() by simply "return this" of the right type.subrangeByPos(long firstPos, long lastPos) subrangeByPos(long firstPos, long lastPos, boolean returnNullIfEmptyResult) subrangeByValue(long start, long end) subrangeByValue(long start, long end, boolean returnNullIfEmptyResult) booleansubsetOf(SortedRanges sr) toString()Updates the bitmap by adding and removing the bitmaps given as parameter.updateUnsafe(RspBitmap added, RspBitmap removed) voidupdateUnsafeNoWriteCheck(RspBitmap added, RspBitmap removed) Methods inherited from class io.deephaven.engine.rowset.impl.rsp.RspArray
andEqualsUnsafeNoWriteCheck, andNotEqualsUnsafeNoWriteCheck, appendContainer, appendFullBlockSpan, appendSharedContainer, appendSharedContainerMaybePacked, appendSingletonSpan, applyKeyOffset, applyKeyOffset, asRowSequence, binarySearchKeys, collectRemovedIndicesIfAny, containerOverhead, containsRange, copyKeyAndSpanMaybeSharing, copyKeyAndSpanMaybeSharing, copyKeyAndSpanStealingContainers, distanceInBlocks, divBlockSize, ensureSizeCanGrowBy, find, firstValue, firstValueAtIndex, forEachLong, forEachLongRange, forEachLongRangeInSpanWithOffsetAndMaxCardinality, get, getAverageRunLengthEstimate, getAverageRunLengthEstimate, getCardinality, getFullBlockSpanLen, getIterator, getKey, getKeysForPositions, getPackedInfoLowBits, getRangeBatchIterator, getRangeIterator, getReverseIterator, getRowSequenceByKeyRange, getRowSequenceByPosition, getRowSequenceIterator, getSingletonSpanValue, getSpanCardinalityAtIndex, getSpanCardinalityAtIndex, getSpanCardinalityAtIndexMaybeAcc, getSpanIndex, getSpanIndex, getSpanIndex, getSpanInfo, getWorkSortedRangesMutableObject, highBits, insertContainerAtIndex, insertFullBlockSpanAtIndex, insertSharedContainer, insertSingletonAtIndex, isContainer, isEmpty, isFullBlockSpan, isSingletonSpan, keyForFirstBlock, keyForLastBlock, keySearch, keySearch, lastValue, lowBits, lowBitsAsInt, markIndexAsRemoved, markIndexRangeAsRemoved, modBlockSize, nextKey, orEqualsShiftedUnsafeNoWriteCheck, orEqualsUnsafeNoWriteCheck, overlaps, overlapsRange, overlapsRange, paste, rangesCountUpperBound, rangesCountUpperBound, removeRangesUnsafeNoWriteCheck, removeRangeUnsafeNoWriteCheck, removeSpanAtIndex, replaceSpanAtIndex, sampleMetrics, searchSpanIndex, setContainerSpan, setContainerSpan, setContainerSpanRaw, setContainerSpanRaw, setFullBlockSpan, setFullBlockSpanRaw, setFullBlockSpanRaw, setLastFullBlockSpan, setOrInsertFullBlockSpanAtIndex, setSharedContainerMaybePackedRaw, setSharedContainerRaw, setSingletonSpan, setSingletonSpanRaw, shareContainers, size, spanInfoToKey, spanInfoToSingletonSpanValue, subrangeByKeyInternal, subrangeByPosInternal, subsetOf, tryCompact, tryCompact, tryCompactUnsafe, uGreater, uGreaterOrEqual, uLess, uLessOrEqual, uMax, uMin, unsignedShortToInt, unsignedShortToLong, valuesToStringMethods inherited from class io.deephaven.engine.rowset.impl.RefCountedCow
acquire, canWrite, cowRef, getWriteRef, notifyAfterRelease, notifyBeforeAcquire, refCount, releaseMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.rowset.impl.OrderedLongSet
ixInsert, ixRemove, ixValidate
-
Constructor Details
-
RspBitmap
public RspBitmap() -
RspBitmap
public RspBitmap(long start, long end) -
RspBitmap
-
RspBitmap
-
-
Method Details
-
makeEmpty
-
makeSingleRange
-
makeSingle
-
make
-
make
-
self
Description copied from class:RefCountedCowDerived classes should implement self() by simply "return this" of the right type. This method exists only as an implementation artifact for a type safe implementation of the curiously recurring generic pattern.- Specified by:
selfin classRefCountedCow<RspBitmap>- Returns:
- this object, with the right, most derived type.
-
deepCopy
Description copied from class:RefCountedCowGet a deep copy of the current object, not shared with anybody. Note this is not thread safe.- Specified by:
deepCopyin classRefCountedCow<RspBitmap>- Returns:
- A full, deep copy of this object with a reference count of 1 (not shared).
-
writeCheck
-
first
public long first() -
last
public long last() -
addValuesUnsafe
-
addValuesUnsafeNoWriteCheck
-
add
-
addUnsafe
-
addUnsafeNoWriteCheck
public void addUnsafeNoWriteCheck(long val) -
appendRangeUnsafeNoWriteCheck
public void appendRangeUnsafeNoWriteCheck(long sHigh, long start, long end) -
appendRange
-
appendRangeUnsafe
-
appendRangeUnsafeNoWriteCheck
public void appendRangeUnsafeNoWriteCheck(long start, long end) -
appendContainerUnsafeNoWriteCheck
-
appendFullBlockSpanUnsafeNoWriteCheck
public void appendFullBlockSpanUnsafeNoWriteCheck(long k, long slen) -
append
-
appendUnsafe
-
appendUnsafeNoWriteCheck
public void appendUnsafeNoWriteCheck(long v) -
containerForLowValueAndRange
-
addRangeExclusiveEnd
-
addRange
-
addRangeUnsafe
-
addRangeUnsafeNoWriteCheck
public void addRangeUnsafeNoWriteCheck(long first, long last) -
addRangeUnsafeNoWriteCheck
public int addRangeUnsafeNoWriteCheck(int fromIdx, long start, long end) -
addRangesUnsafeNoWriteCheck
-
contains
public boolean contains(long val) -
remove
-
removeUnsafe
-
removeUnsafeNoWriteCheck
-
removeUnsafeNoWriteCheck
public void removeUnsafeNoWriteCheck(long val, long blockKey, int i) -
removeRange
-
removeRangeUnsafe
-
or
Return the logical or of two bitmaps as a new bitmap. This is equivalent to the union of the two bitmaps as sets. The arguments won't be modified.- Parameters:
b1- a bitmapb2- a bitmap- Returns:
- b1 or b2 as a new bitmap.
-
orEquals
Add every element on other to this bitmap. -
orEqualsShifted
For every key on other, add (key + shiftAmount) to this bitmap. -
orEqualsUnsafe
Add every element on other to this bitmap. Does not update cardinality cache. Caller must ensure finishMutations() is called before any operation depending on the cardinality cache being up to date are called. -
orEqualsShiftedUnsafe
For every key on other, add (key + shiftAmount) to this bitmap. Note shiftAmount is assumed to be a multiple of BLOCK_SIZE. Does not update cardinality cache. Caller must ensure finishMutations() is called before any operation depending on the cardinality cache being up to date are called. -
appendShiftedUnsafeNoWriteCheck
-
and
Return the logical and of two bitmaps as a new bitmap. This is equivalent to the intersection of the two bitmaps as sets.- Parameters:
b1- a bitmapb2- a bitmap- Returns:
- b1 and b2 as a new bitmap.
-
andEquals
Removes every element from this bitmap that is not in the other bitmap. -
andEqualsUnsafe
-
andNotImpl
Return the logical result of r1 and not r2 as a new RspArray. The arguments won't be modified.- Parameters:
r1- an RspArrayr2- an RspArray- Returns:
- r1 and not r2 as a new RspArray.
-
andNot
Return the logical result of r1 and not r2 as a new bitmap. This is equivalent to removing every element in b2 from b1. The arguments won't be modified.- Parameters:
b1- a bitmapb2- a bitmap- Returns:
- b1 and not b2 as a new bitmap.
-
update
Updates the bitmap by adding and removing the bitmaps given as parameter.- Parameters:
added- Elements to add. Assumed disjoint with removed.removed- Elements to remove. Assumed disjoint with added.
-
updateUnsafe
-
updateUnsafeNoWriteCheck
-
andNotEquals
-
andNotEqualsUnsafe
Remove every element in other from this bitmap. -
applyOffset
Apply an offset to every value in this bitmap, mutating it.- Parameters:
offset- The offset to apply.
-
applyOffsetNoWriteCheck
-
applyOffsetOnNew
Apply an offset to every value in this bitmap, returning a new bitmap (original is not changed).- Parameters:
offset- The offset to apply.
-
applyOffsetImpl
-
subrangeByPos
-
subrangeByPos
-
subrangeByValue
-
subrangeByValue
-
invert
-
hashCode
public int hashCode() -
equals
-
finishMutations
public void finishMutations() -
finishMutationsAndOptimize
public void finishMutationsAndOptimize() -
ixCowRef
- Specified by:
ixCowRefin interfaceOrderedLongSet
-
ixInsert
- Specified by:
ixInsertin interfaceOrderedLongSet
-
ixRelease
public void ixRelease()- Specified by:
ixReleasein interfaceOrderedLongSet
-
ixRefCount
- Specified by:
ixRefCountin interfaceOrderedLongSet
-
ixInsertRange
- Specified by:
ixInsertRangein interfaceOrderedLongSet
-
ixInsertSecondHalf
public final OrderedLongSet ixInsertSecondHalf(LongChunk<OrderedRowKeys> values, int offset, int length) - Specified by:
ixInsertSecondHalfin interfaceOrderedLongSet
-
ixRemoveSecondHalf
public final OrderedLongSet ixRemoveSecondHalf(LongChunk<OrderedRowKeys> values, int offset, int length) - Specified by:
ixRemoveSecondHalfin interfaceOrderedLongSet
-
ixAppendRange
- Specified by:
ixAppendRangein interfaceOrderedLongSet
-
ixRemove
- Specified by:
ixRemovein interfaceOrderedLongSet
-
ixLastKey
public long ixLastKey()- Specified by:
ixLastKeyin interfaceOrderedLongSet
-
ixFirstKey
public long ixFirstKey()- Specified by:
ixFirstKeyin interfaceOrderedLongSet
-
ixGet
public long ixGet(long pos) - Specified by:
ixGetin interfaceOrderedLongSet
-
ixGetKeysForPositions
- Specified by:
ixGetKeysForPositionsin interfaceOrderedLongSet
-
ixFind
public long ixFind(long key) - Specified by:
ixFindin interfaceOrderedLongSet
-
ixCardinality
public long ixCardinality()- Specified by:
ixCardinalityin interfaceOrderedLongSet
-
ixIsEmpty
public boolean ixIsEmpty()- Specified by:
ixIsEmptyin interfaceOrderedLongSet
-
ixInvertOnNew
Description copied from interface:OrderedLongSetInvert the given OrderedLongSet.- Specified by:
ixInvertOnNewin interfaceOrderedLongSet- Parameters:
keys- OrderedLongSet of keys to invertmaximumPosition- the largest position to add to indexBuilder, inclusive- Returns:
- the inverse of
keys
-
ixForEachLong
- Specified by:
ixForEachLongin interfaceOrderedLongSet
-
ixForEachLongRange
- Specified by:
ixForEachLongRangein interfaceOrderedLongSet
-
ixSubindexByPosOnNew
- Specified by:
ixSubindexByPosOnNewin interfaceOrderedLongSet
-
ixSubindexByKeyOnNew
- Specified by:
ixSubindexByKeyOnNewin interfaceOrderedLongSet
-
ixUpdate
- Specified by:
ixUpdatein interfaceOrderedLongSet
-
ixUpdateNoWriteCheck
-
ixInsert
- Specified by:
ixInsertin interfaceOrderedLongSet
-
ixInsertNoWriteCheck
-
insertOrderedLongSetUnsafeNoWriteCheck
-
insertOrderedLongSetUnsafeNoWriteCheck
-
insertOrderedLongSetUnsafeNoWriteCheck
-
ixRemove
- Specified by:
ixRemovein interfaceOrderedLongSet
-
ixRemoveNoWriteCheck
-
ixRetain
- Specified by:
ixRetainin interfaceOrderedLongSet
-
ixRetainNoWriteCheck
-
ixRetainRange
- Specified by:
ixRetainRangein interfaceOrderedLongSet
-
ixRetainRangeNoWriteCheck
-
ixRemoveRange
- Specified by:
ixRemoveRangein interfaceOrderedLongSet
-
ixIntersectOnNew
- Specified by:
ixIntersectOnNewin interfaceOrderedLongSet
-
ixContainsRange
public boolean ixContainsRange(long start, long end) - Specified by:
ixContainsRangein interfaceOrderedLongSet
-
ixOverlaps
- Specified by:
ixOverlapsin interfaceOrderedLongSet
-
ixOverlapsRange
public boolean ixOverlapsRange(long start, long end) - Specified by:
ixOverlapsRangein interfaceOrderedLongSet
-
subsetOf
-
ixSubsetOf
- Specified by:
ixSubsetOfin interfaceOrderedLongSet
-
ixMinusOnNew
- Specified by:
ixMinusOnNewin interfaceOrderedLongSet
-
ixUnionOnNew
- Specified by:
ixUnionOnNewin interfaceOrderedLongSet
-
ixShiftOnNew
- Specified by:
ixShiftOnNewin interfaceOrderedLongSet
-
ixShiftInPlace
- Specified by:
ixShiftInPlacein interfaceOrderedLongSet
-
ixInsertWithShift
-
ixInsertWithShift
- Specified by:
ixInsertWithShiftin interfaceOrderedLongSet
-
ixSearchIterator
- Specified by:
ixSearchIteratorin interfaceOrderedLongSet
-
ixIterator
- Specified by:
ixIteratorin interfaceOrderedLongSet
-
ixReverseIterator
- Specified by:
ixReverseIteratorin interfaceOrderedLongSet
-
ixRangeIterator
- Specified by:
ixRangeIteratorin interfaceOrderedLongSet
-
ixCompact
- Specified by:
ixCompactin interfaceOrderedLongSet
-
ixValidate
- Specified by:
ixValidatein interfaceOrderedLongSet
-
ixGetRowSequenceByPosition
- Specified by:
ixGetRowSequenceByPositionin interfaceOrderedLongSet
-
ixGetRowSequenceByKeyRange
- Specified by:
ixGetRowSequenceByKeyRangein interfaceOrderedLongSet
-
ixGetRowSequenceIterator
- Specified by:
ixGetRowSequenceIteratorin interfaceOrderedLongSet
-
ixRangesCountUpperBound
public long ixRangesCountUpperBound()- Specified by:
ixRangesCountUpperBoundin interfaceOrderedLongSet
-
ixGetAverageRunLengthEstimate
public long ixGetAverageRunLengthEstimate()- Specified by:
ixGetAverageRunLengthEstimatein interfaceOrderedLongSet
-
ixToRspOnNew
- Specified by:
ixToRspOnNewin interfaceOrderedLongSet
-
toString
-