Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hotfix][Connector] Fix ConcurrentModificationException when snapshotState based on SourceReaderBase #4011

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
* An abstract implementation of {@link SourceReader} which provides some synchronization between
Expand All @@ -55,7 +57,7 @@
public abstract class SourceReaderBase<E, T, SplitT extends SourceSplit, SplitStateT>
implements SourceReader<T, SplitT> {
private final BlockingQueue<RecordsWithSplitIds<E>> elementsQueue;
private final Map<String, SplitContext<T, SplitStateT>> splitStates;
private final ConcurrentMap<String, SplitContext<T, SplitStateT>> splitStates;
protected final RecordEmitter<E, T, SplitStateT> recordEmitter;
protected final SplitFetcherManager<E, SplitT> splitFetcherManager;
protected final SourceReaderOptions options;
Expand All @@ -74,7 +76,7 @@ public SourceReaderBase(BlockingQueue<RecordsWithSplitIds<E>> elementsQueue,
this.elementsQueue = elementsQueue;
this.splitFetcherManager = splitFetcherManager;
this.recordEmitter = recordEmitter;
this.splitStates = new HashMap<>();
this.splitStates = new ConcurrentHashMap<>();
this.options = options;
this.context = context;
}
Expand Down