public List<ResourceReport> getResourceReportList(String resourceType) {
    Map<Integer, ResourceReport> resourceReportMap =
        new TreeMap<Integer, ResourceReport>();
    synchronized (lockObject) {
      for (Map.Entry<TaskAttemptID, Integer> entry :
          taskLookupTable.taskIdToGrantMap.entrySet()) {
        if (ResourceTracker.isNoneGrantId(entry.getValue())) {
          // Skip non-existing grant.
          continue;
        }
        if ((resourceType.equals("map") && entry.getKey().isMap()) ||
            (resourceType.equals("reduce") && !entry.getKey().isMap())) {
          resourceReportMap.put(entry.getValue(),
              new ResourceReport(entry.getValue(), entry.getKey().toString()));
        }
      }
      for (Integer grantId : resourceTracker.availableResources) {
        if (!resourceReportMap.containsKey(grantId)) {
          resourceReportMap.put(grantId,
              new ResourceReport(grantId, "Available (currently not in use)"));
        }
      }
    }
    return new ArrayList<ResourceReport>(resourceReportMap.values());
  }
public List < ResourceReport > getResourceReportList ( String resourceType ) { Map < Integer , ResourceReport > resourceReportMap = new TreeMap < Integer , ResourceReport > ( ) ; synchronized ( lockObject ) { for ( Map . Entry < TaskAttemptID , Integer > entry : taskLookupTable . taskIdToGrantMap . entrySet ( ) ) { if ( ResourceTracker . isNoneGrantId ( entry . getValue ( ) ) ) { continue ; } if ( ( resourceType . equals ( "map" ) && entry . getKey ( ) . isMap ( ) ) || ( resourceType . equals ( "reduce" ) && ! entry . getKey ( ) . isMap ( ) ) ) { resourceReportMap . put ( entry . getValue ( ) , new ResourceReport ( entry . getValue ( ) , entry . getKey ( ) . toString ( ) ) ) ; } } for ( Integer grantId : resourceTracker . availableResources ) { if ( ! resourceReportMap . containsKey ( grantId ) ) { resourceReportMap . put ( grantId , new ResourceReport ( grantId , "Available (currently not in use)" ) ) ; } } } return new ArrayList < ResourceReport > ( resourceReportMap . values ( ) ) ; }
Based on the resource type, get a resource report of the grant # and
task #.  Used by coronajobresources.jsp for debugging which resources are
being used

@param resourceType Map or reduce type
@return List of the resource reports for the appropriate type sorted by id.