Examples of TajoClient


Examples of org.apache.tajo.client.TajoClient

    if ((hostName == null) ^ (port == null)) {
      System.err.println("ERROR: cannot find valid Tajo server address");
      throw new RuntimeException("cannot find valid Tajo server address");
    } else if (hostName != null && port != null) {
      conf.setVar(ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS, hostName+":"+port);
      client = new TajoClient(conf, baseDatabase);
    } else if (hostName == null && port == null) {
      client = new TajoClient(conf, baseDatabase);
    }

    context = new TajoCliContext();
    context.setCurrentDatabase(client.getCurrentDatabase());
    initHistory();
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

    LOG.info("===================================================");

    util = new TajoTestingCluster();
    util.startMiniCluster(1);
    conf = util.getConfiguration();
    client = new TajoClient(conf);

    FileSystem fs = util.getDefaultFileSystem();
    Path rootDir = util.getMaster().getStorageManager().getWarehouseDir();
    fs.mkdirs(rootDir);
    for (int i = 0; i < tablepaths.length; i++) {
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

    if ((hostName == null) ^ (port == null)) {
      System.err.println("ERROR: cannot find valid Tajo server address");
      System.exit(-1);
    } else if (hostName != null && port != null) {
      conf.setVar(ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS, hostName+":"+port);
      client = new TajoClient(conf);
    } else if (hostName == null && port == null) {
      client = new TajoClient(conf);
    }

    initHistory();
    initCommands();
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

  public void init(ServletConfig config) throws ServletException {
    om.getDeserializationConfig().disable(
        DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES);

    try {
      tajoClient = new TajoClient(new TajoConf());

      queryRunnerCleaner = new QueryRunnerCleaner();
      queryRunnerCleaner.start();
    } catch (IOException e) {
      LOG.error(e.getMessage());
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

                                     String[][] tables,
                                     String query) throws Exception {
    TajoTestingCluster util = new TajoTestingCluster();
    util.startMiniClusterInLocal(1);
    TajoConf conf = util.getConfiguration();
    TajoClient client = new TajoClient(conf);

    File tmpDir = util.setupClusterTestBuildDir();
    for (int i = 0; i < tableNames.length; i++) {
      File tableDir = new File(tmpDir,tableNames[i]);
      tableDir.mkdirs();
      File tableFile = new File(tableDir, tableNames[i]);
      writeLines(tableFile, tables[i]);
      TableMeta meta = CatalogUtil
          .newTableMeta(schemas[i], CatalogProtos.StoreType.CSV, option);
      client.createExternalTable(tableNames[i], new Path(tableDir.getAbsolutePath()), meta);
    }
    Thread.sleep(1000);
    ResultSet res = client.executeQueryAndGetResult(query);
    util.shutdownMiniCluster();
    return res;
  }
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(schemas[i],
          CatalogProtos.StoreType.CSV, option);
      client.createExternalTable(names[i], tablePath, meta);
    }
    Thread.sleep(1000);
    ResultSet res = client.executeQueryAndGetResult(query);
    return res;
  }
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

  public void init(ServletConfig config) throws ServletException {
    om.getDeserializationConfig().disable(
        DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES);

    try {
      tajoClient = new TajoClient(new TajoConf());

      queryRunnerCleaner = new QueryRunnerCleaner();
      queryRunnerCleaner.start();
    } catch (IOException e) {
      LOG.error(e.getMessage());
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

  @Rule public TestName name = new TestName();

  @BeforeClass
  public static void setUpClass() throws IOException {
    conf = testBase.getTestingCluster().getConfiguration();
    client = new TajoClient(conf);
  }
View Full Code Here

Examples of org.apache.tajo.client.TajoClient

    LOG.info("===================================================");

    util = new TajoTestingCluster();
    util.startMiniCluster(1);
    conf = util.getConfiguration();
    client = new TajoClient(conf);

    FileSystem fs = util.getDefaultFileSystem();
    Path rootDir = util.getMaster().getStorageManager().getWarehouseDir();
    fs.mkdirs(rootDir);
    for (int i = 0; i < tablepaths.length; i++) {
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.