This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit d10d06ae63fbe5c3df8f638dde71f0af18cc169a
Merge: a4ab7a48dd 318765562c
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Fri Dec 6 13:55:36 2024 +0000

    Merge branch '3.1'

 .../core/manager/balancer/BalanceParamsImpl.java   | 15 +++++++---
 .../accumulo/core/spi/balancer/GroupBalancer.java  | 10 +++++--
 .../spi/balancer/HostRegexTableLoadBalancer.java   | 12 +++++---
 .../core/spi/balancer/TableLoadBalancer.java       |  8 +++--
 .../accumulo/core/spi/balancer/TabletBalancer.java |  7 +++++
 .../BaseHostRegexTableLoadBalancerTest.java        |  8 +++++
 .../core/spi/balancer/GroupBalancerTest.java       | 10 ++++---
 ...tRegexTableLoadBalancerReconfigurationTest.java | 12 +++++---
 .../balancer/HostRegexTableLoadBalancerTest.java   | 34 ++++++++++++----------
 .../core/spi/balancer/SimpleLoadBalancerTest.java  |  5 ++--
 .../core/spi/balancer/TableLoadBalancerTest.java   | 11 ++++---
 .../java/org/apache/accumulo/manager/Manager.java  |  2 +-
 .../accumulo/test/ChaoticLoadBalancerTest.java     |  3 +-
 13 files changed, 91 insertions(+), 46 deletions(-)

diff --cc 
core/src/main/java/org/apache/accumulo/core/manager/balancer/BalanceParamsImpl.java
index 6794b847e8,c42892feaf..8419452c71
--- 
a/core/src/main/java/org/apache/accumulo/core/manager/balancer/BalanceParamsImpl.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/manager/balancer/BalanceParamsImpl.java
@@@ -43,31 -41,22 +44,32 @@@ public class BalanceParamsImpl implemen
    private final List<TabletMigration> migrationsOut;
    private final SortedMap<TServerInstance,TabletServerStatus> 
thriftCurrentStatus;
    private final Set<KeyExtent> thriftCurrentMigrations;
 +  private final Map<String,Set<TabletServerId>> tserverResourceGroups;
+   private final DataLevel currentDataLevel;
  
    public static BalanceParamsImpl 
fromThrift(SortedMap<TabletServerId,TServerStatus> currentStatus,
 +      Map<String,Set<TServerInstance>> currentTServerGrouping,
        SortedMap<TServerInstance,TabletServerStatus> thriftCurrentStatus,
-       Set<KeyExtent> thriftCurrentMigrations) {
+       Set<KeyExtent> thriftCurrentMigrations, DataLevel currentLevel) {
      Set<TabletId> currentMigrations = 
thriftCurrentMigrations.stream().map(TabletIdImpl::new)
          .collect(Collectors.toUnmodifiableSet());
  
 -    return new BalanceParamsImpl(currentStatus, currentMigrations, new 
ArrayList<>(),
 +    Map<String,Set<TabletServerId>> tserverGroups = new HashMap<>();
 +    currentTServerGrouping.forEach((k, v) -> {
 +      Set<TabletServerId> servers = new HashSet<>();
 +      v.forEach(tsi -> servers.add(TabletServerIdImpl.fromThrift(tsi)));
 +      tserverGroups.put(k, servers);
 +    });
 +
 +    return new BalanceParamsImpl(currentStatus, tserverGroups, 
currentMigrations, new ArrayList<>(),
-         thriftCurrentStatus, thriftCurrentMigrations);
+         thriftCurrentStatus, thriftCurrentMigrations, currentLevel);
    }
  
    public BalanceParamsImpl(SortedMap<TabletServerId,TServerStatus> 
currentStatus,
 -      Set<TabletId> currentMigrations, List<TabletMigration> migrationsOut,
 -      DataLevel currentLevel) {
 +      Map<String,Set<TabletServerId>> currentGroups, Set<TabletId> 
currentMigrations,
-       List<TabletMigration> migrationsOut) {
++      List<TabletMigration> migrationsOut, DataLevel currentLevel) {
      this.currentStatus = currentStatus;
 +    this.tserverResourceGroups = currentGroups;
      this.currentMigrations = currentMigrations;
      this.migrationsOut = migrationsOut;
      this.thriftCurrentStatus = null;
@@@ -75,12 -65,10 +78,12 @@@
    }
  
    private BalanceParamsImpl(SortedMap<TabletServerId,TServerStatus> 
currentStatus,
 -      Set<TabletId> currentMigrations, List<TabletMigration> migrationsOut,
 +      Map<String,Set<TabletServerId>> currentGroups, Set<TabletId> 
currentMigrations,
 +      List<TabletMigration> migrationsOut,
        SortedMap<TServerInstance,TabletServerStatus> thriftCurrentStatus,
-       Set<KeyExtent> thriftCurrentMigrations) {
+       Set<KeyExtent> thriftCurrentMigrations, DataLevel currentLevel) {
      this.currentStatus = currentStatus;
 +    this.tserverResourceGroups = currentGroups;
      this.currentMigrations = currentMigrations;
      this.migrationsOut = migrationsOut;
      this.thriftCurrentStatus = thriftCurrentStatus;
@@@ -118,8 -107,7 +122,11 @@@
    }
  
    @Override
 +  public Map<String,Set<TabletServerId>> currentResourceGroups() {
 +    return tserverResourceGroups;
 +  }
 +
