use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.
the class TimestampRouter method configure.
@Override
public void configure(Map<String, ?> props) {
final SimpleConfig config = new SimpleConfig(CONFIG_DEF, props);
topicFormat = config.getString(ConfigName.TOPIC_FORMAT);
final String timestampFormatStr = config.getString(ConfigName.TIMESTAMP_FORMAT);
timestampFormat = new ThreadLocal<SimpleDateFormat>() {
@Override
protected SimpleDateFormat initialValue() {
final SimpleDateFormat fmt = new SimpleDateFormat(timestampFormatStr);
fmt.setTimeZone(TimeZone.getTimeZone("UTC"));
return fmt;
}
};
}
use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.
the class ValueToKey method configure.
@Override
public void configure(Map<String, ?> configs) {
final SimpleConfig config = new SimpleConfig(CONFIG_DEF, configs);
fields = config.getList(FIELDS_CONFIG);
valueToKeySchemaCache = new SynchronizedCache<>(new LRUCache<Schema, Schema>(16));
}
use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.
the class ExtractField method configure.
@Override
public void configure(Map<String, ?> props) {
final SimpleConfig config = new SimpleConfig(CONFIG_DEF, props);
fieldName = config.getString(FIELD_CONFIG);
}
use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.
the class InsertField method configure.
@Override
public void configure(Map<String, ?> props) {
final SimpleConfig config = new SimpleConfig(CONFIG_DEF, props);
topicField = InsertionSpec.parse(config.getString(ConfigName.TOPIC_FIELD));
partitionField = InsertionSpec.parse(config.getString(ConfigName.PARTITION_FIELD));
offsetField = InsertionSpec.parse(config.getString(ConfigName.OFFSET_FIELD));
timestampField = InsertionSpec.parse(config.getString(ConfigName.TIMESTAMP_FIELD));
staticField = InsertionSpec.parse(config.getString(ConfigName.STATIC_FIELD));
staticValue = config.getString(ConfigName.STATIC_VALUE);
if (topicField == null && partitionField == null && offsetField == null && timestampField == null && staticField == null) {
throw new ConfigException("No field insertion configured");
}
if (staticField != null && staticValue == null) {
throw new ConfigException(ConfigName.STATIC_VALUE, null, "No value specified for static field: " + staticField);
}
schemaUpdateCache = new SynchronizedCache<>(new LRUCache<Schema, Schema>(16));
}
use of org.apache.kafka.connect.transforms.util.SimpleConfig in project kafka by apache.
the class RegexRouter method configure.
@Override
public void configure(Map<String, ?> props) {
final SimpleConfig config = new SimpleConfig(CONFIG_DEF, props);
regex = Pattern.compile(config.getString(ConfigName.REGEX));
replacement = config.getString(ConfigName.REPLACEMENT);
}
Aggregations