Class PinotDataBitSetV2
- java.lang.Object
-
- org.apache.pinot.segment.local.io.util.PinotDataBitSetV2
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
PinotDataBitSetV2.Bit16Encoded,PinotDataBitSetV2.Bit1Encoded,PinotDataBitSetV2.Bit2Encoded,PinotDataBitSetV2.Bit4Encoded,PinotDataBitSetV2.Bit8Encoded,PinotDataBitSetV2.RawInt
public abstract class PinotDataBitSetV2 extends Object implements Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPinotDataBitSetV2.Bit16Encodedstatic classPinotDataBitSetV2.Bit1Encodedstatic classPinotDataBitSetV2.Bit2Encodedstatic classPinotDataBitSetV2.Bit4Encodedstatic classPinotDataBitSetV2.Bit8Encodedstatic classPinotDataBitSetV2.RawInt
-
Field Summary
Fields Modifier and Type Field Description protected PinotDataBuffer_dataBufferprotected int_numBitsPerValuestatic intMAX_DOC_PER_CALL
-
Constructor Summary
Constructors Constructor Description PinotDataBitSetV2()
-
Method Summary
Modifier and Type Method Description voidclose()static PinotDataBitSetV2createBitSet(PinotDataBuffer pinotDataBuffer, int numBitsPerValue)voidreadInt(int[] docIds, int docIdsStartIndex, int length, int[] out, int outpos)Decode integers for an array of indexes which is not necessarily contiguous.abstract intreadInt(long index)Decode integers starting at a given index.abstract voidreadInt(long startIndex, int length, int[] out)Decode integers for a contiguous range of indexes represented by startIndex and length.protected voidwriteInt(int index, int value)voidwriteInt(int startIndex, int length, int[] values)
-
-
-
Field Detail
-
MAX_DOC_PER_CALL
public static final int MAX_DOC_PER_CALL
- See Also:
- Constant Field Values
-
_dataBuffer
protected PinotDataBuffer _dataBuffer
-
_numBitsPerValue
protected int _numBitsPerValue
-
-
Method Detail
-
readInt
public abstract int readInt(long index)
Decode integers starting at a given index. This is efficient because of simplified bitmath.- Parameters:
index- docId- Returns:
- unpacked integer
-
readInt
public abstract void readInt(long startIndex, int length, int[] out)Decode integers for a contiguous range of indexes represented by startIndex and length. This uses vectorization as much as possible for all the aligned reads and also takes care of the small byte-sized window of unaligned read.- Parameters:
startIndex- start docIdlength- lengthout- out array to store the unpacked integers
-
readInt
public void readInt(int[] docIds, int docIdsStartIndex, int length, int[] out, int outpos)Decode integers for an array of indexes which is not necessarily contiguous. So there could be gaps in the array: e.g: [1, 3, 7, 9, 11, 12] The actual read is done by the previous API since that is efficient as it exploits contiguity and uses vectorization. However, since the out[] array has to be correctly populated with the unpacked integer for each index, a post-processing step is needed after the bulk contiguous read to correctly set the unpacked integer into the out array throwing away the unnecessary values decoded as part of contiguous read- Parameters:
docIds- index arraydocIdsStartIndex- starting index in the docIds arraylength- length to read (number of docIds to read in the array)out- out array to store the decoded integersoutpos- starting index in the out array
-
createBitSet
public static PinotDataBitSetV2 createBitSet(PinotDataBuffer pinotDataBuffer, int numBitsPerValue)
-
writeInt
protected void writeInt(int index, int value)
-
writeInt
public void writeInt(int startIndex, int length, int[] values)
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-