Examples of QueryId


Examples of org.apache.tajo.QueryId

  public ResultSet executeQueryAndGetResult(String sql)
      throws ServiceException, IOException {
    QueryRequest.Builder builder = QueryRequest.newBuilder();
    builder.setQuery(sql);
    GetQueryStatusResponse response = tajoMasterService.submitQuery(null, builder.build());
    QueryId queryId = new QueryId(response.getQueryId());
    if (queryId.equals(QueryIdFactory.NULL_QUERY_ID)) {
      return this.createNullResultSet(queryId);
    } else {
      return this.getQueryResultAndWait(queryId);
    }
  }
View Full Code Here

Examples of org.apache.tajo.QueryId

  @Override
  public void statusUpdate(RpcController controller, TajoWorkerProtocol.TaskStatusProto request,
                           RpcCallback<PrimitiveProtos.BoolProto> done) {
    try {
      QueryMasterTask queryMasterTask = queryMaster.getQueryMasterTask(
          new QueryId(request.getId().getQueryUnitId().getExecutionBlockId().getQueryId()));
      queryMasterTask.getEventHandler().handle(
          new TaskAttemptStatusUpdateEvent(new QueryUnitAttemptId(request.getId()), request));
      done.run(TajoWorker.TRUE_PROTO);
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
View Full Code Here

Examples of org.apache.tajo.QueryId

  @Override
  public void fatalError(RpcController controller, TajoWorkerProtocol.TaskFatalErrorReport report,
                         RpcCallback<PrimitiveProtos.BoolProto> done) {
    try {
      QueryMasterTask queryMasterTask = queryMaster.getQueryMasterTask(
          new QueryId(report.getId().getQueryUnitId().getExecutionBlockId().getQueryId()));
      queryMasterTask.getEventHandler().handle(new TaskFatalErrorEvent(report));
      done.run(TajoWorker.TRUE_PROTO);
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
      done.run(TajoWorker.FALSE_PROTO);
View Full Code Here

Examples of org.apache.tajo.QueryId

  @Override
  public void done(RpcController controller, TajoWorkerProtocol.TaskCompletionReport report,
                   RpcCallback<PrimitiveProtos.BoolProto> done) {
    try {
      QueryMasterTask queryMasterTask = queryMaster.getQueryMasterTask(
          new QueryId(report.getId().getQueryUnitId().getExecutionBlockId().getQueryId()));
      queryMasterTask.getEventHandler().handle(new TaskCompletionEvent(report));
      done.run(TajoWorker.TRUE_PROTO);
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
      done.run(TajoWorker.FALSE_PROTO);
View Full Code Here

Examples of org.apache.tajo.QueryId

  @Override
  public void executeQuery(RpcController controller,
                           TajoWorkerProtocol.QueryExecutionRequestProto request,
                           RpcCallback<PrimitiveProtos.BoolProto> done) {
    try {
      QueryId queryId = new QueryId(request.getQueryId());
      LOG.info("Receive executeQuery request:" + queryId);
      queryMaster.handle(new QueryStartEvent(queryId,
          new QueryContext(request.getQueryContext()), request.getSql().getValue(),
          request.getLogicalPlanJson().getValue()));
      done.run(TajoWorker.TRUE_PROTO);
View Full Code Here

Examples of org.apache.tajo.QueryId

        invokeCommand(cmds);

      } else { // submit a query to TajoMaster
        ClientProtos.GetQueryStatusResponse response = client.executeQuery(stripped);
        if (response.getResultCode() == ClientProtos.ResultCode.OK) {
          QueryId queryId = null;
          try {
            queryId = new QueryId(response.getQueryId());
            if (queryId.equals(QueryIdFactory.NULL_QUERY_ID)) {
              sout.println("OK");
            } else {
              getQueryResult(queryId);
            }
          } finally {
View Full Code Here

Examples of org.apache.tajo.QueryId

      String tajoMasterAddress = params[2];
      connectToTajoMaster(tajoMasterAddress);
      connectToCatalog();

      QueryId queryId = TajoIdUtils.parseQueryId(params[1]);
      tajoWorkerManagerService.getQueryMaster().reportQueryStatusToQueryMaster(
          queryId, TajoProtos.QueryState.QUERY_MASTER_LAUNCHED);
    } else if("tr".equals(daemonMode)) { //TaskRunner mode
      taskRunnerManager.startTask(params);
    } else { //Standby mode
View Full Code Here

Examples of org.apache.tajo.QueryId

    final TajoConf conf = new TajoConf();
    conf.addResource(new Path(TajoConstants.SYSTEM_CONF_FILENAME));

    UserGroupInformation.setConfiguration(conf);

    final QueryId queryId = TajoIdUtils.parseQueryId(args[0]);
    final String queryMasterManagerAddr = args[1];

    LOG.info("Received QueryId:" + queryId);

    QueryMasterRunner queryMasterRunner = new QueryMasterRunner(queryId, queryMasterManagerAddr);
    queryMasterRunner.init(conf);
    queryMasterRunner.start();

    synchronized(queryId) {
      queryId.wait();
    }

    System.exit(0);
  }
View Full Code Here

Examples of org.apache.tajo.QueryId

    public void run() {
      startTime = System.currentTimeMillis();
      try {
        queryRespons = tajoClient.executeQuery(query);
        if (queryRespons.getResultCode() == ClientProtos.ResultCode.OK) {
          QueryId queryId = null;
          try {
            queryId = new QueryId(queryRespons.getQueryId());
            getQueryResult(queryId);
          } finally {
            if (queryId != null) {
              tajoClient.closeQuery(queryId);
            }
View Full Code Here

Examples of org.apache.tajo.QueryId

  public static DecimalFormat MASTER_ID_FORMAT = new DecimalFormat("0000000000000");

  public static ExecutionBlockId createExecutionBlockId(String idStr) {
    String[] tokens = idStr.split("_");

    return new ExecutionBlockId(new QueryId(tokens[1], Integer.parseInt(tokens[2])), Integer.parseInt(tokens[3]));
  }
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.