keith-turner commented on code in PR #5530:
URL: https://github.com/apache/accumulo/pull/5530#discussion_r2081770190
##########
core/src/main/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancer.java:
##########
@@ -74,35 +85,16 @@ protected TabletBalancer getBalancerForTable(TableId
tableId) {
if (clazzName == null) {
clazzName = SimpleLoadBalancer.class.getName();
}
- if (balancer != null) {
- if (!clazzName.equals(balancer.getClass().getName())) {
- // the balancer class for this table does not match the class
specified in the configuration
- try {
- balancer = constructNewBalancerForTable(clazzName, tableId);
- perTableBalancers.put(tableId, balancer);
- balancer.init(environment);
-
- log.info("Loaded new class {} for table {}", clazzName, tableId);
- } catch (Exception e) {
- log.warn("Failed to load table balancer class {} for table {}",
clazzName, tableId, e);
- }
- }
- }
- if (balancer == null) {
- try {
- balancer = constructNewBalancerForTable(clazzName, tableId);
- log.info("Loaded class {} for table {}", clazzName, tableId);
- } catch (Exception e) {
- log.warn("Failed to load table balancer class {} for table {}",
clazzName, tableId, e);
- }
+ if (balancer == null || !clazzName.equals(balancer.getClass().getName())) {
+ balancer = constructAndInitializeBalancer(clazzName, tableId);
if (balancer == null) {
- log.info("Creating balancer {} limited to balancing table {}",
- SimpleLoadBalancer.class.getName(), tableId);
- balancer = new SimpleLoadBalancer(tableId);
+ balancer =
constructAndInitializeBalancer(DoNothingBalancer.class.getName(), tableId);
+ log.warn("Fell back to balancer {} for table {}",
DoNothingBalancer.class.getName(),
Review Comment:
updated this to error
--
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]