Search in sources :

Example 1 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigCast.

@Test
public void testEmbeddedConfigCast() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", Cast.Value.class.getName());
    connProps.put("transforms.example.spec", "int8");
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Example 2 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigHoistField.

@Test
public void testEmbeddedConfigHoistField() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", HoistField.Value.class.getName());
    connProps.put("transforms.example.field", "field");
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Example 3 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigTimestampRouter.

@Test
public void testEmbeddedConfigTimestampRouter() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", TimestampRouter.class.getName());
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) TimestampRouter(org.apache.kafka.connect.transforms.TimestampRouter) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Example 4 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigFlatten.

@Test
public void testEmbeddedConfigFlatten() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", Flatten.Value.class.getName());
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Example 5 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigExtractField.

@Test
public void testEmbeddedConfigExtractField() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", ExtractField.Value.class.getName());
    connProps.put("transforms.example.field", "field");
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Aggregations

Plugins (org.apache.kafka.connect.runtime.isolation.Plugins)34 HashMap (java.util.HashMap)27 MockConnector (org.apache.kafka.connect.tools.MockConnector)24 Test (org.junit.Test)24 Worker (org.apache.kafka.connect.runtime.Worker)7 URI (java.net.URI)4 Connect (org.apache.kafka.connect.runtime.Connect)4 RestServer (org.apache.kafka.connect.runtime.rest.RestServer)4 DistributedConfig (org.apache.kafka.connect.runtime.distributed.DistributedConfig)3 DistributedHerder (org.apache.kafka.connect.runtime.distributed.DistributedHerder)3 StandaloneConfig (org.apache.kafka.connect.runtime.standalone.StandaloneConfig)3 ConfigBackingStore (org.apache.kafka.connect.storage.ConfigBackingStore)3 Converter (org.apache.kafka.connect.storage.Converter)3 KafkaConfigBackingStore (org.apache.kafka.connect.storage.KafkaConfigBackingStore)3 KafkaOffsetBackingStore (org.apache.kafka.connect.storage.KafkaOffsetBackingStore)3 KafkaStatusBackingStore (org.apache.kafka.connect.storage.KafkaStatusBackingStore)3 StatusBackingStore (org.apache.kafka.connect.storage.StatusBackingStore)3 MockTime (org.apache.kafka.common.utils.MockTime)2 Time (org.apache.kafka.common.utils.Time)2 Herder (org.apache.kafka.connect.runtime.Herder)2