PathOutputCommitterFactory extends Configured { public static PathOutputCommitterFactory getCommitterFactory( Path outputPath, Configuration conf) { LOG.debug("Looking for committer factory for path {}", outputPath); String key = COMMITTER_FACTORY_CLASS; if (StringUtils.isEmpty(conf.getTrimmed(key)) && outputPath != null) { String scheme = outputPath.toUri().getScheme(); String schemeKey = String.format(COMMITTER_FACTORY_SCHEME_PATTERN, scheme); if (StringUtils.isNotEmpty(conf.getTrimmed(schemeKey))) { LOG.debug("Using schema-specific factory for {}", outputPath); key = schemeKey; } else { LOG.debug("No scheme-specific factory defined in {}", schemeKey); } } Class<? extends PathOutputCommitterFactory> factory; String trimmedValue = conf.getTrimmed(key, ""); if (StringUtils.isEmpty(trimmedValue)) { LOG.debug("No output committer factory defined," + " defaulting to FileOutputCommitterFactory"); factory = FileOutputCommitterFactory.class; } else { factory = conf.getClass(key, FileOutputCommitterFactory.class, PathOutputCommitterFactory.class); LOG.debug("Using OutputCommitter factory class {} from key {}", factory, key); } return ReflectionUtils.newInstance(factory, conf); }  PathOutputCommitter createOutputCommitter(
      Path outputPath,
      TaskAttemptContext context); static PathOutputCommitterFactory getCommitterFactory(
      Path outputPath,
      Configuration conf); static PathOutputCommitter createCommitter(Path outputPath,
      TaskAttemptContext context); static final String COMMITTER_FACTORY_CLASS; static final String COMMITTER_FACTORY_SCHEME; static final String COMMITTER_FACTORY_SCHEME_PATTERN; static final String FILE_COMMITTER_FACTORY; static final String NAMED_COMMITTER_FACTORY; static final String NAMED_COMMITTER_CLASS; static final String COMMITTER_FACTORY_DEFAULT; }
@Test public void testCommitterFactoryUnknown() throws Throwable { Configuration conf = new Configuration(); conf.set(COMMITTER_FACTORY_CLASS, "unknown"); intercept(RuntimeException.class, () -> getCommitterFactory(HDFS_PATH, conf)); }