Skip to content

Commit

Permalink
removes use of newly deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-turner committed Oct 17, 2024
1 parent 77643ec commit f01e6b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.admin.servers.ServerId;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
Expand Down Expand Up @@ -60,7 +61,8 @@ public Report runTest(final Environment env) throws Exception {
client.tableOperations().addSplits(TABLE_NAME, getSplits());
client.instanceOperations().waitForBalance();

int totalTabletServers = client.instanceOperations().getTabletServers().size();
int totalTabletServers =
client.instanceOperations().getServers(ServerId.Type.TABLET_SERVER).size();
int expectedAllocation = NUM_SPLITS / totalTabletServers;
int min = expectedAllocation - MARGIN;
int max = expectedAllocation + MARGIN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.concurrent.ThreadPoolExecutor;

import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.admin.servers.ServerId;
import org.apache.accumulo.testing.randomwalk.RandWalkEnv;
import org.apache.accumulo.testing.randomwalk.State;
import org.slf4j.Logger;
Expand All @@ -37,7 +38,7 @@ public static boolean shouldQueueOperation(State state, RandWalkEnv env) {
final ThreadPoolExecutor pool = (ThreadPoolExecutor) state.get("pool");
long queuedThreads = pool.getTaskCount() - pool.getActiveCount() - pool.getCompletedTaskCount();
final AccumuloClient client = env.getAccumuloClient();
int numTservers = client.instanceOperations().getTabletServers().size();
int numTservers = client.instanceOperations().getServers(ServerId.Type.TABLET_SERVER).size();

if (!shouldQueue(queuedThreads, numTservers)) {
log.info("Not queueing because of " + queuedThreads + " outstanding tasks");
Expand Down

0 comments on commit f01e6b1

Please sign in to comment.