Examples of TableInfo


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

    total.queryRate += more.queryRate;
    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);
View Full Code Here

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

      indexCacheRequestTracker.startingUpdates();
      dataCacheHitTracker.startingUpdates();
      dataCacheRequestTracker.startingUpdates();
     
      for (TabletServerStatus server : mmi.tServerInfo) {
        TableInfo summary = Monitor.summarizeTableStats(server);
        totalIngestRate += summary.ingestRate;
        totalIngestByteRate += summary.ingestByteRate;
        totalQueryRate += summary.queryRate;
        totalQueryByteRate += summary.queryByteRate;
        totalEntries += summary.recs;
View Full Code Here

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

      onlineTabletsCopy = new HashMap<KeyExtent,Tablet>(this.onlineTablets);
    }
    Map<String,TableInfo> tables = new HashMap<String,TableInfo>();
    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);
    }

    ArrayList<KeyExtent> offlineTabletsCopy = new ArrayList<KeyExtent>();
    synchronized (this.unopenedTablets) {
      synchronized (this.openingTablets) {
        offlineTabletsCopy.addAll(this.unopenedTablets);
        offlineTabletsCopy.addAll(this.openingTablets);
      }
    }

    for (KeyExtent extent : offlineTabletsCopy) {
      String tableId = extent.getTableId().toString();
      TableInfo table = tables.get(tableId);
      if (table == null) {
        table = new TableInfo();
        tables.put(tableId, table);
      }
      table.tablets++;
    }
