// TODO move this to isReady() and drop while loop? - ACCUMULO-1259
Listener listener = master.getEventCoordinator().getListener();
master.shutdownTServer(server);
while (master.onlineTabletServers().contains(server)) {
TServerConnection connection = master.getConnection(server);
if (connection != null) {
try {
TabletServerStatus status = connection.getTableMap(false);
if (status.tableMap != null && status.tableMap.isEmpty()) {
log.info("tablet server hosts no tablets " + server);
connection.halt(master.getMasterLock());
log.info("tablet server asked to halt " + server);
break;
}
} catch (TTransportException ex) {
// expected