Examples of Table


Examples of com.spotify.helios.cli.Table

      if (json) {
        final Map<String, HostStatus> sorted = Maps.newTreeMap();
        sorted.putAll(allAsMap(statuses));
        out.println(Json.asPrettyStringUnchecked(sorted));
      } else {
        final Table table = table(out);
        table.row("HOST", "STATUS", "DEPLOYED", "RUNNING",
                  "CPUS", "MEM", "LOAD AVG", "MEM USAGE", "OS", "HELIOS", "DOCKER");

        for (final Map.Entry<String, ListenableFuture<HostStatus>> e : statuses.entrySet()) {

          final String host = e.getKey();
          final HostStatus s = e.getValue().get();

          if (s == null) {
            continue;
          }

          final Set<TaskStatus> runningDeployedJobs = Sets.newHashSet();
          for (final JobId jobId : s.getJobs().keySet()) {
            final TaskStatus taskStatus = s.getStatuses().get(jobId);
            if (taskStatus == null) {
              continue;
            }
            if (taskStatus.getState() == TaskStatus.State.RUNNING) {
              runningDeployedJobs.add(taskStatus);
            }
          }

          final HostInfo hi = s.getHostInfo();
          final String memUsage;
          final String cpus;
          final String mem;
          final String loadAvg;
          final String os;
          final String docker;
          if (hi != null) {
            final long free = hi.getMemoryFreeBytes();
            final long total = hi.getMemoryTotalBytes();
            memUsage = format("%.2f", (float) (total - free) / total);
            cpus = String.valueOf(hi.getCpus());
            mem = hi.getMemoryTotalBytes() / (1024 * 1024 * 1024) + " gb";
            loadAvg = format("%.2f", hi.getLoadAvg());
            os = hi.getOsName() + " " + hi.getOsVersion();
            final DockerVersion dv = hi.getDockerVersion();
            docker = (dv != null) ? format("%s (%s)", dv.getVersion(), dv.getApiVersion()) : "";
          } else {
            memUsage = cpus = mem = loadAvg = os = docker = "";
          }

          final String version;
          if (s.getAgentInfo() != null) {
            version = Optional.fromNullable(s.getAgentInfo().getVersion()).or("");
          } else {
            version = "";
          }

          String status = s.getStatus() == UP ? "Up" : "Down";
          if (s.getAgentInfo() != null) {
            final long startTime = s.getAgentInfo().getStartTime();
            final long upTime = s.getAgentInfo().getUptime();
            if (s.getStatus() == UP) {
              status += " " + humanDuration(currentTimeMillis() - startTime);
            } else {
              status += " " + humanDuration(currentTimeMillis() - startTime - upTime);
            }
          }

          table.row(formatHostname(full, host), status, s.getJobs().size(),
                    runningDeployedJobs.size(), cpus, mem, loadAvg, memUsage, os, version, docker);
        }

        table.print();
      }
    }
    return 0;
  }
View Full Code Here

Examples of com.threerings.parlor.data.Table

        if (_boidMap.containsKey(creator.getOid())) {
            throw new InvocationException(ALREADY_AT_TABLE);
        }

        // create a brand spanking new table
        Table table;
        try {
            table = _tableClass.newInstance();
        } catch (Exception e) {
            log.warning("Table.newInstance() failed", "class", _tableClass, e);
            throw new InvocationException(INTERNAL_ERROR);
        }
        table.init(_dobj.getOid(), tableConfig, config);

        if (table.bodyOids != null && table.bodyOids.length > 0) {
            // stick the creator into the first non-AI position
            int cpos = (config.ais == null) ? 0 : config.ais.length;
            String error = table.setPlayer(cpos, creator);
            if (error != null) {
                log.warning("Unable to add creator to position zero of table!?",
                   "table", table, "creator", creator, "error", error);
                // bail out now and abort the table creation process
                throw new InvocationException(error);
            }

            // make a mapping from the creator to this table
            notePlayerAdded(table, creator);
        }

        // stick the table into our tables tables
        _tables.put(table.tableId, table);

        // if the table has only one seat, start the game immediately
        if (table.shouldBeStarted()) {
            createGame(table);
        }

        // wire our table into our bits
        tableCreated(table);
View Full Code Here

