You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2023/09/07 04:46:33 UTC
[iotdb] branch fix-pipe-concurrent created (now b4021be83ba)
This is an automated email from the ASF dual-hosted git repository.
rong pushed a change to branch fix-pipe-concurrent
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at b4021be83ba Update CachedSchemaPatternMatcher.java
This branch includes the following new commits:
new e67b113b885 try to fix ConcurrentModificationException when assigning PipeHeartbeatEvent
new b4021be83ba Update CachedSchemaPatternMatcher.java
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[iotdb] 02/02: Update CachedSchemaPatternMatcher.java
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch fix-pipe-concurrent
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit b4021be83baf9415046b506238b92f3acd7449b5
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Thu Sep 7 12:46:24 2023 +0800
Update CachedSchemaPatternMatcher.java
---
.../db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java
index e3730acb38d..e6390408d0b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java
@@ -47,6 +47,9 @@ public class CachedSchemaPatternMatcher implements PipeDataRegionMatcher {
public CachedSchemaPatternMatcher() {
this.lock = new ReentrantReadWriteLock();
+ // Should be thread-safe because the extractors will be returned by {@link #match} and
+ // iterated by {@link #assignToExtractor}, at the same time the extractors may be added or
+ // removed by {@link #register} and {@link #deregister}.
this.extractors = new CopyOnWriteArraySet<>();
this.deviceToExtractorsCache =
Caffeine.newBuilder()
[iotdb] 01/02: try to fix ConcurrentModificationException when assigning PipeHeartbeatEvent
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch fix-pipe-concurrent
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit e67b113b8856b43abd084f437d5ee5c8851273b3
Author: 马子坤 <55...@users.noreply.github.com>
AuthorDate: Wed Sep 6 19:33:09 2023 +0800
try to fix ConcurrentModificationException when assigning PipeHeartbeatEvent
---
.../db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java
index 32c0fb2e9d0..e3730acb38d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/realtime/matcher/CachedSchemaPatternMatcher.java
@@ -33,6 +33,7 @@ import org.slf4j.LoggerFactory;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class CachedSchemaPatternMatcher implements PipeDataRegionMatcher {
@@ -46,7 +47,7 @@ public class CachedSchemaPatternMatcher implements PipeDataRegionMatcher {
public CachedSchemaPatternMatcher() {
this.lock = new ReentrantReadWriteLock();
- this.extractors = new HashSet<>();
+ this.extractors = new CopyOnWriteArraySet<>();
this.deviceToExtractorsCache =
Caffeine.newBuilder()
.maximumSize(PipeConfig.getInstance().getPipeExtractorMatcherCacheSize())