Package org.roaringbitmap.bsi.buffer
Class ImmutableBitSliceIndex
- java.lang.Object
-
- org.roaringbitmap.bsi.buffer.BitSliceIndexBase
-
- org.roaringbitmap.bsi.buffer.ImmutableBitSliceIndex
-
- All Implemented Interfaces:
BitmapSliceIndex
public class ImmutableBitSliceIndex extends BitSliceIndexBase implements BitmapSliceIndex
ImmutableBSI
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.roaringbitmap.bsi.BitmapSliceIndex
BitmapSliceIndex.Operation
-
-
Field Summary
-
Fields inherited from class org.roaringbitmap.bsi.buffer.BitSliceIndexBase
bA, ebM, maxValue, minValue
-
-
Constructor Summary
Constructors Constructor Description ImmutableBitSliceIndex()ImmutableBitSliceIndex(int maxValue, int minValue, org.roaringbitmap.buffer.ImmutableRoaringBitmap[] bA, org.roaringbitmap.buffer.ImmutableRoaringBitmap ebM)constructs a BSI use slice and ebM notes: the max size of BSI might be: 33 * 120MB( 1 Billion cardinality) = 3960MB which might lead to OOM.ImmutableBitSliceIndex(java.nio.ByteBuffer buffer)constructs a BSI from byteBuffer notes: the max size of BSI might be: 33 * 120MB( 1 Billion cardinality) = 3960MB which might lead to OOM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(BitmapSliceIndex otherBitmapSliceIndex)voidaddDigit(org.roaringbitmap.buffer.ImmutableRoaringBitmap foundSet, int i)ImmutableBitSliceIndexclone()org.roaringbitmap.buffer.ImmutableRoaringBitmapgetExistenceBitmap()voidmerge(BitmapSliceIndex otherBitmapSliceIndex)voidserialize(java.io.DataOutput output)voidserialize(java.nio.ByteBuffer buffer)intserializedSizeInBytes()voidsetValue(int cid, int value)set value for bsi, setValue will set each bit slice according to the input value given that we have bsi as follow ebm: RB[1 1 1 1] slice0: RB[0 1 0 1] - slice1: RB[1 0 1 0] | slice2: RB[1 0 0 1] |--bA:bit slice Array slice3: RB[0 0 0 1] - 1 2 3 4 | ---------------- columnId or rowId for columnId 1, the value is 110 that is :6 for columnId 2, the value is 1 that is :1 for columnId 3, the value is 10 that is :2 for columnId 4, the value is 1101 that is :11voidsetValues(java.util.List<Pair<java.lang.Integer,java.lang.Integer>> values, java.lang.Integer currentMaxValue, java.lang.Integer currentMinValue)setValues will batch set value for this bsi.MutableBitSliceIndextoMutableBitSliceIndex()-
Methods inherited from class org.roaringbitmap.bsi.buffer.BitSliceIndexBase
allOf, batchIn, bitCount, compare, getLongCardinality, getValue, invokeAsync, parallelExec, parallelIn, parallelMR, parallelTransposeWithCount, range, rangeEQ, rangeGE, rangeGT, rangeLE, rangeLT, rangeNEQ, sum, toPairList, toPairList, topK, transposeWithCount, valueExist
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.roaringbitmap.bsi.BitmapSliceIndex
bitCount, getLongCardinality, getValue
-
-
-
-
Constructor Detail
-
ImmutableBitSliceIndex
public ImmutableBitSliceIndex(int maxValue, int minValue, org.roaringbitmap.buffer.ImmutableRoaringBitmap[] bA, org.roaringbitmap.buffer.ImmutableRoaringBitmap ebM)constructs a BSI use slice and ebM notes: the max size of BSI might be: 33 * 120MB( 1 Billion cardinality) = 3960MB which might lead to OOM. so don't use this function if you have no idea of the mechanism you'd better split your data and make every shard suitable for memory.- Parameters:
bA-ebM-maxValue-minValue-
-
ImmutableBitSliceIndex
public ImmutableBitSliceIndex()
-
ImmutableBitSliceIndex
public ImmutableBitSliceIndex(java.nio.ByteBuffer buffer) throws java.io.IOExceptionconstructs a BSI from byteBuffer notes: the max size of BSI might be: 33 * 120MB( 1 Billion cardinality) = 3960MB which might lead to OOM. so don't use this function if you have no idea of the mechanism you'd better split your data and make every shard suitable for memory.- Parameters:
buffer-- Throws:
java.io.IOException
-
-
Method Detail
-
addDigit
public void addDigit(org.roaringbitmap.buffer.ImmutableRoaringBitmap foundSet, int i)
-
getExistenceBitmap
public org.roaringbitmap.buffer.ImmutableRoaringBitmap getExistenceBitmap()
-
setValue
public void setValue(int cid, int value)Description copied from interface:BitmapSliceIndexset value for bsi, setValue will set each bit slice according to the input value given that we have bsi as follow ebm: RB[1 1 1 1] slice0: RB[0 1 0 1] - slice1: RB[1 0 1 0] | slice2: RB[1 0 0 1] |--bA:bit slice Array slice3: RB[0 0 0 1] - 1 2 3 4 | ---------------- columnId or rowId for columnId 1, the value is 110 that is :6 for columnId 2, the value is 1 that is :1 for columnId 3, the value is 10 that is :2 for columnId 4, the value is 1101 that is :11- Specified by:
setValuein interfaceBitmapSliceIndex- Parameters:
cid- columnId or rowIdvalue- value for this columnId or rowId
-
setValues
public void setValues(java.util.List<Pair<java.lang.Integer,java.lang.Integer>> values, java.lang.Integer currentMaxValue, java.lang.Integer currentMinValue)
Description copied from interface:BitmapSliceIndexsetValues will batch set value for this bsi. currentMaxValue/currentMinValue are optional,it's can be compute from input value list. and avoiding bsi expend slice array capacity.- Specified by:
setValuesin interfaceBitmapSliceIndex
-
add
public void add(BitmapSliceIndex otherBitmapSliceIndex)
-
merge
public void merge(BitmapSliceIndex otherBitmapSliceIndex)
-
serialize
public void serialize(java.nio.ByteBuffer buffer)
- Specified by:
serializein interfaceBitmapSliceIndex
-
serialize
public void serialize(java.io.DataOutput output) throws java.io.IOException- Specified by:
serializein interfaceBitmapSliceIndex- Throws:
java.io.IOException
-
serializedSizeInBytes
public int serializedSizeInBytes()
- Specified by:
serializedSizeInBytesin interfaceBitmapSliceIndex
-
toMutableBitSliceIndex
public MutableBitSliceIndex toMutableBitSliceIndex()
-
clone
public ImmutableBitSliceIndex clone()
- Overrides:
clonein classjava.lang.Object
-
-