You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2021/08/05 05:33:10 UTC

[iotdb] branch master updated: close compaction by default (#3686)

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

qiaojialin 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 785e316  close compaction by default (#3686)
785e316 is described below

commit 785e316b3670ed25e0d966c00d09bf2aad4097ab
Author: Jialin Qiao <qj...@mails.tsinghua.edu.cn>
AuthorDate: Thu Aug 5 13:32:48 2021 +0800

    close compaction by default (#3686)
---
 server/src/assembly/resources/conf/iotdb-engine.properties  |  6 +++---
 .../engine/compaction/CompactionMergeTaskPoolManager.java   | 13 ++++++++-----
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/server/src/assembly/resources/conf/iotdb-engine.properties b/server/src/assembly/resources/conf/iotdb-engine.properties
index c8fb395..641e9ab 100644
--- a/server/src/assembly/resources/conf/iotdb-engine.properties
+++ b/server/src/assembly/resources/conf/iotdb-engine.properties
@@ -381,16 +381,16 @@ timestamp_precision=ms
 ####################
 # LEVEL_COMPACTION, NO_COMPACTION
 # Datatype: CompactionStrategy
-# compaction_strategy=LEVEL_COMPACTION
+# compaction_strategy=NO_COMPACTION
 
 # Works when the compaction_strategy is LEVEL_COMPACTION.
 # Whether to merge unseq files into seq files or not.
 # Datatype: boolean
-# enable_unseq_compaction=true
+# enable_unseq_compaction=false
 
 # Works when the compaction_strategy is LEVEL_COMPACTION.
 # Whether to start next compaction task automatically after finish one compaction task
-# enable_continuous_compaction=true
+# enable_continuous_compaction=false
 
 # Works when the compaction_strategy is LEVEL_COMPACTION.
 # The max seq file num of each level.
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionMergeTaskPoolManager.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionMergeTaskPoolManager.java
index cdf6f4a..79b5d29 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionMergeTaskPoolManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionMergeTaskPoolManager.java
@@ -161,11 +161,14 @@ public class CompactionMergeTaskPoolManager implements IService {
 
   public void submitTask(String storageGroupName, Callable<Void> compactionMergeTask)
       throws RejectedExecutionException {
-    if (pool != null && !pool.isTerminated()) {
-      Future<Void> future = pool.submit(compactionMergeTask);
-      storageGroupTasks
-          .computeIfAbsent(storageGroupName, k -> new ConcurrentSkipListSet<>())
-          .add(future);
+    if (IoTDBDescriptor.getInstance().getConfig().getCompactionStrategy()
+        == CompactionStrategy.LEVEL_COMPACTION) {
+      if (pool != null && !pool.isTerminated()) {
+        Future<Void> future = pool.submit(compactionMergeTask);
+        storageGroupTasks
+            .computeIfAbsent(storageGroupName, k -> new ConcurrentSkipListSet<>())
+            .add(future);
+      }
     }
   }