View Full Code Here

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

 
  @Override
  public String format(Object obj) {
    if (obj == null)
      return "-";
    TableInfo summary = (TableInfo) obj;
    Compacting c = summary.majors;
    if (fieldName.equals("minor"))
      c = summary.minors;
    else if (fieldName.equals("scans"))
      c = summary.scans;
View Full Code Here

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

      }
    }
    if (stats.tableMap != null && stats.tableMap.size() > 0) {
      out(0, "Tables");
      for (Entry<String,TableInfo> entry : stats.tableMap.entrySet()) {
        TableInfo v = entry.getValue();
        out(1, "%s", entry.getKey());
        out(2, "Records: %d", v.recs);
        out(2, "Records in Memory: %d", v.recsInMemory);
        out(2, "Tablets: %d", v.tablets);
        out(2, "Online Tablets: %d", v.onlineTablets);
        out(2, "Ingest Rate: %.2f", v.ingestRate);
        out(2, "Query Rate: %.2f", v.queryRate);
      }
    }
    if (stats.tServerInfo != null && stats.tServerInfo.size() > 0) {
      out(0, "Tablet Servers");
      long now = System.currentTimeMillis();
      for (TabletServerStatus server : stats.tServerInfo) {
        TableInfo summary = Monitor.summarizeTableStats(server);
        out(1, "Name: %s", server.name);
        out(2, "Ingest: %.2f", summary.ingestRate);
        out(2, "Last Contact: %s", server.lastContact);
        out(2, "OS Load Average: %.2f", server.osLoad);
        out(2, "Queries: %.2f", summary.queryRate);
        out(2, "Time Difference: %.1f", ((now - server.lastContact) / 1000.));
        out(2, "Total Records: %d", summary.recs);
        out(2, "Lookups: %d", server.lookups);
        if (server.holdTime > 0)
          out(2, "Hold Time: %d", server.holdTime);
        if (server.tableMap != null && server.tableMap.size() > 0) {
          out(2, "Tables");
          for (Entry<String,TableInfo> status : server.tableMap.entrySet()) {
            TableInfo info = status.getValue();
            out(3, "Table: %s", status.getKey());
            out(4, "Tablets: %d", info.onlineTablets);
            out(4, "Records: %d", info.recs);
            out(4, "Records in Memory: %d", info.recsInMemory);
            out(4, "Ingest: %.2f", info.ingestRate);
View Full Code Here

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

    @Override
    public MasterMonitorInfo getMasterStats(TInfo info, TCredentials credentials) throws ThriftSecurityException, TException {
      final MasterMonitorInfo result = new MasterMonitorInfo();
     
      result.tServerInfo = new ArrayList<TabletServerStatus>();
      result.tableMap = new DefaultMap<String,TableInfo>(new TableInfo());
      for (Entry<TServerInstance,TabletServerStatus> serverEntry : tserverStatus.entrySet()) {
        final TabletServerStatus status = serverEntry.getValue();
        result.tServerInfo.add(status);
        for (Entry<String,TableInfo> entry : status.tableMap.entrySet()) {
          String table = entry.getKey();
          TableInfo summary = result.tableMap.get(table);
          Monitor.add(summary, entry.getValue());
        }
      }
      result.badTServers = new HashMap<String,Byte>();
      synchronized (badServers) {
View Full Code Here

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

    }
    Map<String,TableInfo> tables = new HashMap<String,TableInfo>();
   
    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);
    }
   
    ArrayList<KeyExtent> offlineTabletsCopy = new ArrayList<KeyExtent>();
    synchronized (this.unopenedTablets) {
      synchronized (this.openingTablets) {
        offlineTabletsCopy.addAll(this.unopenedTablets);
        offlineTabletsCopy.addAll(this.openingTablets);
      }
    }
   
    for (KeyExtent extent : offlineTabletsCopy) {
      String tableId = extent.getTableId().toString();
      TableInfo table = tables.get(tableId);
      if (table == null) {
        table = new TableInfo();
        tables.put(tableId, table);
      }
      table.tablets++;
    }
   
View Full Code Here

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

    total.queryByteRate += more.queryByteRate;
    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);
View Full Code Here

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

        indexCacheRequestTracker.startingUpdates();
        dataCacheHitTracker.startingUpdates();
        dataCacheRequestTracker.startingUpdates();
       
        for (TabletServerStatus server : mmi.tServerInfo) {
          TableInfo summary = Monitor.summarizeTableStats(server);
          totalIngestRate += summary.ingestRate;
          totalIngestByteRate += summary.ingestByteRate;
          totalQueryRate += summary.queryRate;
          totalScanRate += summary.scanRate;
          totalQueryByteRate += summary.queryByteRate;
View Full Code Here

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

      sb.append("\n<server id='").append(status.name).append("'>\n");
      sb.append("<hostname>").append(TServerLinkType.displayName(status.name)).append("</hostname>");
      sb.append("<lastContact>").append(System.currentTimeMillis() - status.lastContact).append("</lastContact>\n");
      sb.append("<osload>").append(status.osLoad).append("</osload>\n");
     
      TableInfo summary = Monitor.summarizeTableStats(status);
      sb.append("<compactions>\n");
      sb.append("<major>").append("<running>").append(summary.majors.running).append("</running>").append("<queued>").append(summary.majors.queued)
          .append("</queued>").append("</major>\n");
      sb.append("<minor>").append("<running>").append(summary.minors.running).append("</running>").append("<queued>").append(summary.minors.queued)
          .append("</queued>").append("</minor>\n");
      sb.append("</compactions>\n");
     
      sb.append("<tablets>").append(summary.tablets).append("</tablets>\n");
     
      sb.append("<ingest>").append(summary.ingestRate).append("</ingest>\n");
      sb.append("<query>").append(summary.queryRate).append("</query>\n");
      sb.append("<ingestMB>").append(summary.ingestByteRate / 1000000.0).append("</ingestMB>\n");
      sb.append("<queryMB>").append(summary.queryByteRate / 1000000.0).append("</queryMB>\n");
      sb.append("<scans>").append(summary.scans.running + summary.scans.queued).append("</scans>");
      sb.append("<scansessions>").append(Monitor.getLookupRate()).append("</scansessions>\n");
      sb.append("<holdtime>").append(status.holdTime).append("</holdtime>\n");
      totalIngest += summary.ingestRate;
      totalQuery += summary.queryRate;
      totalEntries += summary.recs;
      sb.append("</server>\n");
    }
    sb.append("\n</servers>\n");
   
    sb.append("\n<masterGoalState>" + Monitor.getMmi().goalState + "</masterGoalState>\n");
    sb.append("\n<masterState>" + Monitor.getMmi().state + "</masterState>\n");
   
    sb.append("\n<badTabletServers>\n");
    for (Entry<String,Byte> entry : Monitor.getMmi().badTServers.entrySet()) {
      sb.append(String.format("<badTabletServer id='%s' status='%s'/>\n", entry.getKey(), TabletServerState.getStateById(entry.getValue())));
    }
    sb.append("\n</badTabletServers>\n");
   
    sb.append("\n<tabletServersShuttingDown>\n");
    for (String server : Monitor.getMmi().serversShuttingDown) {
      sb.append(String.format("<server id='%s'/>\n", server));
    }
    sb.append("\n</tabletServersShuttingDown>\n");
   
    sb.append(String.format("\n<unassignedTablets>%d</unassignedTablets>\n", Monitor.getMmi().unassignedTablets));
   
    sb.append("\n<deadTabletServers>\n");
    for (DeadServer dead : Monitor.getMmi().deadTabletServers) {
      sb.append(String.format("<deadTabletServer id='%s' lastChange='%d' status='%s'/>\n", dead.server, dead.lastStatus, dead.status));
    }
    sb.append("\n</deadTabletServers>\n");
   
    sb.append("\n<deadLoggers>\n");
    for (DeadServer dead : Monitor.getMmi().deadTabletServers) {
      sb.append(String.format("<deadLogger id='%s' lastChange='%d' status='%s'/>\n", dead.server, dead.lastStatus, dead.status));
    }
    sb.append("\n</deadLoggers>\n");
   
    sb.append("\n<tables>\n");
    Instance instance = HdfsZooInstance.getInstance();
    for (Entry<String,TableInfo> entry : tableStats.entrySet()) {
      TableInfo tableInfo = entry.getValue();
     
      sb.append("\n<table>\n");
      String tableId = entry.getKey();
      String tableName = "unknown";
      String tableState = "unknown";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.