gjacoby126 commented on a change in pull request #660: PHOENIX-5644:
IndexUpgradeTool should sleep only once if there is at …
URL: https://github.com/apache/phoenix/pull/660#discussion_r360492943
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexUpgradeTool.java
##########
@@ -367,6 +358,53 @@ private int executeTool(Connection conn,
ConnectionQueryServices queryServices,
return 0;
}
+ private void executeToolForImmutableTables(ConnectionQueryServices
queryServices,
+ ArrayList<String> immutableList) {
+
+ boolean atLeastOneHasIndexes=false;
+
+ for (String dataTableFullName : immutableList) {
+ HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName);
+ if (!(indexes.isEmpty() || atLeastOneHasIndexes)) {
+ atLeastOneHasIndexes = true;
+ }
+ try (Admin admin = queryServices.getAdmin()) {
Review comment:
Only need to create one Admin for this whole method, not two per data table.
Docs say they're lightweight, but no need to churn.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services