code: private DatanodeDescriptor getMinUsage(Collection<DatanodeDescriptor> nodes, int minUsageDefault,
        DatanodeDescriptor minUsageInstanceDefault, HashMap<DatanodeDescriptor, Integer> usageMap) {
      for (DatanodeDescriptor dnd : nodes) {
        Integer usage = usageMap.get(dnd);
        if (usage == null) {
          usage = 0;
        }
        if (usage < minUsageDefault) {
          minUsageDefault = usage;
          minUsageInstanceDefault = dnd;
        }
      }
      return minUsageInstanceDefault;
    }
docs: Finds DatanodeDescriptor from the list <code>nodes</code> where its value
  in <code>usageMap</code> is the minimum, if the minimum value is greater
  than or equal to <code>minUsageDefault</code>,
  <code>minUsageInstanceDefault</code> will be returned, otherwise the
  DatanodeDescriptor with the minimum value will be returned.