Package org.apache.tajo

Examples of org.apache.tajo.QueryId


    ClientProtos.SubmitQueryResponse response = client.executeQuery(statement);
    if (response == null) {
      sout.println("response is null");
    } else if (response.getResultCode() == ClientProtos.ResultCode.OK) {
      if (response.getIsForwarded()) {
        QueryId queryId = new QueryId(response.getQueryId());
        try {
          waitForQueryCompleted(queryId);
        } finally {
          client.closeQuery(queryId);
        }
View Full Code Here


  private String errorText;
  private String queryMasterHost;
  private int queryMasterPort;

  public QueryStatus(GetQueryStatusResponse proto) {
    queryId = new QueryId(proto.getQueryId());
    state = proto.getState();
    progress = proto.getProgress();
    submitTime = proto.getSubmitTime();
    finishTime = proto.getFinishTime();
    hasResult = proto.getHasResult();
View Full Code Here

        LOG.debug("Received QueryHeartbeat:" + request.getTajoWorkerHost() + ":" + request.getTajoWorkerPort());
      }

      TajoMasterProtocol.TajoHeartbeatResponse.ResponseCommand command = null;
      if(request.hasQueryId()) {
        QueryId queryId = new QueryId(request.getQueryId());

        //heartbeat from querymaster
        //LOG.info("Received QueryHeartbeat:" + queryId + "," + request);
        QueryJobManager queryJobManager = context.getQueryJobManager();
        command = queryJobManager.queryHeartbeat(request);
View Full Code Here

        workerResource.setMemoryMBSlots(eachWorkerResource.getMemoryMBSlots());
        workerResource.setDiskSlots(eachWorkerResource.getDiskSlots());

        LOG.info("releaseWorkerResource:" + workerResource);
        context.getResourceManager().releaseWorkerResource(
            new QueryId(eachWorkerResource.getExecutionBlockId().getQueryId()),
            workerResource);
      }
      done.run(BOOL_TRUE);
    }
View Full Code Here

    }

    @Override
    public void stopQueryMaster(RpcController controller, TajoIdProtos.QueryIdProto request,
                                RpcCallback<BoolProto> done) {
      context.getQueryJobManager().stopQuery(new QueryId(request));
      done.run(BOOL_TRUE);
    }
View Full Code Here

  private String errorText;
  private String queryMasterHost;
  private int queryMasterPort;

  public QueryStatus(GetQueryStatusResponse proto) {
    queryId = new QueryId(proto.getQueryId());
    state = proto.getState();
    progress = proto.getProgress();
    submitTime = proto.getSubmitTime();
    initTime = proto.getInitTime();
    finishTime = proto.getFinishTime();
View Full Code Here

    @Override
    public ClientProtos.GetQueryResultResponse getQueryResult(
            RpcController controller,
            ClientProtos.GetQueryResultRequest request) throws ServiceException {
      QueryId queryId = new QueryId(request.getQueryId());
      Query query = workerContext.getQueryMaster().getQuery(queryId);

      ClientProtos.GetQueryResultResponse.Builder builder = ClientProtos.GetQueryResultResponse.newBuilder();

      if(query == null) {
View Full Code Here

    public ClientProtos.GetQueryStatusResponse getQueryStatus(
            RpcController controller,
            ClientProtos.GetQueryStatusRequest request) throws ServiceException {
      ClientProtos.GetQueryStatusResponse.Builder builder
              = ClientProtos.GetQueryStatusResponse.newBuilder();
      QueryId queryId = new QueryId(request.getQueryId());

      builder.setQueryId(request.getQueryId());

      if (queryId.equals(QueryIdFactory.NULL_QUERY_ID)) {
        builder.setResultCode(ClientProtos.ResultCode.OK);
        builder.setState(TajoProtos.QueryState.QUERY_SUCCEEDED);
      } else {
        QueryMasterTask queryMasterTask = workerContext.getQueryMaster().getQueryMasterTask(queryId);
        builder.setResultCode(ClientProtos.ResultCode.OK);
View Full Code Here

    @Override
    public PrimitiveProtos.BoolProto killQuery (
            RpcController controller,
            TajoIdProtos.QueryIdProto request) throws ServiceException {
      final QueryId queryId = new QueryId(request);
      LOG.info("Stop Query:" + queryId);
      Thread t = new Thread() {
        public void run() {
          workerContext.getQueryMaster().getContext().stopQuery(queryId);
        }
View Full Code Here

  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

TOP

Related Classes of org.apache.tajo.QueryId

Copyright © 2018 www.massapicom. 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.