Examples of TajoClient


Examples of org.apache.tajo.client.TajoClient

      if (catalog != null) {
        targetCatalogs.add(catalog);
      }

      try {
        TajoClient tajoClient = conn.getTajoClient();

        // if catalog is null, all databases are targets.
        if (targetCatalogs.isEmpty()) {
          targetCatalogs.addAll(tajoClient.getAllDatabaseNames());
        }

        for (String databaseName : targetCatalogs) {
          List<String> tableNames = tajoClient.getTableList(databaseName);
          for (String eachTableName: tableNames) {
            if (eachTableName.matches(regtableNamePattern)) {
              MetaDataTuple tuple = new MetaDataTuple(5);

              int index = 0;
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

        tajoConf.set(entry.getKey().toString(), entry.getValue().toString());
      }
    }

    try {
      tajoClient = new TajoClient(hostName, port, databaseName);
    } catch (Exception e) {
      throw new SQLException("Cannot create TajoClient instance:" + e.getMessage(), "TAJO-002");
    }
    closed.set(false);
  }
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

  protected String dataDir;

  public void init(TajoConf conf, String dataDir) throws IOException {
    this.dataDir = dataDir;
    if (System.getProperty(ConfVars.WORKER_PEER_RPC_ADDRESS.varname) != null) {
      tajo = new TajoClient(NetUtils.createSocketAddr(
          System.getProperty(ConfVars.WORKER_PEER_RPC_ADDRESS.varname)));
    } else {
      conf.set(CatalogConstants.STORE_CLASS, MemStore.class.getCanonicalName());
      tajo = new TajoClient(conf);
    }
  }
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

        break;
      }
      Thread.sleep(1000);
    }
    TajoConf conf = util.getConfiguration();
    TajoClient client = new TajoClient(conf);

    FileSystem fs = util.getDefaultFileSystem();
    Path rootDir = util.getMaster().
        getStorageManager().getWarehouseDir();
    fs.mkdirs(rootDir);
    for (int i = 0; i < names.length; i++) {
      Path tablePath = new Path(rootDir, names[i]);
      fs.mkdirs(tablePath);
      Path dfsPath = new Path(tablePath, names[i] + ".tbl");
      FSDataOutputStream out = fs.create(dfsPath);
      for (int j = 0; j < tables[i].length; j++) {
        out.write((tables[i][j]+"\n").getBytes());
      }
      out.close();
      TableMeta meta = CatalogUtil.newTableMeta(CatalogProtos.StoreType.CSV, option);
      client.createExternalTable(names[i], schemas[i], tablePath, meta);
    }
    Thread.sleep(1000);
    ResultSet res = client.executeQueryAndGetResult(query);
    return res;
  }
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.