Exemplo n.º 1
0
  @Override
  public ExecStatus execute(CloudataConf conf) {
    ExecStatus status = new ExecStatus();
    try {
      int tableLength = 0;

      TableSchema[] tables = CTable.listTables(conf);
      tableLength = tables.length;
      if (tableLength == 0) {
        status.setMessage("Table not found.");
        return status;
      }

      Shell.printHead("Table Name");
      for (int i = 0; i < tableLength; i++) {
        // String tableName = tables[i].getTableName().toString();
        Shell.printTable(i, tables[i]);
      }
      Shell.printFoot();

      status.setMessage(tableLength + " table(s) found.");
    } catch (IOException e) {
      status.setException(e);
    }

    return status;
  }