Search in sources :

Example 1 with ConfigTransformer

use of org.apache.kafka.common.config.ConfigTransformer in project kafka by apache.

the class MirrorMakerConfig method transform.

Map<String, String> transform(Map<String, String> props) {
    // transform worker config according to config.providers
    List<String> providerNames = configProviders();
    Map<String, ConfigProvider> providers = new HashMap<>();
    for (String name : providerNames) {
        ConfigProvider configProvider = plugins.newConfigProvider(this, CONFIG_PROVIDERS_CONFIG + "." + name, Plugins.ClassLoaderUsage.PLUGINS);
        providers.put(name, configProvider);
    }
    ConfigTransformer transformer = new ConfigTransformer(providers);
    Map<String, String> transformed = transformer.transform(props).data();
    providers.values().forEach(x -> Utils.closeQuietly(x, "config provider"));
    return transformed;
}
Also used : ConfigProvider(org.apache.kafka.common.config.provider.ConfigProvider) HashMap(java.util.HashMap) ConfigTransformer(org.apache.kafka.common.config.ConfigTransformer)

Aggregations

HashMap (java.util.HashMap)1 ConfigTransformer (org.apache.kafka.common.config.ConfigTransformer)1 ConfigProvider (org.apache.kafka.common.config.provider.ConfigProvider)1