This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 92459238b3a Fix ConcurrentModificationException in updating
FileMetrics (#10022)
92459238b3a is described below
commit 92459238b3a653d241ebfa66564d6a8eb35ac854
Author: Liu Xuxin <[email protected]>
AuthorDate: Thu Jun 1 23:54:40 2023 +0800
Fix ConcurrentModificationException in updating FileMetrics (#10022)
---
.../java/org/apache/iotdb/db/service/metrics/FileMetrics.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/service/metrics/FileMetrics.java
b/server/src/main/java/org/apache/iotdb/db/service/metrics/FileMetrics.java
index 110b3ed559d..1b82f2a512d 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/metrics/FileMetrics.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/metrics/FileMetrics.java
@@ -44,7 +44,6 @@ import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -89,10 +88,10 @@ public class FileMetrics implements IMetricSet {
private final AtomicInteger innerUnseqCompactionTempFileNum = new
AtomicInteger(0);
private final AtomicInteger crossCompactionTempFileNum = new
AtomicInteger(0);
private AtomicBoolean hasRemainData = new AtomicBoolean(false);
- private final Map<Integer, Gauge> seqLevelCountGaugeMap = new HashMap<>();
- private final Map<Integer, Gauge> seqLevelSizeGaugeMap = new HashMap<>();
- private final Map<Integer, Gauge> unseqLevelCountGaugeMap = new HashMap<>();
- private final Map<Integer, Gauge> unseqLevelSizeGaugeMap = new HashMap<>();
+ private final Map<Integer, Gauge> seqLevelCountGaugeMap = new
ConcurrentHashMap<>();
+ private final Map<Integer, Gauge> seqLevelSizeGaugeMap = new
ConcurrentHashMap<>();
+ private final Map<Integer, Gauge> unseqLevelCountGaugeMap = new
ConcurrentHashMap<>();
+ private final Map<Integer, Gauge> unseqLevelSizeGaugeMap = new
ConcurrentHashMap<>();
@SuppressWarnings("squid:S1075")
private String fileHandlerCntPathInLinux = "/proc/%s/fd";