This is an automated email from the ASF dual-hosted git repository.

heiming pushed a commit to branch wal_sonar_1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit df746a036d161580213132b683bf64c7fce17880
Author: HeimingZ <[email protected]>
AuthorDate: Sun Jun 25 09:46:01 2023 +0800

    fix
---
 .../main/java/org/apache/iotdb/db/wal/allocation/ElasticStrategy.java   | 2 ++
 .../java/org/apache/iotdb/db/wal/allocation/FirstCreateStrategy.java    | 2 ++
 .../java/org/apache/iotdb/db/wal/allocation/RoundRobinStrategy.java     | 2 ++
 3 files changed, 6 insertions(+)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/wal/allocation/ElasticStrategy.java 
b/server/src/main/java/org/apache/iotdb/db/wal/allocation/ElasticStrategy.java
index c66a4c20073..06331ccd033 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/wal/allocation/ElasticStrategy.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/wal/allocation/ElasticStrategy.java
@@ -52,6 +52,8 @@ public class ElasticStrategy extends 
AbstractNodeAllocationStrategy {
     this.walNodes = new ArrayList<>();
   }
 
+  // it's safe to not close WALNode here, we use clear method to close all 
WALNodes.
+  @SuppressWarnings("squid:S2095")
   @Override
   public IWALNode applyForWALNode(String applicantUniqueId) {
     nodesLock.lock();
diff --git 
a/server/src/main/java/org/apache/iotdb/db/wal/allocation/FirstCreateStrategy.java
 
b/server/src/main/java/org/apache/iotdb/db/wal/allocation/FirstCreateStrategy.java
index 55a21fa1e23..3201715524a 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/wal/allocation/FirstCreateStrategy.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/wal/allocation/FirstCreateStrategy.java
@@ -44,6 +44,8 @@ public class FirstCreateStrategy extends 
AbstractNodeAllocationStrategy {
   private final Map<String, WALNode> identifier2Nodes = new HashMap<>();
   // endregion
 
+  // it's safe to not close WALNode here, we use clear method to close all 
WALNodes.
+  @SuppressWarnings("squid:S2095")
   @Override
   public IWALNode applyForWALNode(String applicantUniqueId) {
     nodesLock.lock();
diff --git 
a/server/src/main/java/org/apache/iotdb/db/wal/allocation/RoundRobinStrategy.java
 
b/server/src/main/java/org/apache/iotdb/db/wal/allocation/RoundRobinStrategy.java
index 0550001578c..30c2501b41c 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/wal/allocation/RoundRobinStrategy.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/wal/allocation/RoundRobinStrategy.java
@@ -50,6 +50,8 @@ public class RoundRobinStrategy extends 
AbstractNodeAllocationStrategy {
     this.walNodes = new ArrayList<>(maxWalNodeNum);
   }
 
+  // it's safe to not close WALNode here, we use clear method to close all 
WALNodes.
+  @SuppressWarnings("squid:S2095")
   @Override
   public IWALNode applyForWALNode(String applicantUniqueId) {
     WALNode selectedNode;

Reply via email to