From a75f466f3b0a1fa6ad12313c5a80c891bf089572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=A8Claude?= <¨claude.warren@aiven.io¨> Date: Tue, 24 Dec 2024 09:09:00 +0000 Subject: [PATCH] Use ConcurrentMap in OffsetManager --- .../java/io/aiven/kafka/connect/common/OffsetManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commons/src/main/java/io/aiven/kafka/connect/common/OffsetManager.java b/commons/src/main/java/io/aiven/kafka/connect/common/OffsetManager.java index 8c6e1a7b..ef0078e4 100644 --- a/commons/src/main/java/io/aiven/kafka/connect/common/OffsetManager.java +++ b/commons/src/main/java/io/aiven/kafka/connect/common/OffsetManager.java @@ -20,6 +20,7 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import java.util.function.Function; import org.apache.kafka.connect.source.SourceTaskContext; @@ -34,7 +35,7 @@ public class OffsetManager> { /** * The local manager data. */ - private final Map, Map> offsets; + private final ConcurrentMap, Map> offsets; /** * The context in which this is running. @@ -60,7 +61,7 @@ public OffsetManager(final SourceTaskContext context) { * the offsets */ protected OffsetManager(final SourceTaskContext context, - final Map, Map> offsets) { + final ConcurrentMap, Map> offsets) { this.context = context; this.offsets = offsets; }