+   public String currentLevel() {
+     return currentDataLevel.name();
+   }
  }
diff --cc 
core/src/main/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancer.java
index aa8f2e162d,f27f4cea07..65ef43f194
--- 
a/core/src/main/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancer.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancer.java
@@@ -506,8 -504,8 +510,8 @@@ public class HostRegexTableLoadBalance
          continue;
        }
        ArrayList<TabletMigration> newMigrations = new ArrayList<>();
 -      getBalancerForTable(tableId).balance(
 -          new BalanceParamsImpl(currentView, migrations, newMigrations, 
DataLevel.of(tableId)));
 +      getBalancerForTable(tableId).balance(new BalanceParamsImpl(currentView,
-           params.currentResourceGroups(), migrations, newMigrations));
++          params.currentResourceGroups(), migrations, newMigrations, 
DataLevel.of(tableId)));
  
        if (newMigrations.isEmpty()) {
          tableToTimeSinceNoMigrations.remove(tableId);
diff --cc 
core/src/main/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancer.java
index 156777d3a6,55a24c3094..6e0d4a0698
--- 
a/core/src/main/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancer.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancer.java
@@@ -34,10 -30,9 +34,11 @@@ import org.apache.accumulo.core.data.Ta
  import org.apache.accumulo.core.data.TabletId;
  import org.apache.accumulo.core.manager.balancer.AssignmentParamsImpl;
  import org.apache.accumulo.core.manager.balancer.BalanceParamsImpl;
+ import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
 +import org.apache.accumulo.core.spi.balancer.data.TServerStatus;
  import org.apache.accumulo.core.spi.balancer.data.TabletMigration;
  import org.apache.accumulo.core.spi.balancer.data.TabletServerId;
 +import org.apache.commons.lang3.StringUtils;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -210,19 -125,12 +211,20 @@@ public class TableLoadBalancer implemen
    public long balance(BalanceParameters params) {
      long minBalanceTime = 5_000;
      // Iterate over the tables and balance each of them
+     final DataLevel currentDataLevel = 
DataLevel.valueOf(params.currentLevel());
      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);
 +      if (groupedTServers == null) {
 +        // group for table does not contain any tservers, warning already 
logged
 +        continue;
 +      }
        ArrayList<TabletMigration> newMigrations = new ArrayList<>();
--      long tableBalanceTime =
-           getBalancerForTable(tableId).balance(new 
BalanceParamsImpl(groupedTServers,
-               params.currentResourceGroups(), params.currentMigrations(), 
newMigrations));
 -          getBalancerForTable(tableId).balance(new 
BalanceParamsImpl(params.currentStatus(),
++      long tableBalanceTime = getBalancerForTable(tableId)
++          .balance(new BalanceParamsImpl(groupedTServers, 
params.currentResourceGroups(),
+               params.currentMigrations(), newMigrations, currentDataLevel));
        if (tableBalanceTime < minBalanceTime) {
          minBalanceTime = tableBalanceTime;
        }
diff --cc 
core/src/main/java/org/apache/accumulo/core/spi/balancer/TabletBalancer.java
index 6e4952a381,356bbc7223..608aa0c9f1
--- 
a/core/src/main/java/org/apache/accumulo/core/spi/balancer/TabletBalancer.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/spi/balancer/TabletBalancer.java
@@@ -100,12 -95,13 +100,19 @@@ public interface TabletBalancer 
       */
      List<TabletMigration> migrationsOut();
  
 +    /**
 +     * @return map of resource group name to set of TServerInstance objects
 +     * @since 4.0.0
 +     */
 +    Map<String,Set<TabletServerId>> currentResourceGroups();
 +
+     /**
+      * Return the DataLevel name for which the Manager is currently 
balancing. Balancers should
+      * return migrations for tables within the current DataLevel.
+      *
+      * @return name of current balancing iteration data level
+      */
+     String currentLevel();
    }
  
    /**
diff --cc 
core/src/test/java/org/apache/accumulo/core/spi/balancer/GroupBalancerTest.java
index 45a1b84d5a,189af6ef6f..d32e948ab8
--- 
a/core/src/test/java/org/apache/accumulo/core/spi/balancer/GroupBalancerTest.java
+++ 
b/core/src/test/java/org/apache/accumulo/core/spi/balancer/GroupBalancerTest.java
@@@ -120,9 -121,8 +122,9 @@@ public class GroupBalancerTest 
                new 
org.apache.accumulo.core.manager.thrift.TabletServerStatus()));
          }
  
 -        balancer
 -            .balance(new BalanceParamsImpl(current, migrations, 
migrationsOut, DataLevel.of(tid)));
 +        balancer.balance(new BalanceParamsImpl(current,
 +            Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current.keySet()), 
migrations,
-             migrationsOut));
++            migrationsOut, DataLevel.of(tid)));
  
          assertTrue(migrationsOut.size() <= (maxMigrations + 5),
              "Max Migration exceeded " + maxMigrations + " " + 
migrationsOut.size());
diff --cc 
core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
index c270dfd2ef,58a89ec626..2715f2b0b2
--- 
a/core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
+++ 
b/core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
@@@ -110,18 -108,19 +111,21 @@@ public class HostRegexTableLoadBalancer
      // getOnlineTabletsForTable
      UtilWaitThread.sleep(3000);
      this.balance(new 
BalanceParamsImpl(Collections.unmodifiableSortedMap(allTabletServers),
 -        migrations, migrationsOut, DataLevel.USER));
 +        Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, 
allTabletServers.keySet()), migrations,
-         migrationsOut));
++        migrationsOut, DataLevel.USER));
      assertEquals(0, migrationsOut.size());
      // Change property, simulate call by TableConfWatcher
  
      config.set(HostRegexTableLoadBalancer.HOST_BALANCER_PREFIX + 
BAR.getTableName(), "r01.*");
  
-     // Wait to trigger the out of bounds check and the repool check
-     UtilWaitThread.sleep(10000);
+     // calls to balance will clear the lastOOBCheckTimes map
+     // in the HostRegexTableLoadBalancer. For this test we want
+     // to get into the out of bounds checking code, so we need to
+     // populate the map with an older time value
+     this.lastOOBCheckTimes.put(DataLevel.USER, System.currentTimeMillis() / 
2);
      this.balance(new 
BalanceParamsImpl(Collections.unmodifiableSortedMap(allTabletServers),
 -        migrations, migrationsOut, DataLevel.USER));
 +        Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, 
allTabletServers.keySet()), migrations,
-         migrationsOut));
++        migrationsOut, DataLevel.USER));
      assertEquals(5, migrationsOut.size());
      for (TabletMigration migration : migrationsOut) {
        
assertTrue(migration.getNewTabletServer().getHost().startsWith("192.168.0.1")
diff --cc 
core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerTest.java
index 6507c91566,8d86e34210..94d3474f9d
--- 
a/core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerTest.java
+++ 
b/core/src/test/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancerTest.java
@@@ -53,10 -53,8 +54,9 @@@ import org.apache.accumulo.core.spi.bal
  import org.apache.accumulo.core.spi.balancer.data.TabletStatistics;
  import org.apache.accumulo.core.spi.common.ServiceEnvironment;
  import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
- import org.apache.accumulo.core.util.UtilWaitThread;
  import org.junit.jupiter.api.Test;
  
 +@Deprecated
  public class HostRegexTableLoadBalancerTest extends 
BaseHostRegexTableLoadBalancerTest {
  
    public void init(Map<String,String> tableProperties) {
@@@ -94,10 -92,9 +94,10 @@@
      init(DEFAULT_TABLE_PROPERTIES);
      Set<TabletId> migrations = new HashSet<>();
      List<TabletMigration> migrationsOut = new ArrayList<>();
 -    long wait =
 -        this.balance(new 
BalanceParamsImpl(Collections.unmodifiableSortedMap(createCurrent(15)),
 -            migrations, migrationsOut, DataLevel.USER));
 +    SortedMap<TabletServerId,TServerStatus> current = createCurrent(15);
 +    long wait = this.balance(new BalanceParamsImpl(current,
-         Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current.keySet()), 
migrations,
-         migrationsOut));
++        Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current.keySet()), 
migrations, migrationsOut,
++        DataLevel.USER));
      assertEquals(20000, wait);
      // should balance four tablets in one of the tables before reaching max
      assertEquals(4, migrationsOut.size());
@@@ -107,10 -104,8 +107,10 @@@
        migrations.add(m.getTablet());
      }
      migrationsOut.clear();
 -    wait = this.balance(new 
BalanceParamsImpl(Collections.unmodifiableSortedMap(createCurrent(15)),
 -        migrations, migrationsOut, DataLevel.USER));
 +    SortedMap<TabletServerId,TServerStatus> current2 = createCurrent(15);
 +    wait = this.balance(new BalanceParamsImpl(current2,
-         Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current2.keySet()), 
migrations,
-         migrationsOut));
++        Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current2.keySet()), 
migrations, migrationsOut,
++        DataLevel.USER));
      assertEquals(20000, wait);
      // should balance four tablets in one of the other tables before reaching 
max
      assertEquals(4, migrationsOut.size());
@@@ -120,10 -115,8 +120,10 @@@
        migrations.add(m.getTablet());
      }
      migrationsOut.clear();
 -    wait = this.balance(new 
BalanceParamsImpl(Collections.unmodifiableSortedMap(createCurrent(15)),
 -        migrations, migrationsOut, DataLevel.USER));
 +    SortedMap<TabletServerId,TServerStatus> current3 = createCurrent(15);
 +    wait = this.balance(new BalanceParamsImpl(current3,
-         Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current3.keySet()), 
migrations,
-         migrationsOut));
++        Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current3.keySet()), 
migrations, migrationsOut,
++        DataLevel.USER));
      assertEquals(20000, wait);
      // should balance four tablets in one of the other tables before reaching 
max
      assertEquals(4, migrationsOut.size());
@@@ -133,10 -126,8 +133,10 @@@
        migrations.add(m.getTablet());
      }
      migrationsOut.clear();
 -    wait = this.balance(new 
BalanceParamsImpl(Collections.unmodifiableSortedMap(createCurrent(15)),
 -        migrations, migrationsOut, DataLevel.USER));
 +    SortedMap<TabletServerId,TServerStatus> current4 = createCurrent(15);
 +    wait = this.balance(new BalanceParamsImpl(current4,
-         Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current4.keySet()), 
migrations,
-         migrationsOut));
++        Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current4.keySet()), 
migrations, migrationsOut,
++        DataLevel.USER));
      assertEquals(20000, wait);
      // no more balancing to do
      assertEquals(0, migrationsOut.size());
@@@ -151,10 -142,9 +151,10 @@@
      Set<TabletId> migrations = new HashSet<>();
      migrations.addAll(tableTablets.get(FOO.getTableName()));
      migrations.addAll(tableTablets.get(BAR.getTableName()));
 -    long wait =
 -        this.balance(new 
BalanceParamsImpl(Collections.unmodifiableSortedMap(createCurrent(15)),
 -            migrations, migrationsOut, DataLevel.USER));
 +    SortedMap<TabletServerId,TServerStatus> current = createCurrent(15);
 +    long wait = this.balance(new BalanceParamsImpl(current,
-         Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current.keySet()), 
migrations,
-         migrationsOut));
++        Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current.keySet()), 
migrations, migrationsOut,
++        DataLevel.USER));
      assertEquals(20000, wait);
      // no migrations should have occurred as 10 is the 
maxOutstandingMigrations
      assertEquals(0, migrationsOut.size());
@@@ -499,16 -483,16 +499,18 @@@
  
    @Test
    public void testOutOfBoundsTablets() {
+     // calls to balance will clear the lastOOBCheckTimes map
+     // in the HostRegexTableLoadBalancer. For this test we want
+     // to get into the out of bounds checking code, so we need to
+     // populate the map with an older time value
+     this.lastOOBCheckTimes.put(DataLevel.USER, System.currentTimeMillis() / 
2);
      init(DEFAULT_TABLE_PROPERTIES);
-     // Wait to trigger the out of bounds check which will call our version of
-     // getOnlineTabletsForTable
-     UtilWaitThread.sleep(11000);
      Set<TabletId> migrations = new HashSet<>();
      List<TabletMigration> migrationsOut = new ArrayList<>();
 -    this.balance(
 -        new BalanceParamsImpl(createCurrent(15), migrations, migrationsOut, 
DataLevel.USER));
 +    SortedMap<TabletServerId,TServerStatus> current = createCurrent(15);
 +    this.balance(new BalanceParamsImpl(current,
-         Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current.keySet()), 
migrations,
-         migrationsOut));
++        Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current.keySet()), 
migrations, migrationsOut,
++        DataLevel.USER));
      assertEquals(2, migrationsOut.size());
    }
  
diff --cc 
core/src/test/java/org/apache/accumulo/core/spi/balancer/SimpleLoadBalancerTest.java
index 82fa17297d,68d059f6ea..549e54923f
--- 
a/core/src/test/java/org/apache/accumulo/core/spi/balancer/SimpleLoadBalancerTest.java
+++ 
b/core/src/test/java/org/apache/accumulo/core/spi/balancer/SimpleLoadBalancerTest.java
@@@ -202,10 -203,8 +203,10 @@@ public class SimpleLoadBalancerTest 
      // balance until we can't balance no more!
      while (true) {
        List<TabletMigration> migrationsOut = new ArrayList<>();
 -      balancer.balance(new BalanceParamsImpl(getAssignments(servers), 
migrations, migrationsOut,
 -          DataLevel.USER));
 +      SortedMap<TabletServerId,TServerStatus> tservers = 
getAssignments(servers);
 +      balancer.balance(new BalanceParamsImpl(tservers,
 +          Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, tservers.keySet()), 
migrations,
-           migrationsOut));
++          migrationsOut, DataLevel.USER));
        if (migrationsOut.isEmpty()) {
          break;
        }
@@@ -247,10 -246,8 +248,10 @@@
      // balance until we can't balance no more!
      while (true) {
        List<TabletMigration> migrationsOut = new ArrayList<>();
 -      balancer.balance(new BalanceParamsImpl(getAssignments(servers), 
migrations, migrationsOut,
 -          DataLevel.USER));
 +      SortedMap<TabletServerId,TServerStatus> tservers = 
getAssignments(servers);
 +      balancer.balance(new BalanceParamsImpl(tservers,
 +          Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, tservers.keySet()), 
migrations,
-           migrationsOut));
++          migrationsOut, DataLevel.USER));
        if (migrationsOut.isEmpty()) {
          break;
        }
diff --cc 
core/src/test/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancerTest.java
index 8974924e53,f36c80e33e..29be5f2cf8
--- 
a/core/src/test/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancerTest.java
+++ 
b/core/src/test/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancerTest.java
@@@ -144,15 -141,13 +145,17 @@@ public class TableLoadBalancerTest 
      List<TabletMigration> migrationsOut = new ArrayList<>();
      TableLoadBalancer tls = new TableLoadBalancer();
      tls.init(environment);
-     tls.balance(new BalanceParamsImpl(state,
-         Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, state.keySet()), 
migrations, migrationsOut));
 -    tls.balance(new BalanceParamsImpl(state, migrations, migrationsOut, 
DataLevel.USER));
++    tls.balance(
++        new BalanceParamsImpl(state, 
Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, state.keySet()),
++            migrations, migrationsOut, DataLevel.USER));
      assertEquals(0, migrationsOut.size());
  
      state.put(mkts("10.0.0.2", 2345, "0x02030405"), status());
      tls = new TableLoadBalancer();
      tls.init(environment);
-     tls.balance(new BalanceParamsImpl(state,
-         Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, state.keySet()), 
migrations, migrationsOut));
 -    tls.balance(new BalanceParamsImpl(state, migrations, migrationsOut, 
DataLevel.USER));
++    tls.balance(
++        new BalanceParamsImpl(state, 
Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, state.keySet()),
++            migrations, migrationsOut, DataLevel.USER));
      int count = 0;
      Map<TableId,Integer> movedByTable = new HashMap<>();
      movedByTable.put(TableId.of(t1Id), 0);
diff --cc server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
index 67782a73e1,1bb3721aad..1593596ccf
--- a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
+++ b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
@@@ -957,8 -1066,8 +957,8 @@@ public class Manager extends AbstractSe
              statusForBalancerLevel = tserverStatusForBalancerLevel2;
            }
  
 -          params = BalanceParamsImpl.fromThrift(statusForBalancerLevel, 
tserverStatusForLevel,
 -              partitionedMigrations.get(dl), dl);
 +          params = BalanceParamsImpl.fromThrift(statusForBalancerLevel, 
tServerGroupingForBalancer,
-               tserverStatusForLevel, partitionedMigrations.get(dl));
++              tserverStatusForLevel, partitionedMigrations.get(dl), dl);
            wait = Math.max(tabletBalancer.balance(params), wait);
            migrationsOutForLevel = 0;
            for (TabletMigration m : 
checkMigrationSanity(statusForBalancerLevel.keySet(),
diff --cc 
test/src/test/java/org/apache/accumulo/test/ChaoticLoadBalancerTest.java
index 38a3be8b30,65b3c44bc0..ee0fa0ccd0
--- a/test/src/test/java/org/apache/accumulo/test/ChaoticLoadBalancerTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/ChaoticLoadBalancerTest.java
@@@ -159,10 -158,8 +160,10 @@@ public class ChaoticLoadBalancerTest 
      // amount, or even expected amount
      List<TabletMigration> migrationsOut = new ArrayList<>();
      while (!migrationsOut.isEmpty()) {
 -      balancer.balance(new BalanceParamsImpl(getAssignments(servers), 
migrations, migrationsOut,
 -          DataLevel.USER));
 +      SortedMap<TabletServerId,TServerStatus> current = 
getAssignments(servers);
 +      balancer.balance(new BalanceParamsImpl(current,
 +          Map.of(Constants.DEFAULT_RESOURCE_GROUP_NAME, current.keySet()), 
migrations,
-           migrationsOut));
++          migrationsOut, DataLevel.USER));
      }
    }
  

Reply via email to