Search in sources :

Example 1 with CompactionsList

use of org.apache.accumulo.monitor.rest.tables.CompactionsList in project accumulo by apache.

the class TabletServerInformation method updateTabletServerInfo.

/**
 * Generate tserver information from thrift status and table summary
 *
 * @param thriftStatus
 *          Thrift status to obtain information
 * @param summary
 *          Table info summary
 */
public void updateTabletServerInfo(TabletServerStatus thriftStatus, TableInfo summary) {
    long now = System.currentTimeMillis();
    this.server = this.ip = this.hostname = thriftStatus.name;
    this.tablets = summary.tablets;
    this.lastContact = now - thriftStatus.lastContact;
    this.responseTime = thriftStatus.responseTime;
    this.entries = summary.recs;
    this.ingest = cleanNumber(summary.ingestRate);
    this.query = cleanNumber(summary.queryRate);
    this.holdtime = thriftStatus.holdTime;
    this.scansRunning = summary.scans != null ? summary.scans.running : 0;
    this.scansQueued = summary.scans != null ? summary.scans.queued : 0;
    this.scansCombo = scansRunning + "(" + scansQueued + ")";
    this.scans = this.scansRunning;
    this.scansCompacting = new CompactionsList(this.scansRunning, this.scansQueued);
    this.minorRunning = summary.minors != null ? summary.minors.running : 0;
    this.minorQueued = summary.minors != null ? summary.minors.queued : 0;
    this.minorCombo = minorRunning + "(" + minorQueued + ")";
    this.minor = new CompactionsList(this.minorRunning, this.minorQueued);
    this.majorRunning = summary.majors != null ? summary.majors.running : 0;
    this.majorQueued = summary.majors != null ? summary.majors.queued : 0;
    this.majorCombo = majorRunning + "(" + majorQueued + ")";
    this.major = new CompactionsList(this.majorRunning, this.majorQueued);
    this.compactions = new CompactionsTypes(scansCompacting, major, minor);
    this.osload = thriftStatus.osLoad;
    this.version = thriftStatus.version;
    this.lookups = thriftStatus.lookups;
    this.dataCacheHits = thriftStatus.dataCacheHits;
    this.dataCacheRequests = thriftStatus.dataCacheRequest;
    this.indexCacheHits = thriftStatus.indexCacheHits;
    this.indexCacheRequests = thriftStatus.indexCacheRequest;
    this.indexCacheHitRate = this.indexCacheHits / (double) Math.max(this.indexCacheRequests, 1);
    this.dataCacheHitRate = this.dataCacheHits / (double) Math.max(this.dataCacheRequests, 1);
    this.ingestMB = cleanNumber(summary.ingestByteRate);
    this.queryMB = cleanNumber(summary.queryByteRate);
    this.scansessions = Monitor.getLookupRate();
    // For backwards compatibility
    this.scanssessions = this.scansessions;
    this.logRecoveries = new ArrayList<>(thriftStatus.logSorts.size());
    for (RecoveryStatus recovery : thriftStatus.logSorts) {
        logRecoveries.add(new RecoveryStatusInformation(recovery));
    }
}
Also used : CompactionsTypes(org.apache.accumulo.monitor.rest.tables.CompactionsTypes) RecoveryStatus(org.apache.accumulo.core.master.thrift.RecoveryStatus) CompactionsList(org.apache.accumulo.monitor.rest.tables.CompactionsList) RecoveryStatusInformation(org.apache.accumulo.monitor.rest.trace.RecoveryStatusInformation)

Aggregations

RecoveryStatus (org.apache.accumulo.core.master.thrift.RecoveryStatus)1 CompactionsList (org.apache.accumulo.monitor.rest.tables.CompactionsList)1 CompactionsTypes (org.apache.accumulo.monitor.rest.tables.CompactionsTypes)1 RecoveryStatusInformation (org.apache.accumulo.monitor.rest.trace.RecoveryStatusInformation)1