Package org.apache.tajo.master.querymaster

Examples of org.apache.tajo.master.querymaster.Query$QueryCompletedTransition$MaterializedResultHook


    @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) {
        builder.setErrorMessage("No Query for " + queryId);
      } else {
        switch (query.getState()) {
          case QUERY_SUCCEEDED:
            builder.setTableDesc((CatalogProtos.TableDescProto)query.getResultDesc().getProto());
            break;
          case QUERY_FAILED:
          case QUERY_ERROR:
            builder.setErrorMessage("Query " + queryId + " is failed");
          default:
View Full Code Here


        builder.setQueryMasterHost(bindAddr.getHostName());
        builder.setQueryMasterPort(bindAddr.getPort());

        if (queryMasterTask != null) {
          queryMasterTask.touchSessionTime();
          Query query = queryMasterTask.getQuery();

          builder.setState(query.getState());
          builder.setProgress(query.getProgress());
          builder.setSubmitTime(query.getAppSubmitTime());
          builder.setInitTime(query.getInitializationTime());
          builder.setHasResult(
              !(queryMasterTask.getQueryTaskContext().getQueryContext().isCreateTable() ||
                  queryMasterTask.getQueryTaskContext().getQueryContext().isInsert())
          );
          if (query.getState() == TajoProtos.QueryState.QUERY_SUCCEEDED) {
            builder.setFinishTime(query.getFinishTime());
          } else {
            builder.setFinishTime(System.currentTimeMillis());
          }
        } else {
          builder.setState(TajoProtos.QueryState.QUERY_NOT_ASSIGNED);
View Full Code Here

    LOG.info("un-registering ApplicationMaster(QueryMaster):" + appAttemptId);
    stopped.set(true);

    try {
      FinalApplicationStatus status = FinalApplicationStatus.UNDEFINED;
      Query query = context.getQuery();
      if (query != null) {
        TajoProtos.QueryState state = query.getState();
        if (state == TajoProtos.QueryState.QUERY_SUCCEEDED) {
          status = FinalApplicationStatus.SUCCEEDED;
        } else if (state == TajoProtos.QueryState.QUERY_FAILED || state == TajoProtos.QueryState.QUERY_ERROR) {
          status = FinalApplicationStatus.FAILED;
        } else if (state == TajoProtos.QueryState.QUERY_ERROR) {
View Full Code Here

    LOG.info("un-registering ApplicationMaster(QueryMaster):" + appAttemptId);
    stopped.set(true);

    try {
      FinalApplicationStatus status = FinalApplicationStatus.UNDEFINED;
      Query query = context.getQuery();
      if (query != null) {
        TajoProtos.QueryState state = query.getState();
        if (state == TajoProtos.QueryState.QUERY_SUCCEEDED) {
          status = FinalApplicationStatus.SUCCEEDED;
        } else if (state == TajoProtos.QueryState.QUERY_FAILED || state == TajoProtos.QueryState.QUERY_ERROR) {
          status = FinalApplicationStatus.FAILED;
        } else if (state == TajoProtos.QueryState.QUERY_ERROR) {
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().getQueryMasterTask(queryId, true).getQuery();

      ClientProtos.GetQueryResultResponse.Builder builder = ClientProtos.GetQueryResultResponse.newBuilder();
      try {
        builder.setTajoUserName(UserGroupInformation.getCurrentUser().getUserName());
      } catch (IOException e) {
        LOG.warn("Can't get current user name");
      }

      if(query == null) {
        builder.setErrorMessage("No Query for " + queryId);
      } else {
        switch (query.getState()) {
          case QUERY_SUCCEEDED:
            builder.setTableDesc(query.getResultDesc().getProto());
            break;
          case QUERY_FAILED:
          case QUERY_ERROR:
            builder.setErrorMessage("Query " + queryId + " is failed");
          default:
View Full Code Here

            !(queryMasterTask.getQueryTaskContext().getQueryContext().isCreateTable() ||
                queryMasterTask.getQueryTaskContext().getQueryContext().isInsert())
        );

        queryMasterTask.touchSessionTime();
        Query query = queryMasterTask.getQuery();

        if (query != null) {
          builder.setState(query.getState());
          builder.setProgress(query.getProgress());
          builder.setSubmitTime(query.getAppSubmitTime());
          if (query.getState() == TajoProtos.QueryState.QUERY_SUCCEEDED) {
            builder.setFinishTime(query.getFinishTime());
          } else {
            builder.setFinishTime(System.currentTimeMillis());
          }
        } else {
          builder.setState(queryMasterTask.getState());
View Full Code Here

TOP

Related Classes of org.apache.tajo.master.querymaster.Query$QueryCompletedTransition$MaterializedResultHook

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.