Class BaseImmutableDictionary

    • Constructor Detail

      • BaseImmutableDictionary

        protected BaseImmutableDictionary​(PinotDataBuffer dataBuffer,
                                          int length,
                                          int numBytesPerValue,
                                          byte paddingByte)
      • BaseImmutableDictionary

        protected BaseImmutableDictionary​(int length)
        For virtual dictionary.
    • Method Detail

      • normalizeIndex

        protected final int normalizeIndex​(int index)
      • getDictIdsInRange

        public it.unimi.dsi.fastutil.ints.IntSet getDictIdsInRange​(String lower,
                                                                   String upper,
                                                                   boolean includeLower,
                                                                   boolean includeUpper)
        Specified by:
        getDictIdsInRange in interface Dictionary
      • compare

        public int compare​(int dictId1,
                           int dictId2)
        Specified by:
        compare in interface Dictionary
      • binarySearch

        protected int binarySearch​(int value)
      • binarySearch

        protected int binarySearch​(long value)
      • binarySearch

        protected int binarySearch​(float value)
      • binarySearch

        protected int binarySearch​(double value)
      • binarySearch

        protected int binarySearch​(BigDecimal value)
      • binarySearch

        protected int binarySearch​(String value)
        WARNING: With non-zero padding byte, binary search result might not reflect the real insertion index for the value. E.g. with padding byte 'b', if unpadded value "aa" is in the dictionary, and stored as "aab", then unpadded value "a" will be mis-positioned after value "aa"; unpadded value "aab" will return positive value even if value "aab" is not in the dictionary. TODO: Clean up the segments with legacy non-zero padding byte, and remove the support for non-zero padding byte
      • binarySearch

        protected int binarySearch​(byte[] value)
      • getInt

        protected int getInt​(int dictId)
      • getLong

        protected long getLong​(int dictId)
      • getFloat

        protected float getFloat​(int dictId)
      • getDouble

        protected double getDouble​(int dictId)
      • getBigDecimal

        protected BigDecimal getBigDecimal​(int dictId)
      • getUnpaddedString

        protected String getUnpaddedString​(int dictId,
                                           byte[] buffer)
      • getPaddedString

        protected String getPaddedString​(int dictId,
                                         byte[] buffer)
      • getBytes

        protected byte[] getBytes​(int dictId)
      • getBuffer

        protected byte[] getBuffer()