This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 4434eda332c Do not pass server metrics in PlanMaker (#17808)
4434eda332c is described below

commit 4434eda332c6820f53a9119ca6c5113d9bd1983d
Author: Xiaotian (Jackie) Jiang <[email protected]>
AuthorDate: Wed Mar 4 10:59:57 2026 -0800

    Do not pass server metrics in PlanMaker (#17808)
---
 .../core/plan/maker/InstancePlanMakerImplV2.java   |  7 ++++---
 .../apache/pinot/core/plan/maker/PlanMaker.java    | 24 ++++++++++++++++++----
 .../query/executor/ServerQueryExecutorV1Impl.java  |  6 +++---
 .../org/apache/pinot/queries/BaseQueriesTest.java  |  6 ++----
 ...BenchmarkAggregateGroupByOrderByQueriesSSE.java |  6 +++---
 5 files changed, 32 insertions(+), 17 deletions(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/plan/maker/InstancePlanMakerImplV2.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/plan/maker/InstancePlanMakerImplV2.java
index b443450b161..9db40b189d8 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/plan/maker/InstancePlanMakerImplV2.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/plan/maker/InstancePlanMakerImplV2.java
@@ -28,7 +28,6 @@ import java.util.concurrent.ExecutorService;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.tuple.Pair;
-import org.apache.pinot.common.metrics.ServerMetrics;
 import org.apache.pinot.common.request.context.ExpressionContext;
 import org.apache.pinot.common.request.context.FilterContext;
 import org.apache.pinot.common.request.context.OrderByExpressionContext;
@@ -179,8 +178,9 @@ public class InstancePlanMakerImplV2 implements PlanMaker {
     _groupByTrimThreshold = groupByTrimThreshold;
   }
 
+  @Override
   public Plan makeInstancePlan(List<SegmentContext> segmentContexts, 
QueryContext queryContext,
-      ExecutorService executorService, ServerMetrics serverMetrics) {
+      ExecutorService executorService) {
     applyQueryOptions(queryContext);
 
     int numSegments = segmentContexts.size();
@@ -326,8 +326,9 @@ public class InstancePlanMakerImplV2 implements PlanMaker {
     }
   }
 
+  @Override
   public Plan makeStreamingInstancePlan(List<SegmentContext> segmentContexts, 
QueryContext queryContext,
-      ExecutorService executorService, ResultsBlockStreamer streamer, 
ServerMetrics serverMetrics) {
+      ExecutorService executorService, ResultsBlockStreamer streamer) {
     applyQueryOptions(queryContext);
 
     int numSegments = segmentContexts.size();
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/plan/maker/PlanMaker.java 
b/pinot-core/src/main/java/org/apache/pinot/core/plan/maker/PlanMaker.java
index 36e62bd8673..8ee51310db0 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/plan/maker/PlanMaker.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/plan/maker/PlanMaker.java
@@ -44,8 +44,16 @@ public interface PlanMaker {
   /**
    * Returns an instance level {@link Plan} which contains the logical 
execution plan for multiple segments.
    */
-  Plan makeInstancePlan(List<SegmentContext> segmentContexts, QueryContext 
queryContext,
-      ExecutorService executorService, ServerMetrics serverMetrics);
+  default Plan makeInstancePlan(List<SegmentContext> segmentContexts, 
QueryContext queryContext,
+      ExecutorService executorService) {
+    return makeInstancePlan(segmentContexts, queryContext, executorService, 
ServerMetrics.get());
+  }
+
+  @Deprecated
+  default Plan makeInstancePlan(List<SegmentContext> segmentContexts, 
QueryContext queryContext,
+      ExecutorService executorService, ServerMetrics serverMetrics) {
+    return makeInstancePlan(segmentContexts, queryContext, executorService);
+  }
 
   /**
    * Returns a segment level {@link PlanNode} which contains the logical 
execution plan for one segment.
@@ -56,8 +64,16 @@ public interface PlanMaker {
    * Returns an instance level {@link Plan} for a streaming query which 
contains the logical execution plan for multiple
    * segments.
    */
-  Plan makeStreamingInstancePlan(List<SegmentContext> segmentContexts, 
QueryContext queryContext,
-      ExecutorService executorService, ResultsBlockStreamer streamer, 
ServerMetrics serverMetrics);
+  default Plan makeStreamingInstancePlan(List<SegmentContext> segmentContexts, 
QueryContext queryContext,
+      ExecutorService executorService, ResultsBlockStreamer streamer) {
+    return makeStreamingInstancePlan(segmentContexts, queryContext, 
executorService, streamer, ServerMetrics.get());
+  }
+
+  @Deprecated
+  default Plan makeStreamingInstancePlan(List<SegmentContext> segmentContexts, 
QueryContext queryContext,
+      ExecutorService executorService, ResultsBlockStreamer streamer, 
ServerMetrics serverMetrics) {
+    return makeStreamingInstancePlan(segmentContexts, queryContext, 
executorService, streamer);
+  }
 
   /**
    * Returns a segment level {@link PlanNode} for a streaming query which 
contains the logical execution plan for one
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java
index 949db6e7df8..6e1ef3c1509 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java
@@ -535,10 +535,10 @@ public class ServerQueryExecutorV1Impl implements 
QueryExecutor {
 
     Plan queryPlan;
     if (streamer != null) {
-      queryPlan = 
_planMaker.makeStreamingInstancePlan(selectedSegmentContexts, queryContext, 
executorService,
-          streamer, _serverMetrics);
+      queryPlan =
+          _planMaker.makeStreamingInstancePlan(selectedSegmentContexts, 
queryContext, executorService, streamer);
     } else {
-      queryPlan = _planMaker.makeInstancePlan(selectedSegmentContexts, 
queryContext, executorService, _serverMetrics);
+      queryPlan = _planMaker.makeInstancePlan(selectedSegmentContexts, 
queryContext, executorService);
     }
     planBuildTimer.stopAndRecord();
     return queryPlan;
diff --git 
a/pinot-core/src/test/java/org/apache/pinot/queries/BaseQueriesTest.java 
b/pinot-core/src/test/java/org/apache/pinot/queries/BaseQueriesTest.java
index 3d652d1910d..6144f556bf2 100644
--- a/pinot-core/src/test/java/org/apache/pinot/queries/BaseQueriesTest.java
+++ b/pinot-core/src/test/java/org/apache/pinot/queries/BaseQueriesTest.java
@@ -213,8 +213,7 @@ public abstract class BaseQueriesTest {
     byte[] serializedResponse;
     try (QueryThreadContext ignore = QueryThreadContext.openForSseTest()) {
       Plan plan =
-          planMaker.makeInstancePlan(getSegmentContexts(getIndexSegments()), 
serverQueryContext, EXECUTOR_SERVICE,
-              null);
+          planMaker.makeInstancePlan(getSegmentContexts(getIndexSegments()), 
serverQueryContext, EXECUTOR_SERVICE);
       InstanceResponseBlock instanceResponse =
           queryContext.isExplain() ? 
ServerQueryExecutorV1Impl.executeDescribeExplain(plan, queryContext)
               : plan.execute();
@@ -298,8 +297,7 @@ public abstract class BaseQueriesTest {
     for (int i = 0; i < 2; i++) {
       try (QueryThreadContext ignore = QueryThreadContext.openForSseTest()) {
         Plan plan =
-            planMaker.makeInstancePlan(getSegmentContexts(instances.get(i)), 
serverQueryContext, EXECUTOR_SERVICE,
-                null);
+            planMaker.makeInstancePlan(getSegmentContexts(instances.get(i)), 
serverQueryContext, EXECUTOR_SERVICE);
         InstanceResponseBlock instanceResponse =
             queryContext.isExplain() ? 
ServerQueryExecutorV1Impl.executeDescribeExplain(plan, queryContext)
                 : plan.execute();
diff --git 
a/pinot-perf/src/main/java/org/apache/pinot/perf/BenchmarkAggregateGroupByOrderByQueriesSSE.java
 
b/pinot-perf/src/main/java/org/apache/pinot/perf/BenchmarkAggregateGroupByOrderByQueriesSSE.java
index 16fd7c9f90f..c4c2d267918 100644
--- 
a/pinot-perf/src/main/java/org/apache/pinot/perf/BenchmarkAggregateGroupByOrderByQueriesSSE.java
+++ 
b/pinot-perf/src/main/java/org/apache/pinot/perf/BenchmarkAggregateGroupByOrderByQueriesSSE.java
@@ -431,7 +431,7 @@ public class BenchmarkAggregateGroupByOrderByQueriesSSE {
     serverQueryContext.setEndTimeMs(
         System.currentTimeMillis() + 
CommonConstants.Server.DEFAULT_QUERY_EXECUTOR_TIMEOUT_MS);
     Plan plan =
-        planMaker.makeInstancePlan(getSegmentContexts(getIndexSegments()), 
serverQueryContext, EXECUTOR_SERVICE, null);
+        planMaker.makeInstancePlan(getSegmentContexts(getIndexSegments()), 
serverQueryContext, EXECUTOR_SERVICE);
     InstanceResponseBlock instanceResponse;
     try {
       instanceResponse = queryContext.isExplain()
@@ -515,9 +515,9 @@ public class BenchmarkAggregateGroupByOrderByQueriesSSE {
     serverQueryContext.setEndTimeMs(
         System.currentTimeMillis() + 
CommonConstants.Server.DEFAULT_QUERY_EXECUTOR_TIMEOUT_MS);
     Plan plan1 =
-        planMaker.makeInstancePlan(getSegmentContexts(instances.get(0)), 
serverQueryContext, EXECUTOR_SERVICE, null);
+        planMaker.makeInstancePlan(getSegmentContexts(instances.get(0)), 
serverQueryContext, EXECUTOR_SERVICE);
     Plan plan2 =
-        planMaker.makeInstancePlan(getSegmentContexts(instances.get(1)), 
serverQueryContext, EXECUTOR_SERVICE, null);
+        planMaker.makeInstancePlan(getSegmentContexts(instances.get(1)), 
serverQueryContext, EXECUTOR_SERVICE);
 
     InstanceResponseBlock instanceResponse1;
     try {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to