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