private static void stopTabletServer(final ClientContext context, List<String> servers,
final boolean force) throws AccumuloException, AccumuloSecurityException {
if (context.getMasterLocations().size() == 0) {
log.info("No masters running. Not attempting safe unload of tserver.");
return;
}
final String zTServerRoot = getTServersZkPath(context);
final ZooCache zc = context.getZooCache();
for (String server : servers) {
for (int port : context.getConfiguration().getPort(Property.TSERV_CLIENTPORT)) {
HostAndPort address = AddressUtil.parseAddress(server, port);
final String finalServer = qualifyWithZooKeeperSessionId(zTServerRoot, zc,
address.toString());
log.info("Stopping server {}", finalServer);
MasterClient.executeVoid(context, client -> client.shutdownTabletServer(Tracer.traceInfo(),
context.rpcCreds(), finalServer, force));
}
}
}