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


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/PlanRequestContext.java:
##########
@@ -87,4 +87,8 @@ public void addReceivingMailboxes(List<MailboxIdentifier> 
ids) {
   public List<MailboxIdentifier> getReceivingMailboxes() {
     return ImmutableList.copyOf(_receivingMailboxes);
   }
+
+  public OperatorExecutionContext getOperatorExecutionContext() {
+    return new OperatorExecutionContext(this);
+  }

Review Comment:
   do not lazy generate this. create the operator execution context at 
construct time.



##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/MultiStageOperator.java:
##########
@@ -45,6 +46,10 @@ public abstract class MultiStageOperator implements 
Operator<TransferableBlock>,
   protected final Map<String, OperatorStats> _operatorStatsMap;
   private final String _operatorId;
 
+  public MultiStageOperator(OperatorExecutionContext context) {
+    this(context.getRequestId(), context.getStageId(), context.getServer());
+  }

Review Comment:
   directly take the context object is fine. no need to parse the 3 components 
out. 



##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/AggregateOperator.java:
##########
@@ -81,10 +82,9 @@ public class AggregateOperator extends MultiStageOperator {
   // groupSet has to be a list of InputRef and cannot be null
   // TODO: Add these two checks when we confirm we can handle error in 
upstream ctor call.
   public AggregateOperator(MultiStageOperator inputOperator, DataSchema 
dataSchema, List<RexExpression> aggCalls,
-      List<RexExpression> groupSet, DataSchema inputSchema, long requestId, 
int stageId,
-      VirtualServerAddress virtualServerAddress) {
+      List<RexExpression> groupSet, DataSchema inputSchema, 
OperatorExecutionContext context) {
     this(inputOperator, dataSchema, aggCalls, groupSet, inputSchema, 
AggregateOperator.AggregateAccumulator.AGG_MERGERS,
-        requestId, stageId, virtualServerAddress);
+        context.getRequestId(), context.getStageId(), context.getServer());

Review Comment:
   make call via
   ```
   super(_operatorExecutionContext)
   ```



##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/OperatorExecutionContext.java:
##########
@@ -0,0 +1,82 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.query.runtime.plan;
+
+import java.util.Map;
+import org.apache.pinot.query.mailbox.MailboxService;
+import org.apache.pinot.query.planner.StageMetadata;
+import org.apache.pinot.query.routing.VirtualServerAddress;
+import org.apache.pinot.query.runtime.blocks.TransferableBlock;
+
+
+public class OperatorExecutionContext {

Review Comment:
   also you could even call this `OpchainExecutionContext` since it is not 
tight with any specific operator 
   (i am assuming operator specific info are encoded in the abstract classes 
such as explain string)



##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/FilterOperator.java:
##########
@@ -56,8 +56,8 @@ public class FilterOperator extends MultiStageOperator {
   private TransferableBlock _upstreamErrorBlock;
 
   public FilterOperator(MultiStageOperator upstreamOperator, DataSchema 
dataSchema, RexExpression filter,
-      long requestId, int stageId, VirtualServerAddress serverAddress) {
-    super(requestId, stageId, serverAddress);
+      OperatorExecutionContext context) {
+    super(context);

Review Comment:
   why are some operators calling super(context) and some calling the other 
API? let's make them consistent.



##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/OperatorExecutionContext.java:
##########
@@ -0,0 +1,82 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.query.runtime.plan;
+
+import java.util.Map;
+import org.apache.pinot.query.mailbox.MailboxService;
+import org.apache.pinot.query.planner.StageMetadata;
+import org.apache.pinot.query.routing.VirtualServerAddress;
+import org.apache.pinot.query.runtime.blocks.TransferableBlock;
+
+
+public class OperatorExecutionContext {

Review Comment:
   needs javadoc. this class is intented for non-modifiable contextual info. we 
want to replace the constructor of operator so that it extensible.



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