Search in sources :

Example 16 with ConfigDef

use of org.apache.kafka.common.config.ConfigDef in project kafka-connect-storage-cloud by confluentinc.

the class S3SinkConnectorConfig method getConfig.

public static ConfigDef getConfig() {
    // Define the names of the configurations we're going to override
    Set<String> skip = new HashSet<>();
    skip.add(StorageSinkConnectorConfig.SHUTDOWN_TIMEOUT_CONFIG);
    // Order added is important, so that group order is maintained
    ConfigDef visible = new ConfigDef();
    addAllConfigKeys(visible, newConfigDef(), skip);
    addAllConfigKeys(visible, StorageCommonConfig.newConfigDef(STORAGE_CLASS_RECOMMENDER), skip);
    addAllConfigKeys(visible, PartitionerConfig.newConfigDef(PARTITIONER_CLASS_RECOMMENDER), skip);
    return visible;
}
Also used : ConfigDef(org.apache.kafka.common.config.ConfigDef) HashSet(java.util.HashSet)

Example 17 with ConfigDef

use of org.apache.kafka.common.config.ConfigDef in project debezium by debezium.

the class ByLogicalTableRouter method config.

@Override
public ConfigDef config() {
    ConfigDef config = new ConfigDef();
    Field.group(config, null, TOPIC_REGEX, TOPIC_REPLACEMENT, KEY_FIELD_REGEX, KEY_FIELD_REPLACEMENT);
    return config;
}
Also used : ConfigDef(org.apache.kafka.common.config.ConfigDef)

Example 18 with ConfigDef

use of org.apache.kafka.common.config.ConfigDef in project debezium by debezium.

the class UnwrapFromEnvelope method config.

@Override
public ConfigDef config() {
    final ConfigDef config = new ConfigDef();
    Field.group(config, null, DROP_TOMBSTONES, DROP_DELETES);
    return config;
}
Also used : ConfigDef(org.apache.kafka.common.config.ConfigDef)

Example 19 with ConfigDef

use of org.apache.kafka.common.config.ConfigDef in project debezium by debezium.

the class PostgresConnectorIT method shouldValidateConnectorConfigDef.

@Test
public void shouldValidateConnectorConfigDef() {
    connector = new PostgresConnector();
    ConfigDef configDef = connector.config();
    assertThat(configDef).isNotNull();
    PostgresConnectorConfig.ALL_FIELDS.forEach(this::validateFieldDef);
}
Also used : ConfigDef(org.apache.kafka.common.config.ConfigDef) Test(org.junit.Test) AbstractConnectorTest(io.debezium.embedded.AbstractConnectorTest)

Example 20 with ConfigDef

use of org.apache.kafka.common.config.ConfigDef in project debezium by debezium.

the class MySqlConnectorTest 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());
        if (expected.equals(MySqlConnectorConfig.DATABASE_HISTORY) || expected.equals(MySqlConnectorConfig.JDBC_DRIVER)) {
            assertThat(((Class<?>) key.defaultValue).getName()).isEqualTo((String) expected.defaultValue());
        } else if (!expected.equals(MySqlConnectorConfig.SERVER_ID)) {
            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();
    });
}
Also used : ConfigKey(org.apache.kafka.common.config.ConfigDef.ConfigKey) ConfigDef(org.apache.kafka.common.config.ConfigDef)

Aggregations

ConfigDef (org.apache.kafka.common.config.ConfigDef)69 Config (org.apache.kafka.common.config.Config)29 Test (org.junit.Test)28 Connector (org.apache.kafka.connect.connector.Connector)27 SourceConnector (org.apache.kafka.connect.source.SourceConnector)26 ConnectorConfig (org.apache.kafka.connect.runtime.ConnectorConfig)24 SinkConnector (org.apache.kafka.connect.sink.SinkConnector)23 HashMap (java.util.HashMap)20 ConfigValue (org.apache.kafka.common.config.ConfigValue)19 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)19 TaskConfig (org.apache.kafka.connect.runtime.TaskConfig)17 Map (java.util.Map)14 SinkConnectorConfig (org.apache.kafka.connect.runtime.SinkConnectorConfig)14 WorkerConfig (org.apache.kafka.connect.runtime.WorkerConfig)13 List (java.util.List)12 ArrayList (java.util.ArrayList)10 Herder (org.apache.kafka.connect.runtime.Herder)10 ConnectorInfo (org.apache.kafka.connect.runtime.rest.entities.ConnectorInfo)10 BadRequestException (org.apache.kafka.connect.runtime.rest.errors.BadRequestException)10 AbstractConfig (org.apache.kafka.common.config.AbstractConfig)9