walterddr commented on code in PR #10190:
URL: https://github.com/apache/pinot/pull/10190#discussion_r1094866345


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/exchange/BlockExchange.java:
##########
@@ -63,52 +66,33 @@ public static BlockExchange 
getExchange(MailboxService<TransferableBlock> mailbo
     }
   }
 
-  protected BlockExchange(MailboxService<TransferableBlock> mailbox, 
List<MailboxIdentifier> destinations,
-      BlockSplitter splitter) {
-    _mailbox = mailbox;
-    _destinations = destinations;
+  protected BlockExchange(List<SendingMailbox> sendingMailboxes, BlockSplitter 
splitter) {
+    _sendingMailboxes = sendingMailboxes;
     _splitter = splitter;
   }
 
   public void send(TransferableBlock block) {
     if (block.isEndOfStreamBlock()) {
-      _destinations.forEach(destination -> sendBlock(destination, block));
+      _sendingMailboxes.forEach(destination -> sendBlock(destination, block));
       return;
     }
-
-    Iterator<RoutedBlock> routedBlocks = route(_destinations, block);
-    while (routedBlocks.hasNext()) {
-      RoutedBlock next = routedBlocks.next();
-      sendBlock(next._destination, next._block);
-    }
+    route(_sendingMailboxes, block);
   }
 
-  private void sendBlock(MailboxIdentifier mailboxId, TransferableBlock block) 
{
-    SendingMailbox<TransferableBlock> sendingMailbox = 
_mailbox.getSendingMailbox(mailboxId);
-
+  protected void sendBlock(SendingMailbox sendingMailbox, TransferableBlock 
block) {
     if (block.isEndOfStreamBlock()) {
       sendingMailbox.send(block);
       sendingMailbox.complete();
       return;
     }
 
     DataBlock.Type type = block.getType();
+    // TODO: Move splitter into mailbox service.

Review Comment:
   why do we need to move splitter into mailbox service? did you mean mailbox 
operator?



##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/exchange/BlockExchange.java:
##########
@@ -38,23 +39,25 @@ public abstract class BlockExchange {
   // TODO: Deduct this value via grpc config maximum byte size; and make it 
configurable with override.
   // TODO: Max block size is a soft limit. only counts fixedSize datatable 
byte buffer
   private static final int MAX_MAILBOX_CONTENT_SIZE_BYTES = 4 * 1024 * 1024;
-
-  private final MailboxService<TransferableBlock> _mailbox;
-  private final List<MailboxIdentifier> _destinations;
+  private final List<SendingMailbox> _sendingMailboxes;

Review Comment:
   ```suggestion
     private final List<SendingMailbox<TransferableBlock>> _sendingMailboxes;
   ```



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