Search in sources :

Example 6 with SimpleConfig

use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.

the class ReplaceField method configure.

@Override
public void configure(Map<String, ?> configs) {
    final SimpleConfig config = new SimpleConfig(CONFIG_DEF, configs);
    blacklist = config.getList(ConfigName.BLACKLIST);
    whitelist = config.getList(ConfigName.WHITELIST);
    renames = parseRenameMappings(config.getList(ConfigName.RENAME));
    reverseRenames = invert(renames);
    schemaUpdateCache = new SynchronizedCache<>(new LRUCache<Schema, Schema>(16));
}
Also used : SimpleConfig(org.apache.kafka.connect.transforms.util.SimpleConfig) LRUCache(org.apache.kafka.common.cache.LRUCache)

Example 7 with SimpleConfig

use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.

the class SetSchemaMetadata method configure.

@Override
public void configure(Map<String, ?> configs) {
    final SimpleConfig config = new SimpleConfig(CONFIG_DEF, configs);
    schemaName = config.getString(ConfigName.SCHEMA_NAME);
    schemaVersion = config.getInt(ConfigName.SCHEMA_VERSION);
    if (schemaName == null && schemaVersion == null) {
        throw new ConfigException("Neither schema name nor version configured");
    }
}
Also used : SimpleConfig(org.apache.kafka.connect.transforms.util.SimpleConfig) ConfigException(org.apache.kafka.common.config.ConfigException)

Example 8 with SimpleConfig

use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.

the class HoistField method configure.

@Override
public void configure(Map<String, ?> props) {
    final SimpleConfig config = new SimpleConfig(CONFIG_DEF, props);
    fieldName = config.getString("field");
    schemaUpdateCache = new SynchronizedCache<>(new LRUCache<Schema, Schema>(16));
}
Also used : SimpleConfig(org.apache.kafka.connect.transforms.util.SimpleConfig) LRUCache(org.apache.kafka.common.cache.LRUCache)

Example 9 with SimpleConfig

use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.

the class MaskField method configure.

@Override
public void configure(Map<String, ?> props) {
    final SimpleConfig config = new SimpleConfig(CONFIG_DEF, props);
    maskedFields = new HashSet<>(config.getList(FIELDS_CONFIG));
}
Also used : SimpleConfig(org.apache.kafka.connect.transforms.util.SimpleConfig)

Aggregations

SimpleConfig (org.apache.kafka.connect.transforms.util.SimpleConfig)9 LRUCache (org.apache.kafka.common.cache.LRUCache)4 ConfigException (org.apache.kafka.common.config.ConfigException)2 SimpleDateFormat (java.text.SimpleDateFormat)1