public static Map<String, LocalResource> getResourcesUpdatableForAm(
      Collection<LocalResource> allNonAppResources) {
    HashMap<String, LocalResource> allNonAppFileResources = new HashMap<>();
    if (allNonAppResources == null) {
      return allNonAppFileResources;
    }
    for (LocalResource lr : allNonAppResources) {
      if (lr.getType() == LocalResourceType.FILE) {
        // TEZ AM will only localize FILE (no script operators in the AM)
        allNonAppFileResources.put(DagUtils.getBaseName(lr), lr);
      }
    }
    return allNonAppFileResources;
  }
Parse a Java opts string, try to find the rightmost -Xmx option value (since there may be more than one)
@param javaOpts Java opts string to parse
@return the rightmost -Xmx value in bytes. If Xmx is not set, return -1
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java