dlmarion commented on code in PR #3496:
URL: https://github.com/apache/accumulo/pull/3496#discussion_r1253501473
##########
core/src/main/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancer.java:
##########
@@ -125,14 +202,44 @@ public long balance(BalanceParameters params) {
long minBalanceTime = 5_000;
// Iterate over the tables and balance each of them
for (TableId tableId : environment.getTableIdMap().values()) {
+ final String tableResourceGroup = getResourceGroupNameForTable(tableId);
+ // get the group of tservers for this table
+ SortedMap<TabletServerId,TServerStatus> groupedTServers =
getCurrentSetForTable(
+ params.currentStatus(), params.currentResourceGroups(),
tableResourceGroup);
ArrayList<TabletMigration> newMigrations = new ArrayList<>();
- long tableBalanceTime = getBalancerForTable(tableId).balance(
- new BalanceParamsImpl(params.currentStatus(),
params.currentMigrations(), newMigrations));
+ long tableBalanceTime =
+ getBalancerForTable(tableId).balance(new
BalanceParamsImpl(groupedTServers,
+ params.currentResourceGroups(), params.currentMigrations(),
newMigrations));
if (tableBalanceTime < minBalanceTime) {
minBalanceTime = tableBalanceTime;
}
params.migrationsOut().addAll(newMigrations);
}
return minBalanceTime;
}
+
+ @Override
+ public boolean isHostedInResourceGroup(Configuration conf, TabletServerId
currentLocation,
+ Map<String,Set<TabletServerId>> currentTServerGrouping) {
+ Objects.requireNonNull(conf, "conf cannot be null");
+ Objects.requireNonNull(currentLocation, "current location cannot be null");
+ Objects.requireNonNull(currentTServerGrouping, "tserver grouping cannot be
null");
+ String property = Constants.DEFAULT_RESOURCE_GROUP_NAME;
+ if (conf.get(TABLE_ASSIGNMENT_GROUP_PROPERTY) != null) {
+ property = conf.get(TABLE_ASSIGNMENT_GROUP_PROPERTY);
+ }
+ if (property.equals(Constants.DEFAULT_RESOURCE_GROUP_NAME)) {
+ return true;
+ }
Review Comment:
Remove
--
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]