Package org.apache.hadoop.corona

Examples of org.apache.hadoop.corona.ResourceGrant


      while (grantIter.hasNext() && processed < maxBatchSize) {
        processed++;
        Integer grantId = grantIter.next();
        grantIter.remove();
        Integer requestId = grantId;
        ResourceGrant grant = grantedResources.get(grantId);
        if (processor.processAvailableResource(grant)) {
          if (LOG.isDebugEnabled()) {
            LOG.info("processed available resource with requestId: " +
              requestId);
          }
View Full Code Here


        // but the speculation is no longer needed
        resourceTracker.releaseResource(grant);
        return;
      }
      if (abandonHost) {
        ResourceGrant resource = resourceTracker.getGrant(grant);
        String hostToExlcude = resource.getAddress().getHost();
        taskToContextMap.get(tip).excludedHosts.add(hostToExlcude);
        excludedHosts = taskToContextMap.get(tip).excludedHosts;
      }
      ResourceRequest newReq = resourceTracker.releaseAndRequestResource(grant,
          excludedHosts);
View Full Code Here

    // The TIP that this grant was issued for originally
    // if tip is not equal to assignedTip then the grant was borrowed
    TaskInProgress assignedTip = requestToTipMap.get(grantId);
    taskLookupTable.removeTaskEntry(taskid);

    ResourceGrant grant = resourceTracker.getGrant(grantId);
    String trackerName = null;
    if (ResourceTracker.isNoneGrantId(grantId)) {
      // This handles updating statistics when  task was restored in finished
      // state (so there's no grant assigned to this task)
      trackerName = taskLookupTable.getAssignedTracker(taskid);
View Full Code Here

        if (runningGrant == null
            || ResourceTracker.isNoneGrantId(runningGrant)) {
          // This task attempt is no longer running
          continue;
        }
        ResourceGrant resource = resourceTracker.getGrant(runningGrant);
        String tidHost = resource.getAddress().getHost();
        excludedHosts.add(tidHost);
      }
      req.setExcludeHosts(new ArrayList<String>(excludedHosts));
      List<String> newHosts = new ArrayList<String>();
      if (req.getHosts() != null) {
View Full Code Here

    assertEquals(0, rt.getWantedResources().size());
   
    List<ResourceGrant> grants = new ArrayList<ResourceGrant>();
   
    for (int i = 1; i <= 4; i++) {
      ResourceGrant grant =
        new ResourceGrant(i, TstUtils.getNodeHost(i-1),
            TstUtils.getNodeAddress(i-1), ClusterManager.clock.getTime(),
            wanted.get(i - 1).getType());
      grant.setAppInfo("192.168.0.1:1234"); // some random app info.
      grants.add(grant);
    }
   
    rt.addNewGrants(grants);
   
View Full Code Here

    assertEquals(4, wanted.size());
    assertEquals(0, rt.getWantedResources().size());
   
    List<ResourceGrant> grants = new ArrayList<ResourceGrant>();
    for (int i = 0; i < 4; i++) {
      ResourceGrant grant =
        new ResourceGrant(i+1, TstUtils.getNodeHost(i),
            TstUtils.getNodeAddress(i), ClusterManager.clock.getTime(),
            wanted.get(i).getType());
      grant.setAppInfo("192.168.0.1:1234"); // some random app info.
      grants.add(grant);
    }
    // Grant the initial need.
    rt.addNewGrants(grants);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.corona.ResourceGrant

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.