From 90b7536b05f4c074c907bb276bd1d11baada4bf1 Mon Sep 17 00:00:00 2001 From: MarcusLinkeHermes Date: Tue, 30 Jul 2024 11:57:24 +0200 Subject: [PATCH] [#111] Support latest kafka (3.7.1) --- pom.xml | 7 ++++++- .../transform/common/AdjustPrecisionAndScale.java | 12 ++++++++---- .../connect/transform/common/HeaderToField.java | 14 ++++++++++---- .../transform/common/SetMaximumPrecision.java | 12 ++++++++---- .../transform/common/TimestampNowField.java | 12 ++++++++---- 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 0627d78..c19f553 100644 --- a/pom.xml +++ b/pom.xml @@ -76,10 +76,15 @@ 0.9.10 test + + com.github.jcustenborder.kafka.connect + connect-utils + 0.7-SNAPSHOT + com.github.jcustenborder.kafka.connect connect-utils-testing-data - ${connect-utils.version} + 0.7-SNAPSHOT test diff --git a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/AdjustPrecisionAndScale.java b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/AdjustPrecisionAndScale.java index 6f3812f..dc3c7d4 100644 --- a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/AdjustPrecisionAndScale.java +++ b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/AdjustPrecisionAndScale.java @@ -46,10 +46,12 @@ public class AdjustPrecisionAndScale> extends BaseKeyValueTransformation { private static final Logger log = LoggerFactory.getLogger(AdjustPrecisionAndScale.class); - public AdjustPrecisionAndScale(boolean isKey) { - super(isKey); + public AdjustPrecisionAndScale() { + super(); } + protected boolean isKey = true; + @Override public ConfigDef config() { return AdjustPrecisionAndScaleConfig.config(); @@ -210,13 +212,15 @@ public void configure(Map settings) { public static class Key> extends AdjustPrecisionAndScale { public Key() { - super(true); + super(); } + protected boolean isKey = true; } public static class Value> extends AdjustPrecisionAndScale { public Value() { - super(false); + super(); } + protected boolean isKey = false; } } diff --git a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/HeaderToField.java b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/HeaderToField.java index cdf9907..8abff7b 100644 --- a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/HeaderToField.java +++ b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/HeaderToField.java @@ -42,10 +42,12 @@ public class HeaderToField> extends BaseKeyValueTrans HeaderToFieldConfig config; - protected HeaderToField(boolean isKey) { - super(isKey); + protected HeaderToField() { + super(); } + protected boolean isKey = true; + @Override public ConfigDef config() { return HeaderToFieldConfig.config(); @@ -119,13 +121,17 @@ public void configure(Map map) { public static class Key> extends HeaderToField { public Key() { - super(true); + super(); } + + protected boolean isKey = true; } public static class Value> extends HeaderToField { public Value() { - super(false); + super(); } + + protected boolean isKey = false; } } diff --git a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/SetMaximumPrecision.java b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/SetMaximumPrecision.java index 56a4ca4..31f5967 100644 --- a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/SetMaximumPrecision.java +++ b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/SetMaximumPrecision.java @@ -45,8 +45,8 @@ public class SetMaximumPrecision> extends BaseKeyValueTransformation { private static final Logger log = LoggerFactory.getLogger(SetMaximumPrecision.class); - public SetMaximumPrecision(boolean isKey) { - super(isKey); + public SetMaximumPrecision() { + super(); } @Override @@ -161,13 +161,17 @@ public void configure(Map settings) { public static class Key> extends SetMaximumPrecision { public Key() { - super(true); + super(); } + + protected boolean isKey = true; } public static class Value> extends SetMaximumPrecision { public Value() { - super(false); + super(); } + + protected boolean isKey = false; } } diff --git a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/TimestampNowField.java b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/TimestampNowField.java index 89b3c65..493437b 100644 --- a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/TimestampNowField.java +++ b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/TimestampNowField.java @@ -43,20 +43,24 @@ public abstract class TimestampNowField> extends Base private TimestampNowFieldConfig config; Time time = Time.SYSTEM; - protected TimestampNowField(boolean isKey) { - super(isKey); + protected TimestampNowField() { + super(); } public static class Key> extends TimestampNowField { public Key() { - super(true); + super(); } + + protected boolean isKey = true; } public static class Value> extends TimestampNowField { public Value() { - super(false); + super(); } + + protected boolean isKey = false; } @Override