Search in sources :

Example 1 with ScanStats

use of org.apache.accumulo.monitor.Monitor.ScanStats in project accumulo by apache.

the class ScansResource method getTables.

/**
 * Generates a new JSON object with scan information
 *
 * @return Scan JSON object
 */
@GET
public Scans getTables() {
    Scans scans = new Scans();
    Map<HostAndPort, ScanStats> entry = Monitor.getScans();
    // Adds new scans to the array
    for (TabletServerStatus tserverInfo : Monitor.getMmi().getTServerInfo()) {
        ScanStats stats = entry.get(HostAndPort.fromString(tserverInfo.name));
        if (stats != null) {
            scans.addScan(new ScanInformation(tserverInfo, stats.scanCount, stats.oldestScan));
        }
    }
    return scans;
}
Also used : HostAndPort(org.apache.accumulo.core.util.HostAndPort) TabletServerStatus(org.apache.accumulo.core.master.thrift.TabletServerStatus) ScanStats(org.apache.accumulo.monitor.Monitor.ScanStats) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 TabletServerStatus (org.apache.accumulo.core.master.thrift.TabletServerStatus)1 HostAndPort (org.apache.accumulo.core.util.HostAndPort)1 ScanStats (org.apache.accumulo.monitor.Monitor.ScanStats)1