Class PinotDataBitSet

    • Constructor Detail

    • Method Detail

      • getNumBitsPerValue

        public static int getNumBitsPerValue​(int maxValue)
        Returns the number of bits required to encode the value.

        NOTE: Use at least one bit even there is only one possible value

        Examples: (maximum value (binary format) -> number of bits)

        • 0(0) -> 1
        • 1(1) -> 1
        • 2(10) -> 2
        • 9(1001) -> 4
        • 113(1110001) -> 7
        Parameters:
        maxValue - Maximum possible value
        Returns:
        Number of bits required to encode the value
      • readInt

        public int readInt​(int index,
                           int numBitsPerValue)
      • readInt

        public void readInt​(int startIndex,
                            int numBitsPerValue,
                            int length,
                            int[] buffer)
      • writeInt

        public void writeInt​(int index,
                             int numBitsPerValue,
                             int value)
      • writeInt

        public void writeInt​(int startIndex,
                             int numBitsPerValue,
                             int length,
                             int[] values)
      • setBit

        public void setBit​(int bitOffset)
      • unsetBit

        public void unsetBit​(int bitOffset)
      • getNextSetBitOffset

        public int getNextSetBitOffset​(int bitOffset)
      • getNextNthSetBitOffsetAndRecordRanges

        public int getNextNthSetBitOffsetAndRecordRanges​(int bitOffset,
                                                         int n,
                                                         long baseOffset,
                                                         List<ForwardIndexReader.ByteRange> ranges)
      • getNextNthSetBitOffset

        public int getNextNthSetBitOffset​(int bitOffset,
                                          int n)