yashmayya commented on code in PR #16872:
URL: https://github.com/apache/pinot/pull/16872#discussion_r2373058072


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/ReceivingMailbox.java:
##########
@@ -134,6 +125,28 @@ public ReceivingMailboxStatus offerRaw(List<ByteBuffer> 
byteBuffers, long timeou
     return offerPrivate(block, dataBlock.getStatsByStage(), timeoutMs);
   }
 
+  private DataBlock deserialize(List<ByteBuffer> byteBuffers)
+      throws IOException {
+    long startTimeMs = System.currentTimeMillis();
+    int totalBytes;
+    DataBlock dataBlock;
+    if (byteBuffers.size() == 1) {
+      ByteBuffer byteBuffer = byteBuffers.get(0);
+      totalBytes = byteBuffer.remaining();
+      dataBlock = DataBlockUtils.readFrom(byteBuffer);
+    } else {
+      totalBytes = 0;
+      for (ByteBuffer bb : byteBuffers) {
+        totalBytes += bb.remaining();
+      }
+      dataBlock = DataBlockUtils.deserialize(byteBuffers);
+    }

Review Comment:
   I think it might be better to move this optimization into the 
`DataBlockUtils.deserialize` method itself?



-- 
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