Package org.apache.tajo

Examples of org.apache.tajo.ExecutionBlockId


    if (params.containsKey("sid")) {
      List<FileChunk> chunks = Lists.newArrayList();
      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);
View Full Code Here


  @Test
  public void testCreateHashFetchURL() throws Exception {
    QueryId q1 = TestTajoIds.createQueryId(1315890136000l, 2);
    String hostName = "tajo1";
    int port = 1234;
    ExecutionBlockId sid = new ExecutionBlockId(q1, 2);
    int partitionId = 2;

    List<QueryUnit.IntermediateEntry> intermediateEntries = TUtil.newList();
    for (int i = 0; i < 1000; i++) {
      intermediateEntries.add(new QueryUnit.IntermediateEntry(i, 0, partitionId, hostName, port));
View Full Code Here

  }
 
  @Test
  public final void testInterDataRetriver() throws Exception {
    MasterPlan plan = new MasterPlan(LocalTajoTestingUtility.newQueryId(), null, null);
    ExecutionBlockId schid = plan.newExecutionBlockId();
    QueryUnitId qid1 = QueryIdFactory.newQueryUnitId(schid);
    QueryUnitId qid2 = QueryIdFactory.newQueryUnitId(schid);
   
    File qid1Dir = new File(TEST_DATA + "/" + qid1.toString() + "/out");
    qid1Dir.mkdirs();
View Full Code Here

  }
 
  @Test(expected = FileNotFoundException.class)
  public final void testNoSuchFile() throws Exception {
    MasterPlan plan = new MasterPlan(LocalTajoTestingUtility.newQueryId(), null, null);
    ExecutionBlockId schid = plan.newExecutionBlockId();
    QueryUnitId qid1 = QueryIdFactory.newQueryUnitId(schid);
    QueryUnitId qid2 = QueryIdFactory.newQueryUnitId(schid);
   
    File qid1Dir = new File(TEST_DATA + "/" + qid1.toString() + "/out");
    qid1Dir.mkdirs();
View Full Code Here

      }
      int numAllocatedContainers = 0;

      if(response != null) {
        List<TajoMasterProtocol.WorkerAllocatedResource> allocatedResources = response.getWorkerAllocatedResourceList();
        ExecutionBlockId executionBlockId = event.getExecutionBlockId();

        List<Container> containers = new ArrayList<Container>();
        for(TajoMasterProtocol.WorkerAllocatedResource eachAllocatedResource: allocatedResources) {
          TajoWorkerContainer container = new TajoWorkerContainer();
          NodeId nodeId = NodeId.newInstance(eachAllocatedResource.getWorkerHost(),
              eachAllocatedResource.getPeerRpcPort());

          TajoWorkerContainerId containerId = new TajoWorkerContainerId();

          containerId.setApplicationAttemptId(
              ApplicationIdUtils.createApplicationAttemptId(executionBlockId.getQueryId(),
                  eachAllocatedResource.getContainerId().getAppAttemptId().getAttemptId()));
          containerId.setId(eachAllocatedResource.getContainerId().getId());

          container.setId(containerId);
          container.setNodeId(nodeId);
View Full Code Here

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

      Map<ExecutionBlockId, List<Container>> allocated = new HashMap<ExecutionBlockId, List<Container>>();
      for (Container container : allocatedContainers) {
        ExecutionBlockId executionBlockId = subQueryMap.get(container.getPriority());
        SubQueryState state = context.getSubQuery(executionBlockId).getState();
        if (!(SubQuery.isRunningState(state))) {
          releaseAssignedContainer(container.getId());
        } else {
          if (allocated.containsKey(executionBlockId)) {
View Full Code Here

      return finishedTaskRunnerMap.get(taskRunnerId);
    }
  }

  public Task findTaskByQueryUnitAttemptId(QueryUnitAttemptId quAttemptId) {
    ExecutionBlockId ebid = quAttemptId.getQueryUnitId().getExecutionBlockId();
    synchronized(taskRunnerMap) {
      for (TaskRunner eachTaskRunner: taskRunnerMap.values()) {
        if (eachTaskRunner.getExecutionBlockId().equals(ebid)) {
          Task task = eachTaskRunner.getContext().getTask(quAttemptId);
          if (task != null) {
View Full Code Here

    }
    return null;
  }

  public TaskHistory findTaskHistoryByQueryUnitAttemptId(QueryUnitAttemptId quAttemptId) {
    ExecutionBlockId ebid = quAttemptId.getQueryUnitId().getExecutionBlockId();
    synchronized(taskRunnerMap) {
      for (TaskRunner eachTaskRunner: taskRunnerMap.values()) {
        if (eachTaskRunner.getExecutionBlockId().equals(ebid)) {
          TaskHistory taskHistory = eachTaskRunner.getContext().getTaskHistory(quAttemptId);
          if (taskHistory != null) {
View Full Code Here

        try {
          WorkerResourceRequest resourceRequest = requestQueue.take();

          if (LOG.isDebugEnabled()) {
            LOG.debug("allocateWorkerResources:" +
                (new ExecutionBlockId(resourceRequest.request.getExecutionBlockId())) +
                ", requiredMemory:" + resourceRequest.request.getMinMemoryMBPerContainer() +
                "~" + resourceRequest.request.getMaxMemoryMBPerContainer() +
                ", requiredContainers:" + resourceRequest.request.getNumContainers() +
                ", requiredDiskSlots:" + resourceRequest.request.getMinDiskSlotPerContainer() +
                "~" + resourceRequest.request.getMaxDiskSlotPerContainer() +
View Full Code Here

    @Override
    public void releaseWorkerResource(RpcController controller,
                                           TajoMasterProtocol.WorkerResourceReleaseRequest request,
                                           RpcCallback<PrimitiveProtos.BoolProto> done) {
      List<YarnProtos.ContainerIdProto> containerIds = request.getContainerIdsList();
      ExecutionBlockId ebId = new ExecutionBlockId(request.getExecutionBlockId());

      for(YarnProtos.ContainerIdProto eachContainer: containerIds) {
        context.getResourceManager().releaseWorkerResource(ebId, eachContainer);
      }
      done.run(BOOL_TRUE);
View Full Code Here

TOP

Related Classes of org.apache.tajo.ExecutionBlockId

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.