Package com.illumon.iris.db.v2.utils.rsp
Class RspBitmap
- All Implemented Interfaces:
TreeIndexImpl
- Direct Known Subclasses:
DisposableRspBitmap
public class RspBitmap extends RspArray<RspBitmap> implements TreeIndexImpl
See header comment on RspArray for explanation on space partitioning.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRspBitmap.RandomBuilderNested classes/interfaces inherited from class com.illumon.iris.db.v2.utils.rsp.RspArray
RspArray.ArraysBuf, RspArray.SpanCursor, RspArray.SpanCursorForward, RspArray.SpanViewNested classes/interfaces inherited from interface com.illumon.iris.db.v2.utils.TreeIndexImpl
TreeIndexImpl.SequentialBuilder -
Field Summary
Fields inherited from class com.illumon.iris.db.v2.utils.rsp.RspArray
BITS_PER_BLOCK, BLOCK_LAST, BLOCK_SIZE, debug, FULL_BLOCK_SPAN_MARKER, spanInfos, spans, workDataPerThread -
Constructor Summary
-
Method Summary
Methods inherited from class com.illumon.iris.db.v2.utils.rsp.RspArray
andEqualsUnsafeNoWriteCheck, andNotEqualsUnsafeNoWriteCheck, appendContainer, appendFullBlockSpan, appendSharedContainer, appendSharedContainerMaybePacked, appendSingletonSpan, applyKeyOffset, applyKeyOffset, asOrderedKeys, binarySearchKeys, collectRemovedIndicesIfAny, containerOverhead, containsRange, copyKeyAndSpanMaybeSharing, copyKeyAndSpanMaybeSharing, copyKeyAndSpanStealingContainers, distanceInBlocks, divBlockSize, ensureSizeCanGrowBy, find, firstValue, firstValueAtIndex, forEachLong, forEachLongRange, forEachLongRangeInSpanWithOffsetAndMaxCardinality, get, getAverageRunLengthEstimate, getAverageRunLengthEstimate, getCardinality, getFullBlockSpanLen, getIterator, getKey, getKeysForPositions, getOrderedKeysByKeyRange, getOrderedKeysByPosition, getOrderedKeysIterator, getPackedInfoLowBits, getRangeBatchIterator, getRangeIterator, getReverseIterator, 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 com.illumon.iris.db.v2.utils.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 com.illumon.iris.db.v2.utils.TreeIndexImpl
ixInsert, ixRemove, ixValidate
-
Constructor Details
-
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
public RspBitmap addValuesUnsafe(LongChunk<Attributes.OrderedKeyIndices> values, int offset, int length) -
addValuesUnsafeNoWriteCheck
public void addValuesUnsafeNoWriteCheck(LongChunk<Attributes.OrderedKeyIndices> values, int offset, int length) -
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 interfaceTreeIndexImpl
-
ixInsert
- Specified by:
ixInsertin interfaceTreeIndexImpl
-
ixRelease
public void ixRelease()- Specified by:
ixReleasein interfaceTreeIndexImpl
-
ixRefCount
- Specified by:
ixRefCountin interfaceTreeIndexImpl
-
ixInsertRange
- Specified by:
ixInsertRangein interfaceTreeIndexImpl
-
ixInsertSecondHalf
public final TreeIndexImpl ixInsertSecondHalf(LongChunk<Attributes.OrderedKeyIndices> values, int offset, int length)- Specified by:
ixInsertSecondHalfin interfaceTreeIndexImpl
-
ixRemoveSecondHalf
public final TreeIndexImpl ixRemoveSecondHalf(LongChunk<Attributes.OrderedKeyIndices> values, int offset, int length)- Specified by:
ixRemoveSecondHalfin interfaceTreeIndexImpl
-
ixAppendRange
- Specified by:
ixAppendRangein interfaceTreeIndexImpl
-
ixRemove
- Specified by:
ixRemovein interfaceTreeIndexImpl
-
ixLastKey
public long ixLastKey()- Specified by:
ixLastKeyin interfaceTreeIndexImpl
-
ixFirstKey
public long ixFirstKey()- Specified by:
ixFirstKeyin interfaceTreeIndexImpl
-
ixGet
public long ixGet(long pos)- Specified by:
ixGetin interfaceTreeIndexImpl
-
ixGetKeysForPositions
public void ixGetKeysForPositions(PrimitiveIterator.OfLong inputPositions, LongConsumer outputKeys)- Specified by:
ixGetKeysForPositionsin interfaceTreeIndexImpl
-
ixFind
public long ixFind(long key)- Specified by:
ixFindin interfaceTreeIndexImpl
-
ixCardinality
public long ixCardinality()- Specified by:
ixCardinalityin interfaceTreeIndexImpl
-
ixIsEmpty
public boolean ixIsEmpty()- Specified by:
ixIsEmptyin interfaceTreeIndexImpl
-
ixInvertOnNew
Description copied from interface:TreeIndexImplInvert the given index.- Specified by:
ixInvertOnNewin interfaceTreeIndexImpl- Parameters:
keys- Index of keys to invertmaximumPosition- the largest position to add to indexBuilder, inclusive- Returns:
- the inverse of index
-
ixForEachLong
- Specified by:
ixForEachLongin interfaceTreeIndexImpl
-
ixForEachLongRange
- Specified by:
ixForEachLongRangein interfaceTreeIndexImpl
-
ixSubindexByPosOnNew
- Specified by:
ixSubindexByPosOnNewin interfaceTreeIndexImpl
-
ixSubindexByKeyOnNew
- Specified by:
ixSubindexByKeyOnNewin interfaceTreeIndexImpl
-
ixUpdate
- Specified by:
ixUpdatein interfaceTreeIndexImpl
-
ixUpdateNoWriteCheck
-
ixInsert
- Specified by:
ixInsertin interfaceTreeIndexImpl
-
ixInsertNoWriteCheck
-
insertTreeIndexUnsafeNoWriteCheck
-
insertTreeIndexUnsafeNoWriteCheck
-
insertTreeIndexUnsafeNoWriteCheck
-
ixRemove
- Specified by:
ixRemovein interfaceTreeIndexImpl
-
ixRemoveNoWriteCheck
-
ixRetain
- Specified by:
ixRetainin interfaceTreeIndexImpl
-
ixRetainNoWriteCheck
-
ixRetainRange
- Specified by:
ixRetainRangein interfaceTreeIndexImpl
-
ixRetainRangeNoWriteCheck
-
ixRemoveRange
- Specified by:
ixRemoveRangein interfaceTreeIndexImpl
-
ixIntersectOnNew
- Specified by:
ixIntersectOnNewin interfaceTreeIndexImpl
-
ixContainsRange
public boolean ixContainsRange(long start, long end)- Specified by:
ixContainsRangein interfaceTreeIndexImpl
-
ixOverlaps
- Specified by:
ixOverlapsin interfaceTreeIndexImpl
-
ixOverlapsRange
public boolean ixOverlapsRange(long start, long end)- Specified by:
ixOverlapsRangein interfaceTreeIndexImpl
-
subsetOf
-
ixSubsetOf
- Specified by:
ixSubsetOfin interfaceTreeIndexImpl
-
ixMinusOnNew
- Specified by:
ixMinusOnNewin interfaceTreeIndexImpl
-
ixUnionOnNew
- Specified by:
ixUnionOnNewin interfaceTreeIndexImpl
-
ixShiftOnNew
- Specified by:
ixShiftOnNewin interfaceTreeIndexImpl
-
ixShiftInPlace
- Specified by:
ixShiftInPlacein interfaceTreeIndexImpl
-
ixInsertWithShift
-
ixInsertWithShift
- Specified by:
ixInsertWithShiftin interfaceTreeIndexImpl
-
ixSearchIterator
- Specified by:
ixSearchIteratorin interfaceTreeIndexImpl
-
ixIterator
- Specified by:
ixIteratorin interfaceTreeIndexImpl
-
ixReverseIterator
- Specified by:
ixReverseIteratorin interfaceTreeIndexImpl
-
ixRangeIterator
- Specified by:
ixRangeIteratorin interfaceTreeIndexImpl
-
ixCompact
- Specified by:
ixCompactin interfaceTreeIndexImpl
-
ixValidate
- Specified by:
ixValidatein interfaceTreeIndexImpl
-
ixGetOrderedKeysByPosition
- Specified by:
ixGetOrderedKeysByPositionin interfaceTreeIndexImpl
-
ixGetOrderedKeysByKeyRange
- Specified by:
ixGetOrderedKeysByKeyRangein interfaceTreeIndexImpl
-
ixGetOrderedKeysIterator
- Specified by:
ixGetOrderedKeysIteratorin interfaceTreeIndexImpl
-
ixRangesCountUpperBound
public long ixRangesCountUpperBound()- Specified by:
ixRangesCountUpperBoundin interfaceTreeIndexImpl
-
ixGetAverageRunLengthEstimate
public long ixGetAverageRunLengthEstimate()- Specified by:
ixGetAverageRunLengthEstimatein interfaceTreeIndexImpl
-
ixToRspOnNew
- Specified by:
ixToRspOnNewin interfaceTreeIndexImpl
-
toString
-