Package org.apache.tajo

Examples of org.apache.tajo.QueryUnitAttemptId


                  }
                } else {

                  LOG.info("Accumulated Received Task: " + (++receivedNum));

                  QueryUnitAttemptId taskAttemptId = new QueryUnitAttemptId(taskRequest.getId());
                  if (tasks.containsKey(taskAttemptId)) {
                    fatalError(master, taskAttemptId, "Duplicate Task Attempt: " + taskAttemptId);
                    continue;
                  }
View Full Code Here


                           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);
      done.run(TajoWorker.FALSE_PROTO);
    }
View Full Code Here

        if(container == null) {
          continue;
        }
        String host = container.getTaskHostName();

        QueryUnitAttemptId attemptId = null;
        LinkedList<QueryUnitAttemptId> list = null;

        // local disk allocation
        if(!leafTaskHostMapping.containsKey(host)){
          host = NetUtils.normalizeHost(host);
        }

        TaskBlockLocation taskBlockLocation = leafTaskHostMapping.get(host);
        if (taskBlockLocation != null) {
          list = taskBlockLocation.getQueryUnitAttemptIdList(taskRequest.getContainerId());
        }

        while (list != null && list.size() > 0) {
          QueryUnitAttemptId tId = list.removeFirst();

          if (leafTasks.contains(tId)) {
            leafTasks.remove(tId);
            attemptId = tId;
            //LOG.info(attemptId + " Assigned based on host match " + hostName);
            hostLocalAssigned++;
            break;
          }
        }

        // rack allocation
        if (attemptId == null) {
          String rack = RackResolver.resolve(host).getNetworkLocation();
          list = leafTasksRackMapping.get(rack);
          while(list != null && list.size() > 0) {

            QueryUnitAttemptId tId = list.removeFirst();

            if (leafTasks.contains(tId)) {
              leafTasks.remove(tId);
              attemptId = tId;
              //LOG.info(attemptId + "Assigned based on rack match " + rack);
View Full Code Here

      TaskRequestEvent taskRequest;
      while (it.hasNext()) {
        taskRequest = it.next();
        LOG.debug("assignToNonLeafTasks: " + taskRequest.getExecutionBlockId());

        QueryUnitAttemptId attemptId;
        // random allocation
        if (nonLeafTasks.size() > 0) {
          attemptId = nonLeafTasks.iterator().next();
          nonLeafTasks.remove(attemptId);
          LOG.debug("Assigned based on * match");

          QueryUnit task;
          SubQuery subQuery = context.getSubQuery(attemptId.getQueryUnitId().getExecutionBlockId());
          task = subQuery.getQueryUnit(attemptId.getQueryUnitId());
          QueryUnitRequest taskAssign = new QueryUnitRequestImpl(
              attemptId,
              Lists.newArrayList(task.getAllFragments()),
              "",
              false,
View Full Code Here

      for (String eachQueryUnitId : queryUnidIds) {
        String[] queryUnitIdSeqTokens = eachQueryUnitId.split("_");
        ExecutionBlockId ebId = TajoIdUtils.createExecutionBlockId(params.get("sid").get(0));
        QueryUnitId quid = new QueryUnitId(ebId, Integer.parseInt(queryUnitIdSeqTokens[0]));

        QueryUnitAttemptId attemptId = new QueryUnitAttemptId(quid, Integer.parseInt(queryUnitIdSeqTokens[1]));

        RetrieverHandler handler = handlerMap.get(attemptId.toString());
        FileChunk chunk = handler.get(params);
        chunks.add(chunk);
      }
      return chunks.toArray(new FileChunk[chunks.size()]);
    } else {
View Full Code Here

      return this.id;
    }
    if (!p.hasId()) {
      return null;
    }
    this.id = new QueryUnitAttemptId(p.getId());
    return this.id;
  }
View Full Code Here

public class TaskCompletionEvent extends TaskAttemptEvent {
  private TaskCompletionReport report;

  public TaskCompletionEvent(TaskCompletionReport report) {
    super(new QueryUnitAttemptId(report.getId()), TaskAttemptEventType.TA_DONE);
    this.report = report;
  }
View Full Code Here

import org.apache.tajo.ipc.TajoWorkerProtocol.TaskFatalErrorReport;

public class TaskFatalErrorEvent extends TaskAttemptEvent {
  private TaskFatalErrorReport report;
  public TaskFatalErrorEvent(TaskFatalErrorReport report) {
    super(new QueryUnitAttemptId(report.getId()),
        TaskAttemptEventType.TA_FATAL_ERROR);
    this.report = report;
  }
View Full Code Here

      List<String> qids = splitMaps(params.get("qid"));
      for (String qid : qids) {
        String[] ids = qid.split("_");
        ExecutionBlockId suid = TajoIdUtils.createExecutionBlockId(params.get("sid").get(0));
        QueryUnitId quid = new QueryUnitId(suid, Integer.parseInt(ids[0]));
        QueryUnitAttemptId attemptId = new QueryUnitAttemptId(quid,
            Integer.parseInt(ids[1]));
        RetrieverHandler handler = handlerMap.get(attemptId.toString());
        FileChunk chunk = handler.get(params);
        chunks.add(chunk);
      }
      return chunks.toArray(new FileChunk[chunks.size()]);
    } else {
View Full Code Here

  }

  @Override
  public void killTaskAttempt(RpcController controller, TajoIdProtos.QueryUnitAttemptIdProto request,
                              RpcCallback<PrimitiveProtos.BoolProto> done) {
    workerContext.getTaskRunnerManager().findTaskByQueryUnitAttemptId(new QueryUnitAttemptId(request)).kill();
    done.run(TajoWorker.TRUE_PROTO);
  }
View Full Code Here

TOP

Related Classes of org.apache.tajo.QueryUnitAttemptId

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.