virajjasani commented on code in PR #1598:
URL: https://github.com/apache/phoenix/pull/1598#discussion_r1245787461


##########
phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java:
##########
@@ -284,6 +367,102 @@ protected void explain(String prefix, List<String> 
planSteps,
         }
     }
 
+    /**
+     * Retrieve region locations and set the values in the explain plan output.
+     *
+     * @param planSteps list of plan steps to add explain plan output to.
+     * @param explainPlanAttributesBuilder explain plan v2 attributes builder 
instance.
+     * @param scansList list of the list of scans, to be used for parallel 
scans.
+     */
+    private void getRegionLocations(List<String> planSteps,
+                                    ExplainPlanAttributesBuilder 
explainPlanAttributesBuilder,
+                                    List<List<Scan>> scansList) {
+        Future<String> task = executorService.submit(
+                () -> 
getRegionLocationsForExplainPlan(explainPlanAttributesBuilder, scansList));
+        try {
+            String regionLocations = task.get(5, TimeUnit.SECONDS);
+            planSteps.add(regionLocations);
+        } catch (InterruptedException | ExecutionException | TimeoutException 
e) {
+            LOGGER.error("Unable to retrieve region locations task result in 
5s", e);
+            task.cancel(true);
+        }

Review Comment:
   this would be our own timeout, and if we can't get region locations on time, 
we rather cancel the task than letting hbase client retry for very long time.
   
   @jpisaac does this sound good to you?



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

Reply via email to