Examples of com.tinkerpop.gremlin.pipes.util.Table


    public static Iterable getRepresentation(final Object result) {
        if (result instanceof Iterable) {
            if (result instanceof Table) {
                final Table table = (Table) result;
                return new IterableWrapper<Map<String,Object>,Table.Row>(table) {
                    @Override
                    protected Map<String, Object> underlyingObjectToObject(Table.Row row) {
                        Map<String,Object> result=new LinkedHashMap<String, Object>();
                        for (String column : table.getColumnNames()) {
                            result.put(column, row.getColumn(column));
                        }
                        return result;
                    }
                };
View Full Code Here

Examples of com.tinkerpop.pipes.util.structures.Table

     *
     * @param columnFunctions the post-processing function for each column
     * @return the extended Pipeline
     */
    public GremlinPipeline<S, E> table(final PipeFunction... columnFunctions) {
        return this.add(new TablePipe(new Table(), null, FluentUtility.getAsPipes(this), FluentUtility.prepareFunctions(this.asMap, columnFunctions)));
    }
View Full Code Here

Examples of com.vaadin.ui.Table

        text.addStyleName(Bootstrap.Typography.TEXT_INFO.styleName());
        container.addComponent(text);
    }

    private void tables(CssLayout container) {
        Table table = getSampleTable("");
        container.addComponent(table);

        table = getSampleTable("Striped");
        table.addStyleName(Bootstrap.Tables.STRIPED.styleName());
        container.addComponent(table);

        table = getSampleTable("Bordered");
        table.addStyleName(Bootstrap.Tables.BORDERED.styleName());
        container.addComponent(table);

        table = getSampleTable("Hover rows");
        table.addStyleName(Bootstrap.Tables.HOVER.styleName());
        container.addComponent(table);

        table = getSampleTable("Condensed");
        table.addStyleName(Bootstrap.Tables.CONDENSED.styleName());
        container.addComponent(table);
    }
View Full Code Here

Examples of com.woorea.openstack.console.utils.Table

  @Override
  public void execute(Nova nova, CommandLine cmd) {
   
    final Servers servers = nova.servers().list(true).execute();
   
    Table t = new Table(new TableModel<Server>(servers.getList()) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
          new Column("name", 10, Column.ALIGN_LEFT)
        };
      }

      @Override
      public String[] getRow(Server server) {
        return new String[]{
          server.getId(),
          server.getName()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.db.meta.Table

   * @param tableName 表名
   * @return Table对象
   */
  @SuppressWarnings("resource")
  public static Table getTableMeta(DataSource ds, String tableName) {
    final Table table = Table.create(tableName);
    Connection conn = null;
    ResultSet rs = null;
    try {
      conn = ds.getConnection();
      final DatabaseMetaData metaData = conn.getMetaData();
      //获得主键
      rs = metaData.getPrimaryKeys(conn.getCatalog(), null, tableName);
      while(rs.next()) {
        table.addPk("COLUMN_NAME");
      }
     
      //获得列
      rs = metaData.getColumns(conn.getCatalog(), null, tableName, null);
      while(rs.next()) {
        table.setColumn(Column.create(tableName, rs));
      }
    } catch (Exception e) {
      throw new UtilException("Get columns error!", e);
    }finally {
      close(rs, conn);
View Full Code Here

Examples of de.mhus.lib.adb.model.Table

      } catch (Throwable t) {
        throw new MException(t);
      }
    }
   
    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);
   
    try {
      Object out = c.getObject(con,keys);
     
      if (myCon != null) {
        try {
          myCon.commit();
        } catch (Throwable t) {
View Full Code Here

Examples of edu.isi.karma.rep.Table

      }

      /**
       * Add the data *
       */
      Table dataTable = getWorksheet().getDataTable();
      for (int i = 1; i < data.size(); i++)
      {
        Row row = dataTable.addRow(getFactory());
        ArrayList<String> rowData = data.get(i);
        for (int j = 0; j < rowData.size(); j++)
        {
          row.setValue(headersList.get(j), rowData.get(j), getFactory());
        }
View Full Code Here

Examples of edu.isi.karma.rep.sources.Table

   
    InvocationManager invocatioManager;
    try {
      invocatioManager = new InvocationManager(null, requestURLString);
      logger.info("Requesting data with includeURL=" + true + ",includeInput=" + true + ",includeOutput=" + true);
      Table serviceTable = invocatioManager.getServiceData(false, false, true);
      logger.debug(serviceTable.getPrintInfo());
      logger.info("The service " + service.getUri() + " has been invoked successfully.");
      return serviceTable;

    } catch (MalformedURLException e) {
      logger.error("Malformed service request URL.");
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.