From 41683fbd3bc4e3548414ccca350b57cd4e462d75 Mon Sep 17 00:00:00 2001 From: wenyh1 <2365151147@qq.com> Date: Fri, 27 Oct 2023 11:12:35 +0800 Subject: [PATCH] [inner-2190] collections adjusted to be thread-safe (cherry picked from commit 4eac4e1aafdbdec4a5a22bfa9aa8091afbccfb01) --- .../com/actiontech/dble/server/status/LoadDataBatch.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/actiontech/dble/server/status/LoadDataBatch.java b/src/main/java/com/actiontech/dble/server/status/LoadDataBatch.java index 0cd573cfd..192878e17 100644 --- a/src/main/java/com/actiontech/dble/server/status/LoadDataBatch.java +++ b/src/main/java/com/actiontech/dble/server/status/LoadDataBatch.java @@ -4,14 +4,18 @@ import com.actiontech.dble.config.model.SystemConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; public final class LoadDataBatch { private static final Logger LOGGER = LoggerFactory.getLogger(LoadDataBatch.class); private volatile int size; private volatile boolean enableBatchLoadData; - private Set successFileNames = new HashSet<>(); + private Set successFileNames = ConcurrentHashMap.newKeySet(); private int currentNodeSize = 0; private Map> warnings = new HashMap<>();