You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/01/21 15:51:48 UTC

[GitHub] [iotdb] THUMarkLau commented on a change in pull request #4952: [IOTDB-2453] Remove all not necessarily lock in compaction process

THUMarkLau commented on a change in pull request #4952:
URL: https://github.com/apache/iotdb/pull/4952#discussion_r789774225



##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
##########
@@ -507,6 +507,10 @@ public boolean tryWriteLock() {
     return tsFileLock.tryWriteLock();
   }
 
+  public boolean tryReadLock() {

Review comment:
       resolve

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java
##########
@@ -98,18 +100,13 @@ public TsFileResourceList getUnsequenceListByTimePartition(long timePartition) {
   }
 
   public void remove(TsFileResource tsFileResource, boolean sequence) {
-    writeLock("remove");
-    try {
-      Map<Long, TsFileResourceList> selectedMap = sequence ? sequenceFiles : unsequenceFiles;
-      for (Map.Entry<Long, TsFileResourceList> entry : selectedMap.entrySet()) {
-        if (entry.getValue().contains(tsFileResource)) {
-          entry.getValue().remove(tsFileResource);
-          TsFileResourceManager.getInstance().removeTsFileResource(tsFileResource);
-          break;
-        }
+    Map<Long, TsFileResourceList> selectedMap = sequence ? sequenceFiles : unsequenceFiles;
+    for (Map.Entry<Long, TsFileResourceList> entry : selectedMap.entrySet()) {

Review comment:
       resolve




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org