Search in sources :

Example 1 with TableCounts

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;
}
Also used : TableId(org.apache.accumulo.core.data.TableId) TableManager(org.apache.accumulo.server.tables.TableManager) TableCounts(org.apache.accumulo.manager.state.TableCounts)

Example 2 with TableCounts

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;
}
Also used : TableCounts(org.apache.accumulo.manager.state.TableCounts)

Aggregations

TableCounts (org.apache.accumulo.manager.state.TableCounts)2 TableId (org.apache.accumulo.core.data.TableId)1 TableManager (org.apache.accumulo.server.tables.TableManager)1