keith-turner commented on code in PR #5575:
URL: https://github.com/apache/accumulo/pull/5575#discussion_r2109371093


##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -1917,19 +1920,22 @@ public boolean isUpgrading() {
     return upgradeCoordinator.getStatus() != 
UpgradeCoordinator.UpgradeStatus.COMPLETE;
   }
 
-  void initializeBalancer() {
+  private void initializeBalancer() {
+    String configuredBalancerClass = 
getConfiguration().get(Property.MANAGER_TABLET_BALANCER);
     try {
-      getContext().getPropStore().getCache().removeAll();
-      getConfiguration().invalidateCache();
-      log.debug("Attempting to reinitialize balancer using class {}",
-          getConfiguration().get(Property.MANAGER_TABLET_BALANCER));
-      var localTabletBalancer = 
Property.createInstanceFromPropertyName(getConfiguration(),
-          Property.MANAGER_TABLET_BALANCER, TabletBalancer.class, new 
DoNothingBalancer());
-      localTabletBalancer.init(balancerEnvironment);
-      tabletBalancer = localTabletBalancer;
+      if (tabletBalancer == null
+          || 
!tabletBalancer.getClass().getName().equals(configuredBalancerClass)) {
+        log.debug("Attempting to initialize balancer using class {}, was {}",
+            configuredBalancerClass,
+            tabletBalancer == null ? "null" : 
tabletBalancer.getClass().getName());
+        var localTabletBalancer = 
Property.createInstanceFromPropertyName(getConfiguration(),
+            Property.MANAGER_TABLET_BALANCER, TabletBalancer.class, new 
DoNothingBalancer());
+        localTabletBalancer.init(balancerEnvironment);
+        tabletBalancer = localTabletBalancer;

Review Comment:
   There used to be the following log message from 
ManagerClientService.updatePlugins that logged something at info once the 
change was complete.  Would be nice to still have that.  The following probably 
will not compile, copied the log message exactly from the old place in the code.
   
   ```suggestion
           tabletBalancer = localTabletBalancer;
           log.info("tablet balancer changed to {}", 
manager.getBalancerClass().getName());
   ```



##########
server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java:
##########
@@ -591,15 +584,6 @@ private void alterTableProperty(TCredentials c, String 
tableName, String propert
     }
   }
 
-  private void updatePlugins(String property) {
-    // resolve without warning; any warnings should have already occurred
-    String resolved = DeprecatedPropertyUtil.getReplacementName(property, 
(log, replacement) -> {});
-    if (resolved.equals(Property.MANAGER_TABLET_BALANCER.getKey())) {
-      manager.initializeBalancer();
-      log.info("tablet balancer changed to {}", 
manager.getBalancerClass().getName());

Review Comment:
   Is the getBalancerClass() method in the manager still used by other stuff?  
Wondering if it could be removed.



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to