This is an automated email from the ASF dual-hosted git repository.
lta pushed a commit to branch refactor_query_resource_count
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/refactor_query_resource_count
by this push:
new 351cb9d remove lock
351cb9d is described below
commit 351cb9deea146c312442f41f57e8b1587f2bf3aa
Author: lta <[email protected]>
AuthorDate: Fri Apr 26 16:21:21 2019 +0800
remove lock
---
.../apache/iotdb/db/engine/filenode/FileNodeProcessor.java | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git
a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
index c64bb0f..c8694af 100644
---
a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
+++
b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
@@ -43,7 +43,6 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBConstant;
@@ -149,10 +148,14 @@ public class FileNodeProcessor extends Processor
implements IStatistic {
private Set<Integer> newMultiPassTokenSet = new HashSet<>();
/**
- * lock resource when switching status in merge process
+ * Represent the number of old queries that have not ended.
+ * This parameter only decreases but not increase.
*/
- private Lock oldMultiPassLock;
private CountDownLatch oldMultiPassCount = null;
+
+ /**
+ * Represent the number of new queries that have not ended.
+ */
private AtomicInteger newMultiPassCount = new AtomicInteger(0);
/**
* system recovery
@@ -1253,7 +1256,6 @@ public class FileNodeProcessor extends Processor
implements IStatistic {
try {
oldMultiPassTokenSet = newMultiPassTokenSet;
oldMultiPassCount = new CountDownLatch(newMultiPassCount.get());
- oldMultiPassLock = new ReentrantLock(false);
newMultiPassTokenSet = new HashSet<>();
newMultiPassCount = new AtomicInteger(0);
List<TsFileResource> result = new ArrayList<>();
@@ -1362,7 +1364,6 @@ public class FileNodeProcessor extends Processor
implements IStatistic {
getProcessorName());
throw new FileNodeProcessorException(e);
}
- oldMultiPassLock.lock();
}
try {
@@ -1413,9 +1414,6 @@ public class FileNodeProcessor extends Processor
implements IStatistic {
}
} finally {
oldMultiPassTokenSet = null;
- if (oldMultiPassLock != null) {
- oldMultiPassLock.unlock();
- }
oldMultiPassCount = null;
}