code: public synchronized long getLocalityWait(ResourceType type,
                                             LocalityLevel level) {
      if (level == LocalityLevel.ANY) {
        return 0L;
      }
      Long wait = level == LocalityLevel.NODE ?
          typeToNodeWait.get(type) : typeToRackWait.get(type);
      if (wait == null) {
        throw new IllegalArgumentException("Unknown type:" + type);
      }
      return wait;
    }
docs: Get the locality wait to be used by the scheduler for a given
  ResourceType on a given LocalityLevel
  @param type the type of the resource
  @param level the locality level
  @return the time in milliseconds to use as a locality wait for a resource
  of a given type on a given level