Skip to content

Commit

Permalink
Use ConcurrentMap in OffsetManager
Browse files Browse the repository at this point in the history
  • Loading branch information
¨Claude committed Dec 24, 2024
1 parent 2db3a30 commit a75f466
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,7 +35,7 @@ public class OffsetManager<E extends OffsetManager.OffsetManagerEntry<E>> {
/**
* The local manager data.
*/
private final Map<Map<String, Object>, Map<String, Object>> offsets;
private final ConcurrentMap<Map<String, Object>, Map<String, Object>> offsets;

/**
* The context in which this is running.
Expand All @@ -60,7 +61,7 @@ public OffsetManager(final SourceTaskContext context) {
* the offsets
*/
protected OffsetManager(final SourceTaskContext context,
final Map<Map<String, Object>, Map<String, Object>> offsets) {
final ConcurrentMap<Map<String, Object>, Map<String, Object>> offsets) {
this.context = context;
this.offsets = offsets;
}
Expand Down

0 comments on commit a75f466

Please sign in to comment.