Package org.roaringbitmap.bsi.buffer
Class MutableBitSliceIndex
- java.lang.Object
-
- org.roaringbitmap.bsi.buffer.BitSliceIndexBase
-
- org.roaringbitmap.bsi.buffer.MutableBitSliceIndex
-
- All Implemented Interfaces:
BitmapSliceIndex
public class MutableBitSliceIndex extends BitSliceIndexBase implements BitmapSliceIndex
MutableBSI
-
-
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 MutableBitSliceIndex()constructs an auto-sized BSIMutableBitSliceIndex(int minValue, int maxValue)construct a new MutableBitSliceIndex.MutableBitSliceIndex(int maxValue, int minValue, org.roaringbitmap.buffer.MutableRoaringBitmap[] bA, org.roaringbitmap.buffer.MutableRoaringBitmap ebM)construct a new ImmutableBitSliceIndex from raw slice
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(MutableBitSliceIndex otherBsi)add tow bsi indexvoidaddDigit(org.roaringbitmap.buffer.MutableRoaringBitmap foundSet, int i)MutableBitSliceIndexclone()voiddeserialize(java.io.DataInput in)voiddeserialize(java.nio.ByteBuffer buffer)org.roaringbitmap.buffer.MutableRoaringBitmapgetExistenceBitmap()org.roaringbitmap.buffer.MutableRoaringBitmapgetMutableSlice(int i)booleanhasRunCompression()voidmerge(MutableBitSliceIndex otherBsi)merge will merge 2 bsi into current merge API was designed for distributed computing NOTE: current and other bsi have no intersectionvoidrunOptimize()RunOptimize attempts to further compress the runs of consecutive values found in the bitmapvoidserialize(java.io.DataOutput output)voidserialize(java.nio.ByteBuffer buffer)intserializedSizeInBytes()voidsetValue(int columnId, int value)SetValue sets a value for a given columnID.voidsetValues(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.ImmutableBitSliceIndextoImmutableBitSliceIndex()-
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
-
MutableBitSliceIndex
public MutableBitSliceIndex(int maxValue, int minValue, org.roaringbitmap.buffer.MutableRoaringBitmap[] bA, org.roaringbitmap.buffer.MutableRoaringBitmap ebM)construct a new ImmutableBitSliceIndex from raw slice- Parameters:
maxValue- max value for this bsiminValue- min value for this bsibA- bit slices for this bsi.using MutableRoaringBitmap array expressebM- exits value bitmap,use MutableRoaringBitmap express
-
MutableBitSliceIndex
public MutableBitSliceIndex(int minValue, int maxValue)construct a new MutableBitSliceIndex. Min/Max values are optional. If set to 0 then the underlying BSI will be automatically sized.
-
MutableBitSliceIndex
public MutableBitSliceIndex()
constructs an auto-sized BSI
-
-
Method Detail
-
runOptimize
public void runOptimize()
RunOptimize attempts to further compress the runs of consecutive values found in the bitmap
-
hasRunCompression
public boolean hasRunCompression()
-
addDigit
public void addDigit(org.roaringbitmap.buffer.MutableRoaringBitmap foundSet, int i)
-
getExistenceBitmap
public org.roaringbitmap.buffer.MutableRoaringBitmap getExistenceBitmap()
-
getMutableSlice
public org.roaringbitmap.buffer.MutableRoaringBitmap getMutableSlice(int i)
-
setValue
public void setValue(int columnId, int value)SetValue sets a value for a given columnID.- Specified by:
setValuein interfaceBitmapSliceIndex- Parameters:
columnId- columnIDvalue- the value for columnID
-
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(MutableBitSliceIndex otherBsi)
add tow bsi index
-
merge
public void merge(MutableBitSliceIndex otherBsi)
merge will merge 2 bsi into current merge API was designed for distributed computing NOTE: current and other bsi have no intersection
-
clone
public MutableBitSliceIndex clone()
- Overrides:
clonein classjava.lang.Object
-
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
-
deserialize
public void deserialize(java.nio.ByteBuffer buffer) throws java.io.IOException- Throws:
java.io.IOException
-
deserialize
public void deserialize(java.io.DataInput in) throws java.io.IOException- Throws:
java.io.IOException
-
serializedSizeInBytes
public int serializedSizeInBytes()
- Specified by:
serializedSizeInBytesin interfaceBitmapSliceIndex
-
toImmutableBitSliceIndex
public ImmutableBitSliceIndex toImmutableBitSliceIndex()
-
-