use of org.apache.accumulo.manager.state.TableCounts in project accumulo by apache.
the class Manager method displayUnassigned.
// The number of unassigned tablets that should be assigned: displayed on the monitor page
int displayUnassigned() {
int result = 0;
switch(getManagerState()) {
case NORMAL:
// Count offline tablets for online tables
for (TabletGroupWatcher watcher : watchers) {
TableManager manager = getContext().getTableManager();
for (Entry<TableId, TableCounts> entry : watcher.getStats().entrySet()) {
TableId tableId = entry.getKey();
TableCounts counts = entry.getValue();
if (manager.getTableState(tableId) == TableState.ONLINE) {
result += counts.unassigned() + counts.assignedToDeadServers() + counts.assigned() + counts.suspended();
}
}
}
break;
case SAFE_MODE:
// Count offline tablets for the metadata table
for (TabletGroupWatcher watcher : watchers) {
TableCounts counts = watcher.getStats(MetadataTable.ID);
result += counts.unassigned() + counts.suspended();
}
break;
case UNLOAD_METADATA_TABLETS:
case UNLOAD_ROOT_TABLET:
for (TabletGroupWatcher watcher : watchers) {
TableCounts counts = watcher.getStats(MetadataTable.ID);
result += counts.unassigned() + counts.suspended();
}
break;
default:
break;
}
return result;
}
use of org.apache.accumulo.manager.state.TableCounts in project accumulo by apache.
the class Manager method assignedOrHosted.
private int assignedOrHosted(TableId tableId) {
int result = 0;
for (TabletGroupWatcher watcher : watchers) {
TableCounts count = watcher.getStats(tableId);
result += count.hosted() + count.assigned();
}
return result;
}
Aggregations