FrankChen021 commented on code in PR #19479:
URL: https://github.com/apache/druid/pull/19479#discussion_r3266158757


##########
multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerTableInputSpecSlicerProvider.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.druid.msq.indexing;
+
+import com.google.inject.Inject;
+import org.apache.druid.client.coordinator.CoordinatorClient;
+import org.apache.druid.msq.exec.ControllerContext;
+import org.apache.druid.msq.exec.SegmentSource;
+import org.apache.druid.msq.input.InputSpec;
+import org.apache.druid.msq.input.InputSpecSlicer;
+import org.apache.druid.msq.input.InputSpecSlicerProvider;
+import org.apache.druid.msq.input.table.TableInputSpec;
+import org.apache.druid.msq.util.MultiStageQueryContext;
+import org.apache.druid.query.QueryContext;
+
+import java.util.List;
+
+/**
+ * Controller-side provider for {@link TableInputSpec} in tasks.
+ */
+public class IndexerTableInputSpecSlicerProvider implements 
InputSpecSlicerProvider
+{
+  private final CoordinatorClient coordinatorClient;
+
+  @Inject
+  public IndexerTableInputSpecSlicerProvider(CoordinatorClient 
coordinatorClient)
+  {
+    this.coordinatorClient = coordinatorClient;
+  }
+
+  @Override
+  public Class<? extends InputSpec> specClass()
+  {
+    return TableInputSpec.class;
+  }
+
+  @Override
+  public InputSpecSlicer createSlicer(
+      ControllerContext controllerContext,
+      QueryContext queryContext,
+      List<String> workerIds
+  )
+  {
+    final SegmentSource includeSegmentSource =
+        MultiStageQueryContext.getSegmentSources(queryContext, 
IndexerControllerContext.DEFAULT_SEGMENT_SOURCE);
+    return new IndexerTableInputSpecSlicer(
+        coordinatorClient,

Review Comment:
   [P2] Preserve the task CoordinatorClient retry policy
   
   Before this PR, `IndexerControllerContext` created 
`IndexerTableInputSpecSlicer` with `toolbox.getCoordinatorClient()`, and 
`TaskToolboxFactory` wraps that client with `StandardRetryPolicy.aboutAnHour()` 
so task Coordinator RPCs survive brief Coordinator outages. The new provider 
injects the raw Guice `CoordinatorClient` and passes it here, so MSQ tasks 
using `includeSegmentSource=REALTIME` fetch server-view segments with only the 
default service-client retry policy and can fail much sooner than the old path. 
Please create the slicer with the TaskToolbox `CoordinatorClient`, or apply the 
same task retry policy before passing the client into the slicer.



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