code: private static void checkNamedOutput(JobConf conf, String namedOutput,
                                         boolean alreadyDefined) {
      List<String> definedChannels = getNamedOutputsList(conf);
      if (alreadyDefined && definedChannels.contains(namedOutput)) {
        throw new IllegalArgumentException("Named output '" + namedOutput +
          "' already alreadyDefined");
      } else if (!alreadyDefined && !definedChannels.contains(namedOutput)) {
        throw new IllegalArgumentException("Named output '" + namedOutput +
          "' not defined");
      }
    }
docs: Checks if a named output is alreadyDefined or not.
  
  @param conf           job conf
  @param namedOutput    named output names
  @param alreadyDefined whether the existence/non-existence of
  the named output is to be checked
  @throws IllegalArgumentException if the output name is alreadyDefined or
  not depending on the value of the
  'alreadyDefined' parameter