code: public static int ensureOutputParameterInRange(String name, long size) {
      if (size > Integer.MAX_VALUE) {
        LOG.warn("cos: {} capped to ~2.14GB"
            + " (maximum allowed size with current output mechanism)", name);
        return Integer.MAX_VALUE;
      } else {
        return (int) size;
      }
    }
docs: Ensure that the long value is in the range of an integer.
  
  @param name property name for error messages
  @param size original size
  @return the size, guaranteed to be less than or equal to the max value of
  an integer