Package org.apache.accumulo.core.master.thrift

Examples of org.apache.accumulo.core.master.thrift.Compacting


    total.scanRate += more.scanRate;
  }
 
  public static TableInfo summarizeTableStats(TabletServerStatus status) {
    TableInfo summary = new TableInfo();
    summary.majors = new Compacting();
    summary.minors = new Compacting();
    summary.scans = new Compacting();
    for (TableInfo rates : status.tableMap.values()) {
      add(summary, rates);
    }
    return summary;
  }
View Full Code Here


      sb.append("<ingestByteRate>").append(tableInfo.ingestByteRate).append("</ingestByteRate>\n");
      sb.append("<query>").append(tableInfo.queryRate).append("</query>\n");
      sb.append("<queryByteRate>").append(tableInfo.queryRate).append("</queryByteRate>\n");
      int running = 0;
      int queued = 0;
      Compacting compacting = entry.getValue().majors;
      if (compacting != null) {
        running = compacting.running;
        queued = compacting.queued;
      }
      sb.append("<majorCompactions>").append("<running>").append(running).append("</running>").append("<queued>").append(queued).append("</queued>")
View Full Code Here

    for (Entry<KeyExtent,Tablet> entry : onlineTabletsCopy.entrySet()) {
      String tableId = entry.getKey().getTableId().toString();
      TableInfo table = tables.get(tableId);
      if (table == null) {
        table = new TableInfo();
        table.minors = new Compacting();
        table.majors = new Compacting();
        tables.put(tableId, table);
      }
      Tablet tablet = entry.getValue();
      long recs = tablet.getNumEntries();
      table.tablets++;
      table.onlineTablets++;
      table.recs += recs;
      table.queryRate += tablet.queryRate();
      table.queryByteRate += tablet.queryByteRate();
      table.ingestRate += tablet.ingestRate();
      table.ingestByteRate += tablet.ingestByteRate();
      table.scanRate += tablet.scanRate();
      long recsInMemory = tablet.getNumEntriesInMemory();
      table.recsInMemory += recsInMemory;
      if (tablet.minorCompactionRunning())
        table.minors.running++;
      if (tablet.minorCompactionQueued())
        table.minors.queued++;
      if (tablet.majorCompactionRunning())
        table.majors.running++;
      if (tablet.majorCompactionQueued())
        table.majors.queued++;
    }

    for (Entry<String,MapCounter<ScanRunState>> entry : scanCounts.entrySet()) {
      TableInfo table = tables.get(entry.getKey());
      if (table == null) {
        table = new TableInfo();
        tables.put(entry.getKey(), table);
      }

      if (table.scans == null)
        table.scans = new Compacting();

      table.scans.queued += entry.getValue().get(ScanRunState.QUEUED);
      table.scans.running += entry.getValue().get(ScanRunState.RUNNING);
    }
View Full Code Here

    for (Entry<KeyExtent,Tablet> entry : onlineTabletsCopy.entrySet()) {
      String tableId = entry.getKey().getTableId().toString();
      TableInfo table = tables.get(tableId);
      if (table == null) {
        table = new TableInfo();
        table.minor = new Compacting();
        table.major = new Compacting();
        tables.put(tableId, table);
      }
      Tablet tablet = entry.getValue();
      long recs = tablet.getNumEntries();
      table.tablets++;
      table.onlineTablets++;
      table.recs += recs;
      table.queryRate += tablet.queryRate();
      table.queryByteRate += tablet.queryByteRate();
      table.ingestRate += tablet.ingestRate();
      table.ingestByteRate += tablet.ingestByteRate();
      long recsInMemory = tablet.getNumEntriesInMemory();
      table.recsInMemory += recsInMemory;
      if (tablet.minorCompactionRunning())
        table.minor.running++;
      if (tablet.minorCompactionQueued())
        table.minor.queued++;
      if (tablet.majorCompactionRunning())
        table.major.running++;
      if (tablet.majorCompactionQueued())
        table.major.queued++;
    }
   
    for (Entry<String,MapCounter<ScanRunState>> entry : scanCounts.entrySet()) {
      TableInfo table = tables.get(entry.getKey());
      if (table == null) {
        table = new TableInfo();
        tables.put(entry.getKey(), table);
      }
     
      if (table.scans == null)
        table.scans = new Compacting();
     
      table.scans.queued += entry.getValue().get(ScanRunState.QUEUED);
      table.scans.running += entry.getValue().get(ScanRunState.RUNNING);
    }
   
View Full Code Here

    for (Entry<KeyExtent,Tablet> entry : onlineTabletsCopy.entrySet()) {
      String tableId = entry.getKey().getTableId().toString();
      TableInfo table = tables.get(tableId);
      if (table == null) {
        table = new TableInfo();
        table.minor = new Compacting();
        table.major = new Compacting();
        tables.put(tableId, table);
      }
      Tablet tablet = entry.getValue();
      long recs = tablet.getNumEntries();
      table.tablets++;
View Full Code Here

  @Override
  public String format(Object obj) {
    if (obj == null)
      return "-";
    TableInfo summary = (TableInfo) obj;
    Compacting c = summary.major;
    if (fieldName.equals("minor"))
      c = summary.minor;
    else if (fieldName.equals("scans"))
      c = summary.scans;
    if (c == null)
      c = new Compacting();
    return String.format("%s&nbsp;(%,d)", NumberType.commas(c.running, c.queued == 0 ? 0 : 1, summary.onlineTablets), c.queued);
  }
View Full Code Here

  public int compare(TableInfo o1, TableInfo o2) {
    if (o1 == null)
      return -1;
    if (o2 == null)
      return 1;
    Compacting c1 = o1.major;
    Compacting c2 = o2.major;
    if (fieldName.equals("minor")) {
      c1 = o1.minor;
      c2 = o2.minor;
    } else if (fieldName.equals("scans")) {
      c1 = o1.scans;
View Full Code Here

      sb.append("<ingestByteRate>").append(tableInfo.ingestByteRate).append("</ingestByteRate>\n");
      sb.append("<query>").append(tableInfo.queryRate).append("</query>\n");
      sb.append("<queryByteRate>").append(tableInfo.queryRate).append("</queryByteRate>\n");
      int running = 0;
      int queued = 0;
      Compacting compacting = entry.getValue().major;
      if (compacting != null) {
        running = compacting.running;
        queued = compacting.queued;
      }
      sb.append("<majorCompactions>").append("<running>").append(running).append("</running>").append("<queued>").append(queued).append("</queued>")
View Full Code Here

    return compactingByTable;
  }
 
  public static void add(TableInfo total, TableInfo more) {
    if (total.minor == null)
      total.minor = new Compacting();
    if (total.major == null)
      total.major = new Compacting();
    if (total.scans == null)
      total.scans = new Compacting();
    if (more.minor != null) {
      total.minor.running += more.minor.running;
      total.minor.queued += more.minor.queued;
    }
    if (more.major != null) {
View Full Code Here

    total.queryByteRate += more.queryByteRate;
  }
 
  public static TableInfo summarizeTableStats(TabletServerStatus status) {
    TableInfo summary = new TableInfo();
    summary.major = new Compacting();
    summary.minor = new Compacting();
    summary.scans = new Compacting();
    for (TableInfo rates : status.tableMap.values()) {
      add(summary, rates);
    }
    return summary;
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.master.thrift.Compacting

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.