Jackie-Jiang commented on code in PR #11046:
URL: https://github.com/apache/pinot/pull/11046#discussion_r1259342992


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/nativefst/NativeFSTIndexReader.java:
##########
@@ -48,8 +51,19 @@ public class NativeFSTIndexReader implements TextIndexReader 
{
   public NativeFSTIndexReader(PinotDataBuffer dataBuffer)
       throws IOException {
     // TODO: Implement an InputStream directly on PinotDataBuffer
-    ByteBuffer byteBuffer = dataBuffer.toDirectByteBuffer(0, (int) 
dataBuffer.size());
-    _fst = FST.read(new 
ByteBufferInputStream(Collections.singletonList(byteBuffer)), 
ImmutableFST.class, true);
+    /*ByteBuffer byteBuffer = dataBuffer.toDirectByteBuffer(0, (int) 
dataBuffer.size());

Review Comment:
   We already have `PinotDataBuffer` here, so we should not create an input 
stream from it, but directly using it to read data. For immutable index, 
reading from stream is very inefficient because it requires us to copy the data



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to