use of org.apache.accumulo.core.manager.thrift.ManagerMonitorInfo in project accumulo by apache.
the class Manager method getManagerMonitorInfo.
public ManagerMonitorInfo getManagerMonitorInfo() {
final ManagerMonitorInfo result = new ManagerMonitorInfo();
result.tServerInfo = new ArrayList<>();
result.tableMap = new HashMap<>();
for (Entry<TServerInstance, TabletServerStatus> serverEntry : tserverStatus.entrySet()) {
final TabletServerStatus status = serverEntry.getValue();
result.tServerInfo.add(status);
for (Entry<String, TableInfo> entry : status.tableMap.entrySet()) {
TableInfoUtil.add(result.tableMap.computeIfAbsent(entry.getKey(), k -> new TableInfo()), entry.getValue());
}
}
result.badTServers = new HashMap<>();
synchronized (badServers) {
for (TServerInstance bad : badServers.keySet()) {
result.badTServers.put(bad.getHostPort(), TabletServerState.UNRESPONSIVE.getId());
}
}
result.state = getManagerState();
result.goalState = getManagerGoalState();
result.unassignedTablets = displayUnassigned();
result.serversShuttingDown = new HashSet<>();
synchronized (serversToShutdown) {
for (TServerInstance server : serversToShutdown) {
result.serversShuttingDown.add(server.getHostPort());
}
}
DeadServerList obit = new DeadServerList(getContext());
result.deadTabletServers = obit.getList();
result.bulkImports = bulkImportStatus.getBulkLoadStatus();
return result;
}
Aggregations