public static Config applyRewriter(Config config, String rewriterName) {
    String rewriterClassName = new JobConfig(config).getConfigRewriterClass(rewriterName)
        .orElseThrow(() -> new SamzaException(
            String.format("Unable to find class config for config rewriter %s.", rewriterName)));
    ConfigRewriter rewriter = ReflectionUtil.getObj(rewriterClassName, ConfigRewriter.class);
    LOG.info("Re-writing config with {}", rewriter);
    return rewriter.rewrite(rewriterName, config);
  }
Re-writes configuration using a ConfigRewriter, defined with the given rewriterName in config.
@param config the config to re-write
@param rewriterName the name of the rewriter to apply
@return the rewritten config
samza-core/src/main/java/org/apache/samza/util/ConfigUtil.java