use of org.apache.kafka.common.config.ConfigDef in project debezium by debezium.
the class PostgresConnectorConfig method configDef.
protected static ConfigDef configDef() {
ConfigDef config = new ConfigDef();
Field.group(config, "Postgres", SLOT_NAME, PLUGIN_NAME, SERVER_NAME, DATABASE_NAME, HOSTNAME, PORT, USER, PASSWORD, SSL_MODE, SSL_CLIENT_CERT, SSL_CLIENT_KEY_PASSWORD, SSL_ROOT_CERT, SSL_CLIENT_KEY, DROP_SLOT_ON_STOP, SSL_SOCKET_FACTORY, STATUS_UPDATE_INTERVAL_MS, TCP_KEEPALIVE);
Field.group(config, "Events", SCHEMA_WHITELIST, SCHEMA_BLACKLIST, TABLE_WHITELIST, TABLE_BLACKLIST, COLUMN_BLACKLIST, INCLUDE_UNKNOWN_DATATYPES, SNAPSHOT_SELECT_STATEMENT_OVERRIDES_BY_TABLE, CommonConnectorConfig.TOMBSTONES_ON_DELETE);
Field.group(config, "Connector", TOPIC_SELECTION_STRATEGY, CommonConnectorConfig.POLL_INTERVAL_MS, CommonConnectorConfig.MAX_BATCH_SIZE, CommonConnectorConfig.MAX_QUEUE_SIZE, SNAPSHOT_MODE, SNAPSHOT_LOCK_TIMEOUT_MS, TIME_PRECISION_MODE, DECIMAL_HANDLING_MODE, ROWS_FETCH_SIZE);
return config;
}
use of org.apache.kafka.common.config.ConfigDef in project debezium by debezium.
the class MongoDbConnectorTest method assertConfigDefIsValid.
protected static void assertConfigDefIsValid(Connector connector, io.debezium.config.Field.Set fields) {
ConfigDef configDef = connector.config();
assertThat(configDef).isNotNull();
fields.forEach(expected -> {
assertThat(configDef.names()).contains(expected.name());
ConfigKey key = configDef.configKeys().get(expected.name());
assertThat(key).isNotNull();
assertThat(key.name).isEqualTo(expected.name());
assertThat(key.displayName).isEqualTo(expected.displayName());
assertThat(key.importance).isEqualTo(expected.importance());
assertThat(key.documentation).isEqualTo(expected.description());
assertThat(key.type).isEqualTo(expected.type());
assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
assertThat(key.dependents).isEqualTo(expected.dependents());
assertThat(key.width).isNotNull();
assertThat(key.group).isNotNull();
assertThat(key.orderInGroup).isGreaterThan(0);
assertThat(key.validator).isNull();
assertThat(key.recommender).isNull();
});
}
use of org.apache.kafka.common.config.ConfigDef in project debezium by debezium.
the class MongoDbConnectorConfig method configDef.
protected static ConfigDef configDef() {
ConfigDef config = new ConfigDef();
Field.group(config, "MongoDB", HOSTS, USER, PASSWORD, LOGICAL_NAME, CONNECT_BACKOFF_INITIAL_DELAY_MS, CONNECT_BACKOFF_MAX_DELAY_MS, MAX_FAILED_CONNECTIONS, AUTO_DISCOVER_MEMBERS, SSL_ENABLED, SSL_ALLOW_INVALID_HOSTNAMES);
Field.group(config, "Events", DATABASE_WHITELIST, DATABASE_BLACKLIST, COLLECTION_WHITELIST, COLLECTION_BLACKLIST, CommonConnectorConfig.TOMBSTONES_ON_DELETE);
Field.group(config, "Connector", MAX_COPY_THREADS, CommonConnectorConfig.MAX_QUEUE_SIZE, CommonConnectorConfig.MAX_BATCH_SIZE, CommonConnectorConfig.POLL_INTERVAL_MS);
return config;
}
use of org.apache.kafka.common.config.ConfigDef in project kafka by apache.
the class SourceConnectorConfig method embedDefaultGroup.
public static ConfigDef embedDefaultGroup(ConfigDef baseConfigDef) {
String defaultGroup = "default";
ConfigDef newDefaultDef = new ConfigDef(baseConfigDef);
newDefaultDef.embed(DEFAULT_TOPIC_CREATION_PREFIX, defaultGroup, 0, TopicCreationConfig.defaultGroupConfigDef());
return newDefaultDef;
}
use of org.apache.kafka.common.config.ConfigDef in project kafka by apache.
the class SourceConnectorConfig method enrich.
/**
* Returns an enriched {@link ConfigDef} building upon the {@code ConfigDef}, using the current configuration specified in {@code props} as an input.
*
* @param baseConfigDef the base configuration definition to be enriched
* @param props the non parsed configuration properties
* @return the enriched configuration definition
*/
public static ConfigDef enrich(ConfigDef baseConfigDef, Map<String, String> props, AbstractConfig defaultGroupConfig) {
List<Object> topicCreationGroups = new ArrayList<>();
Object aliases = ConfigDef.parseType(TOPIC_CREATION_GROUPS_CONFIG, props.get(TOPIC_CREATION_GROUPS_CONFIG), ConfigDef.Type.LIST);
if (aliases instanceof List) {
topicCreationGroups.addAll((List<?>) aliases);
}
ConfigDef newDef = new ConfigDef(baseConfigDef);
String defaultGroupPrefix = TOPIC_CREATION_PREFIX + DEFAULT_TOPIC_CREATION_GROUP + ".";
short defaultGroupReplicationFactor = defaultGroupConfig.getShort(defaultGroupPrefix + REPLICATION_FACTOR_CONFIG);
int defaultGroupPartitions = defaultGroupConfig.getInt(defaultGroupPrefix + PARTITIONS_CONFIG);
topicCreationGroups.stream().distinct().forEach(group -> {
if (!(group instanceof String)) {
throw new ConfigException("Item in " + TOPIC_CREATION_GROUPS_CONFIG + " property is not of type String");
}
String alias = (String) group;
String prefix = TOPIC_CREATION_PREFIX + alias + ".";
String configGroup = TOPIC_CREATION_GROUP + ": " + alias;
newDef.embed(prefix, configGroup, 0, TopicCreationConfig.configDef(configGroup, defaultGroupReplicationFactor, defaultGroupPartitions));
});
return newDef;
}
Aggregations