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


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/ReceivingMailbox.java:
##########
@@ -18,55 +18,118 @@
  */
 package org.apache.pinot.query.mailbox;
 
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Consumer;
 import javax.annotation.Nullable;
-import org.apache.pinot.query.runtime.operator.MailboxReceiveOperator;
-import org.apache.pinot.query.runtime.operator.MailboxSendOperator;
+import org.apache.pinot.query.runtime.blocks.TransferableBlock;
+import org.apache.pinot.query.runtime.blocks.TransferableBlockUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
  * Mailbox that's used to receive data. Ownership of the ReceivingMailbox is 
with the MailboxService, which is unlike
- * the {@link SendingMailbox} whose ownership lies with the {@link 
MailboxSendOperator}. This is because the
- * ReceivingMailbox can be initialized even before the corresponding OpChain 
is registered on the receiver, whereas
- * the SendingMailbox is initialized when the MailboxSendOperator is running. 
Also see {@link #isInitialized()}.
- *
- * @param <T> the unit of data that each {@link #receive()} call returns.
+ * the {@link SendingMailbox} whose ownership lies with the send operator. 
This is because the ReceivingMailbox can be
+ * initialized even before the corresponding OpChain is registered on the 
receiver, whereas the SendingMailbox is
+ * initialized when the send operator is running.
  */
-public interface ReceivingMailbox<T> {
+public class ReceivingMailbox {
+  public static final int DEFAULT_MAX_PENDING_BLOCKS = 5;
+
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(ReceivingMailbox.class);
+  private static final TransferableBlock CANCELLED_ERROR_BLOCK =
+      TransferableBlockUtils.getErrorTransferableBlock(new 
RuntimeException("Cancelled by receiver"));

Review Comment:
   It is guaranteed to be cancelled by the receiver. This is used just as a 
tombstone when `cancel()` is invoked



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