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/incubator-iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 571b7f5 [IOTDB-841] Unify the IOTDBConfig with iotdb-engine.cofig
(#1629)
571b7f5 is described below
commit 571b7f56be5cfbb7f2e709ca4bb5e9e47b969126
Author: Jackie Tien <[email protected]>
AuthorDate: Wed Aug 19 11:15:24 2020 +0800
[IOTDB-841] Unify the IOTDBConfig with iotdb-engine.cofig (#1629)
* Unify the IOTDBConfig with iotdb-engine.cofig
---
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 36 ++++++++++------------
.../db/sync/receiver/load/FileLoaderTest.java | 23 +++++++++-----
.../recover/SyncReceiverLogAnalyzerTest.java | 24 ++++++++++-----
3 files changed, 49 insertions(+), 34 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index 116949e..18b083a 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -130,9 +130,7 @@ public class IoTDBConfig {
/**
* Is dynamic parameter adapter enable.
*/
- //the default value of this parameter should be kept true in
iotdb-engine.properties,
- //we set it as false here for convenient testing.
- private boolean enableParameterAdapter = false;
+ private boolean enableParameterAdapter = true;
/**
* Is the write ahead log enable.
@@ -241,12 +239,12 @@ public class IoTDBConfig {
/**
* When a memTable's size (in byte) exceeds this, the memtable is flushed to
disk.
*/
- private long memtableSizeThreshold = 128 * 1024 * 1024L;
+ private long memtableSizeThreshold = 1024 * 1024 * 1024L;
/**
* When average series point number reaches this, flush the memtable to disk
*/
- private int avgSeriesPointNumberThreshold = 500000;
+ private int avgSeriesPointNumberThreshold = 100000;
/**
* When merge point number reaches this, merge the vmfile to the tsfile.
@@ -261,12 +259,12 @@ public class IoTDBConfig {
/**
* The max vm num of each memtable. When vm num exceeds this, the vm files
will merge to one.
*/
- private int maxVmNum = 5;
+ private int maxVmNum = 10;
/**
* When vmfiles merge times exceeds this, merge the vmfile to the tsfile.
*/
- private int maxMergeChunkNumInTsFile = 25;
+ private int maxMergeChunkNumInTsFile = 100;
/**
* whether to cache meta data(ChunkMetaData and TsFileMetaData) or not.
@@ -276,17 +274,17 @@ public class IoTDBConfig {
/**
* Memory allocated for timeSeriesMetaData cache in read process
*/
- private long allocateMemoryForTimeSeriesMetaDataCache =
allocateMemoryForRead * 10 / 39;
+ private long allocateMemoryForTimeSeriesMetaDataCache =
allocateMemoryForRead / 10;
/**
* Memory allocated for chunkMetaData cache in read process
*/
- private long allocateMemoryForChunkMetaDataCache = allocateMemoryForRead * 5
/ 39;
+ private long allocateMemoryForChunkMetaDataCache = allocateMemoryForRead /
10;
/**
* Memory allocated for chunk cache in read process
*/
- private long allocateMemoryForChunkCache = allocateMemoryForRead * 5 / 39;
+ private long allocateMemoryForChunkCache = allocateMemoryForRead / 10;
/**
* The statMonitor writes statistics info into IoTDB every backLoopPeriodSec
secs. The default
@@ -310,7 +308,7 @@ public class IoTDBConfig {
/**
* Cache size of {@code checkAndGetDataTypeCache} in {@link MManager}.
*/
- private int mManagerCacheSize = 400000;
+ private int mManagerCacheSize = 300000;
/**
* Cache size of {@code checkAndGetDataTypeCache} in {@link MManager}.
@@ -326,12 +324,12 @@ public class IoTDBConfig {
* The threshold of items in external sort. If the number of chunks
participating in sorting
* exceeds this threshold, external sorting is enabled, otherwise memory
sorting is used.
*/
- private int externalSortThreshold = 60;
+ private int externalSortThreshold = 1000;
/**
* Is this IoTDB instance a receiver of sync or not.
*/
- private boolean isSyncEnable = true;
+ private boolean isSyncEnable = false;
/**
* If this IoTDB instance is a receiver of sync, set the server port.
*/
@@ -384,17 +382,17 @@ public class IoTDBConfig {
/**
* Secret key for watermark
*/
- private String watermarkSecretKey = "QWERTYUIOP*&=";
+ private String watermarkSecretKey = "IoTDB*2019@Beijing";
/**
* Bit string of watermark
*/
- private String watermarkBitString = "11001010010101";
+ private String watermarkBitString = "100101110100";
/**
* Watermark method and parameters
*/
- private String watermarkMethod =
"GroupBasedLSBMethod(embed_row_cycle=5,embed_lsb_num=5)";
+ private String watermarkMethod =
"GroupBasedLSBMethod(embed_row_cycle=2,embed_lsb_num=5)";
/**
* Switch of creating schema automatically
@@ -488,13 +486,13 @@ public class IoTDBConfig {
* be continued, otherwise, the unfinished parts of such merges will not be
continued while the
* finished parts still remain as they are.
*/
- private boolean continueMergeAfterReboot = true;
+ private boolean continueMergeAfterReboot = false;
/**
* A global merge will be performed each such interval, that is, each
storage group will be merged
* (if proper merge candidates can be found). Unit: second.
*/
- private long mergeIntervalSec = 2 * 3600L;
+ private long mergeIntervalSec = 0L;
/**
* When set to true, all merges becomes full merge (the whole SeqFiles are
re-written despite how
@@ -597,7 +595,7 @@ public class IoTDBConfig {
/**
* The default value of primitive array size in array pool
*/
- private int primitiveArraySize = 64;
+ private int primitiveArraySize = 128;
/**
* whether enable data partition. If disabled, all data belongs to partition 0
diff --git
a/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java
b/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java
index 16ed72d..cbce264 100644
---
a/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java
+++
b/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java
@@ -18,6 +18,20 @@
*/
package org.apache.iotdb.db.sync.receiver.load;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Random;
+import java.util.Set;
import org.apache.iotdb.db.conf.IoTDBConstant;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.conf.directories.DirectoryManager;
@@ -38,13 +52,6 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-import java.util.Map.Entry;
-
-import static org.junit.Assert.*;
-
public class FileLoaderTest {
private static final Logger LOGGER =
LoggerFactory.getLogger(FileLoaderTest.class);
@@ -55,6 +62,7 @@ public class FileLoaderTest {
@Before
public void setUp()
throws IOException, InterruptedException, StartupException,
DiskSpaceInsufficientException, MetadataException {
+ IoTDBDescriptor.getInstance().getConfig().setSyncEnable(true);
EnvironmentUtils.closeStatMonitor();
EnvironmentUtils.envSetUp();
dataDir = new
File(DirectoryManager.getInstance().getNextFolderForSequenceFile())
@@ -72,6 +80,7 @@ public class FileLoaderTest {
@After
public void tearDown() throws InterruptedException, IOException,
StorageEngineException {
+ IoTDBDescriptor.getInstance().getConfig().setSyncEnable(false);
EnvironmentUtils.cleanEnv();
}
diff --git
a/server/src/test/java/org/apache/iotdb/db/sync/receiver/recover/SyncReceiverLogAnalyzerTest.java
b/server/src/test/java/org/apache/iotdb/db/sync/receiver/recover/SyncReceiverLogAnalyzerTest.java
index c9fea93..eccc2d8 100644
---
a/server/src/test/java/org/apache/iotdb/db/sync/receiver/recover/SyncReceiverLogAnalyzerTest.java
+++
b/server/src/test/java/org/apache/iotdb/db/sync/receiver/recover/SyncReceiverLogAnalyzerTest.java
@@ -18,7 +18,21 @@
*/
package org.apache.iotdb.db.sync.receiver.recover;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.conf.directories.DirectoryManager;
import org.apache.iotdb.db.engine.StorageEngine;
import org.apache.iotdb.db.engine.storagegroup.StorageGroupProcessor;
@@ -41,14 +55,6 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.*;
-
-import static org.junit.Assert.*;
-
public class SyncReceiverLogAnalyzerTest {
private static final Logger LOGGER =
LoggerFactory.getLogger(FileLoaderTest.class);
@@ -61,6 +67,7 @@ public class SyncReceiverLogAnalyzerTest {
@Before
public void setUp()
throws IOException, InterruptedException, StartupException,
DiskSpaceInsufficientException, MetadataException {
+ IoTDBDescriptor.getInstance().getConfig().setSyncEnable(true);
EnvironmentUtils.closeStatMonitor();
EnvironmentUtils.envSetUp();
dataDir = new
File(DirectoryManager.getInstance().getNextFolderForSequenceFile())
@@ -79,6 +86,7 @@ public class SyncReceiverLogAnalyzerTest {
@After
public void tearDown() throws InterruptedException, IOException,
StorageEngineException {
+ IoTDBDescriptor.getInstance().getConfig().setSyncEnable(false);
EnvironmentUtils.cleanEnv();
}