jpisaac commented on code in PR #1598:
URL: https://github.com/apache/phoenix/pull/1598#discussion_r1245809172
##########
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:
Creating an executor service for every query, might not be the right thing.
--
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]