brianloss commented on a change in pull request #1891:
URL: https://github.com/apache/accumulo/pull/1891#discussion_r567310985



##########
File path: server/manager/src/main/java/org/apache/accumulo/master/Master.java
##########
@@ -1686,4 +1741,56 @@ public boolean isActiveService() {
     return masterInitialized.get();
   }
 
+  @SuppressWarnings("deprecation")
+  void initializeBalancer() {
+
+    // Try to initialize the defined balancer as the updated TabletBalancer 
class first. If that
+    // fails with a ClassCastException, it means the property is specified as 
the deprecated
+    // balancer type, so initialize it instead. If we still end up with no 
balancer, then use
+    // DefaultLoadBalancer.
+    try {
+      tabletBalancer = 
Property.createInstanceFromPropertyName(getConfiguration(),
+          Property.TABLE_LOAD_BALANCER, TabletBalancer.class, null);
+    } catch (ClassCastException e) {
+      // ignore -- this means that the deprecated balancer type was used
+      deprecatedTabletBalancer = 
Property.createInstanceFromPropertyName(getConfiguration(),
+          Property.MANAGER_TABLET_BALANCER,
+          org.apache.accumulo.server.master.balancer.TabletBalancer.class, 
null);
+    }

Review comment:
       I was just about to start working on this, but looks like you beat me to 
it. :) Thanks. I'll add this code change in.




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


Reply via email to