walterddr commented on code in PR #10413:
URL: https://github.com/apache/pinot/pull/10413#discussion_r1136500027
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/MailboxReceiveOperator.java:
##########
@@ -66,25 +67,31 @@ public class MailboxReceiveOperator extends
MultiStageOperator {
private int _serverIdx;
private TransferableBlock _upstreamErrorBlock;
- private static MailboxIdentifier toMailboxId(VirtualServer sender, long
jobId, int senderStageId,
- int receiverStageId, VirtualServerAddress receiver) {
- return new JsonMailboxIdentifier(
- String.format("%s_%s", jobId, senderStageId),
- new VirtualServerAddress(sender),
- receiver,
- senderStageId,
- receiverStageId);
+ private static MailboxIdentifier toMailboxId(VirtualServer sender, long
jobId, int senderStageId, int receiverStageId,
+ VirtualServerAddress receiver) {
+ return new JsonMailboxIdentifier(String.format("%s_%s", jobId,
senderStageId), new VirtualServerAddress(sender),
+ receiver, senderStageId, receiverStageId);
+ }
+
+ public MailboxReceiveOperator(RelDistribution.Type exchangeType, int
senderStageId, int receiverStageId,
+ OpChainExecutionContext context) {
+ this(context.getMetadataMap().get(senderStageId).getServerInstances(),
exchangeType, senderStageId, receiverStageId,
+ context);
}
// TODO: Move deadlineInNanoSeconds to OperatorContext.
- public MailboxReceiveOperator(MailboxService<TransferableBlock>
mailboxService,
- List<VirtualServer> sendingStageInstances, RelDistribution.Type
exchangeType, VirtualServerAddress receiver,
- long jobId, int senderStageId, int receiverStageId, Long timeoutMs) {
- super(jobId, senderStageId, receiver);
- _mailboxService = mailboxService;
+ public MailboxReceiveOperator(List<VirtualServer> sendingStageInstances,
RelDistribution.Type exchangeType,
+ int senderStageId, int receiverStageId, OpChainExecutionContext context)
{
+ super(context);
+ _mailboxService = context.getMailboxService();
+ VirtualServerAddress receiver = context.getServer();
+ long jobId = context.getRequestId();
Preconditions.checkState(SUPPORTED_EXCHANGE_TYPES.contains(exchangeType),
"Exchange/Distribution type: " + exchangeType + " is not supported!");
- long timeoutNano = (timeoutMs != null ? timeoutMs :
QueryConfig.DEFAULT_MAILBOX_TIMEOUT_MS) * 1_000_000L;
+ //TODO: Should I be using the Long.MAX_VALUE here instead of -1 or
previous null check?
+ long timeoutNano =
+ (context.getTimeoutMs() != Long.MAX_VALUE ? context.getTimeoutMs() :
QueryConfig.DEFAULT_MAILBOX_TIMEOUT_MS)
Review Comment:
context should not box timeout but should really box deadline. we need a
clean up for all the timeout to deadline --> deadline should be generated from
the broker side when it dispatches.
--
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]