gortiz commented on code in PR #11729:
URL: https://github.com/apache/pinot/pull/11729#discussion_r1348534266


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/ForwardIndexReader.java:
##########
@@ -916,4 +916,83 @@ default byte[][] getBytesMV(int docId, T context) {
   default int getNumValuesMV(int docId, T context) {
     throw new UnsupportedOperationException();
   }
+
+  class ValueRange {
+    private final long _offset;
+    private final int _size;
+    // To tell if size uses bit or byte as unit, for fwd index reader reading 
values of fixed bits.
+    private final boolean _isSizeOfBit;
+
+    public static ValueRange newByteRange(long offset, int sizeInBytes) {
+      return new ValueRange(offset, sizeInBytes, false);
+    }
+
+    public static ValueRange newBitRange(long offset, int sizeInBits) {
+      return new ValueRange(offset, sizeInBits, true);
+    }
+
+    private ValueRange(long offset, int size, boolean isSizeOfBit) {
+      _offset = offset;
+      _size = size;
+      _isSizeOfBit = isSizeOfBit;
+    }
+
+    public long getOffset() {
+      return _offset;
+    }
+
+    public int getSize() {
+      return _size;
+    }
+
+    public boolean isSizeOfBit() {
+      return _isSizeOfBit;
+    }
+
+    @Override
+    public String toString() {
+      return "Range{" + "_offset=" + _offset + ", _size=" + _size + ", 
_isSizeOfBit=" + _isSizeOfBit + '}';
+    }
+  }
+
+  /**
+   * An interface that enables the caller to get byte ranges accessed while 
reading a given docId.
+   * This can be used to eventually allow prefetching of exact byte ranges 
during query processing,
+   * if the docIds to be fetched are known beforehand.
+   *
+   * This interface will be implemented by all the forward index readers.
+   */
+  interface ValueRangeProvider<T extends ForwardIndexReaderContext> {

Review Comment:
   It makes sense. Consider it resolved



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to