You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yo...@apache.org on 2023/01/12 04:27:19 UTC
[iotdb] 01/02: stash
This is an automated email from the ASF dual-hosted git repository.
yongzao pushed a commit to branch Move-ConfigNodeConfig-into-CommonConfig
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit dffad5f7c7804456fec3710142312e0cccafea52
Author: YongzaoDan <53...@qq.com>
AuthorDate: Wed Jan 11 16:37:42 2023 +0800
stash
---
.../iotdb/confignode/conf/ConfigNodeConfig.java | 61 +-
.../confignode/conf/ConfigNodeDescriptor.java | 6 +-
.../confignode/conf/ConfigNodeRemoveCheck.java | 2 +-
.../confignode/conf/ConfigNodeStartupCheck.java | 4 +-
.../confignode/conf/SystemPropertiesUtils.java | 2 +-
.../statemachine/ConfigNodeRegionStateMachine.java | 2 +-
.../iotdb/confignode/manager/ConsensusManager.java | 2 +-
.../db/integration/sync/IoTDBSyncReceiverIT.java | 2 +-
.../sync/IoTDBSyncReceiverLoaderIT.java | 2 +-
.../resources/conf/iotdb-common.properties | 14 +-
.../apache/iotdb/commons/conf/CommonConfig.java | 776 ++++++++++++-
.../iotdb/commons/conf/CommonDescriptor.java | 516 ++++++---
.../utils/datastructure/TVListSortAlgorithm.java | 2 +-
.../rocksdb/RSchemaReadWriteHandler.java | 2 +-
.../resources/conf/iotdb-datanode.properties | 4 +-
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 728 +++---------
.../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 1154 ++++++++------------
.../org/apache/iotdb/db/conf/IoTDBStartCheck.java | 23 +-
.../iotdb/db/conf/adapter/CompressionRatio.java | 2 +-
.../db/conf/directories/DirectoryManager.java | 16 +-
.../db/consensus/DataRegionConsensusImpl.java | 2 +-
.../db/consensus/SchemaRegionConsensusImpl.java | 2 +-
.../org/apache/iotdb/db/engine/StorageEngine.java | 4 +-
.../execute/recover/CompactionRecoverTask.java | 2 +-
.../execute/utils/log/TsFileIdentifier.java | 2 +-
.../apache/iotdb/db/engine/settle/SettleLog.java | 2 +-
.../iotdb/db/engine/snapshot/SnapshotLoader.java | 10 +-
.../iotdb/db/engine/snapshot/SnapshotTaker.java | 2 +-
.../apache/iotdb/db/engine/upgrade/UpgradeLog.java | 3 +-
.../iotdb/db/metadata/idtable/IDTableManager.java | 2 +-
.../iotdb/db/mpp/common/DataNodeEndPoints.java | 8 +-
.../execution/exchange/MPPDataExchangeService.java | 4 +-
.../plan/node/load/LoadSingleTsFileNode.java | 4 +-
.../scheduler/AbstractFragInsStateTracker.java | 4 +-
.../scheduler/FragmentInstanceDispatcherImpl.java | 4 +-
.../scheduler/load/LoadTsFileDispatcherImpl.java | 4 +-
.../iotdb/db/rescon/PrimitiveArrayManager.java | 2 +-
.../java/org/apache/iotdb/db/service/DataNode.java | 20 +-
.../db/service/DataNodeInternalRPCService.java | 4 +-
.../iotdb/db/service/InfluxDBRPCService.java | 4 +-
.../org/apache/iotdb/db/service/RPCService.java | 8 +-
.../db/service/TemporaryQueryDataFileService.java | 2 +-
.../iotdb/db/service/metrics/SystemMetrics.java | 2 +-
.../org/apache/iotdb/db/utils/OpenFileNumUtil.java | 2 +-
.../db/conf/adapter/CompressionRatioTest.java | 3 +-
.../db/engine/compaction/TsFileIdentifierUT.java | 4 +-
.../recover/SizeTieredCompactionRecoverTest.java | 2 +-
.../db/engine/snapshot/IoTDBSnapshotTest.java | 22 +-
.../iotdb/db/engine/storagegroup/TTLTest.java | 2 +-
.../db/mpp/execution/exchange/SinkHandleTest.java | 12 +-
.../mpp/execution/exchange/SourceHandleTest.java | 15 +-
.../DataNodeInternalRPCServiceImplTest.java | 13 +-
.../apache/iotdb/db/utils/EnvironmentUtils.java | 12 +-
.../iotdb/tsfile/common/conf/TSFileConfig.java | 6 -
54 files changed, 1893 insertions(+), 1621 deletions(-)
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
index 991591e99c..a5d7ea19ef 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.confignode.conf;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.commons.client.property.ClientPoolProperty.DefaultProperty;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.confignode.manager.load.balancer.RegionBalancer;
import org.apache.iotdb.confignode.manager.load.balancer.router.priority.IPriorityBalancer;
@@ -44,11 +44,11 @@ public class ConfigNodeConfig {
/** Directory Configuration */
// System directory, including version file for each database and metadata
- private String systemDir =
+ private String cnSystemDir =
ConfigNodeConstant.DATA_DIR + File.separator + IoTDBConstant.SYSTEM_FOLDER_NAME;
// Consensus directory, storage consensus protocol logs
- private String consensusDir =
+ private String cnConsensusDir =
ConfigNodeConstant.DATA_DIR + File.separator + ConfigNodeConstant.CONSENSUS_FOLDER;
/** Thrift RPC Configuration */
@@ -65,6 +65,10 @@ public class ConfigNodeConfig {
private int cnConnectionTimeoutMs = (int) TimeUnit.SECONDS.toMillis(20);
// ClientManager will have so many selector threads (TAsyncClientManager) to distribute to its clients
private int cnSelectorThreadNumsOfClientManager = 1;
+ // The maximum number of clients that can be idle for a node in a clientManager
+ private int cnCoreClientCountForEachNodeInClientManager = 200;
+ // The maximum number of clients that can be allocated for a node in a clientManager
+ private int cnMaxClientCountForEachNodeInClientManager = 300;
/** Metric Configuration */
// TODO: Add if necessary
@@ -72,8 +76,7 @@ public class ConfigNodeConfig {
/** Internal Configurations(Unconfigurable in .properties file) */
// ConfigNodeId, the default value -1 will be changed after join cluster
private volatile int configNodeId = -1;
- // TODO: Read from iotdb-confignode.properties
- private int configNodeRegionId = 0;
+ private static final int configNodeRegionId = 0;
// RegionGroup allocate policy
private RegionBalancer.RegionGroupAllocatePolicy regionGroupAllocatePolicy =
@@ -98,8 +101,8 @@ public class ConfigNodeConfig {
}
private void formulateFolders() {
- systemDir = addHomeDir(systemDir);
- consensusDir = addHomeDir(consensusDir);
+ cnSystemDir = addHomeDir(cnSystemDir);
+ cnConsensusDir = addHomeDir(cnConsensusDir);
}
private String addHomeDir(String dir) {
@@ -146,20 +149,20 @@ public class ConfigNodeConfig {
this.cnTargetConfigNode = cnTargetConfigNode;
}
- public String getSystemDir() {
- return systemDir;
+ public String getCnSystemDir() {
+ return cnSystemDir;
}
- public void setSystemDir(String systemDir) {
- this.systemDir = systemDir;
+ public void setCnSystemDir(String cnSystemDir) {
+ this.cnSystemDir = cnSystemDir;
}
- public String getConsensusDir() {
- return consensusDir;
+ public String getCnConsensusDir() {
+ return cnConsensusDir;
}
- public void setConsensusDir(String consensusDir) {
- this.consensusDir = consensusDir;
+ public void setCnConsensusDir(String cnConsensusDir) {
+ this.cnConsensusDir = cnConsensusDir;
}
public boolean isCnRpcThriftCompressionEnable() {
@@ -218,6 +221,22 @@ public class ConfigNodeConfig {
this.cnSelectorThreadNumsOfClientManager = cnSelectorThreadNumsOfClientManager;
}
+ public int getCnCoreClientCountForEachNodeInClientManager() {
+ return cnCoreClientCountForEachNodeInClientManager;
+ }
+
+ public void setCnCoreClientCountForEachNodeInClientManager(int cnCoreClientCountForEachNodeInClientManager) {
+ this.cnCoreClientCountForEachNodeInClientManager = cnCoreClientCountForEachNodeInClientManager;
+ }
+
+ public int getCnMaxClientCountForEachNodeInClientManager() {
+ return cnMaxClientCountForEachNodeInClientManager;
+ }
+
+ public void setCnMaxClientCountForEachNodeInClientManager(int cnMaxClientCountForEachNodeInClientManager) {
+ this.cnMaxClientCountForEachNodeInClientManager = cnMaxClientCountForEachNodeInClientManager;
+ }
+
public int getConfigNodeId() {
return configNodeId;
}
@@ -230,10 +249,6 @@ public class ConfigNodeConfig {
return configNodeRegionId;
}
- public void setConfigNodeRegionId(int configNodeRegionId) {
- this.configNodeRegionId = configNodeRegionId;
- }
-
public RegionBalancer.RegionGroupAllocatePolicy getRegionGroupAllocatePolicy() {
return regionGroupAllocatePolicy;
}
@@ -242,14 +257,6 @@ public class ConfigNodeConfig {
this.regionGroupAllocatePolicy = regionGroupAllocatePolicy;
}
- public long getUnknownDataNodeDetectInterval() {
- return unknownDataNodeDetectInterval;
- }
-
- public void setUnknownDataNodeDetectInterval(long unknownDataNodeDetectInterval) {
- this.unknownDataNodeDetectInterval = unknownDataNodeDetectInterval;
- }
-
public String getRoutePriorityPolicy() {
return routePriorityPolicy;
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
index 7368b19cc0..c9b8db9357 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
@@ -20,10 +20,8 @@ package org.apache.iotdb.confignode.conf;
import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.commons.exception.BadNodeUrlException;
-import org.apache.iotdb.commons.loadbalance.RegionGroupExtensionPolicy;
import org.apache.iotdb.commons.utils.NodeUrlUtils;
import org.apache.iotdb.confignode.manager.load.balancer.RegionBalancer;
-import org.apache.iotdb.confignode.manager.load.balancer.router.leader.ILeaderBalancer;
import org.apache.iotdb.confignode.manager.load.balancer.router.priority.IPriorityBalancer;
import org.apache.iotdb.metrics.config.MetricConfigDescriptor;
@@ -206,9 +204,9 @@ public class ConfigNodeDescriptor {
.trim()));
- CONF.setSystemDir(properties.getProperty("cn_system_dir", CONF.getSystemDir()).trim());
+ CONF.setCnSystemDir(properties.getProperty("cn_system_dir", CONF.getCnSystemDir()).trim());
- CONF.setConsensusDir(properties.getProperty("cn_consensus_dir", CONF.getConsensusDir()).trim());
+ CONF.setCnConsensusDir(properties.getProperty("cn_consensus_dir", CONF.getCnConsensusDir()).trim());
String routePriorityPolicy =
properties.getProperty("route_priority_policy", CONF.getRoutePriorityPolicy()).trim();
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeRemoveCheck.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeRemoveCheck.java
index d7c492275b..f31fcc4016 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeRemoveCheck.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeRemoveCheck.java
@@ -52,7 +52,7 @@ public class ConfigNodeRemoveCheck {
public ConfigNodeRemoveCheck() {
systemPropertiesFile =
- new File(CONF.getSystemDir() + File.separator + ConfigNodeConstant.SYSTEM_FILE_NAME);
+ new File(CONF.getCnSystemDir() + File.separator + ConfigNodeConstant.SYSTEM_FILE_NAME);
systemProperties = new Properties();
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
index 3ff481abe1..13076c073b 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
@@ -120,11 +120,11 @@ public class ConfigNodeStartupCheck {
private void createDirsIfNecessary() throws IOException {
// If systemDir does not exist, create systemDir
- File systemDir = new File(CONF.getSystemDir());
+ File systemDir = new File(CONF.getCnSystemDir());
createDirIfEmpty(systemDir);
// If consensusDir does not exist, create consensusDir
- File consensusDir = new File(CONF.getConsensusDir());
+ File consensusDir = new File(CONF.getCnConsensusDir());
createDirIfEmpty(consensusDir);
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
index c64a745979..85c878826c 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
@@ -44,7 +44,7 @@ public class SystemPropertiesUtils {
private static final File systemPropertiesFile =
new File(
- ConfigNodeDescriptor.getInstance().getConf().getSystemDir()
+ ConfigNodeDescriptor.getInstance().getConf().getCnSystemDir()
+ File.separator
+ ConfigNodeConstant.SYSTEM_FILE_NAME);
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
index d0bad26c56..665a62006f 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
@@ -69,7 +69,7 @@ public class ConfigNodeRegionStateMachine
private int endIndex;
private static final String CURRENT_FILE_DIR =
- CONF.getConsensusDir() + File.separator + "simple" + File.separator + "current";
+ CONF.getCnConsensusDir() + File.separator + "simple" + File.separator + "current";
private static final String PROGRESS_FILE_PATH =
CURRENT_FILE_DIR + File.separator + "log_inprogress_";
private static final String FILE_PATH = CURRENT_FILE_DIR + File.separator + "log_";
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
index 81800ea20c..3e77084f15 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
@@ -176,7 +176,7 @@ public class ConsensusManager {
.setTriggerSnapshotFileSize(CONF.getConfigNodeRatisLogMax())
.build())
.build())
- .setStorageDir(CONF.getConsensusDir())
+ .setStorageDir(CONF.getCnConsensusDir())
.build(),
gid -> stateMachine)
.orElseThrow(
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverIT.java
index c60e62d891..de4f6e10ee 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverIT.java
@@ -74,7 +74,7 @@ public class IoTDBSyncReceiverIT {
IoTDBDescriptor.getInstance().getConfig().setEnableCrossSpaceCompaction(false);
SyncTestUtil.insertData();
EnvironmentUtils.shutdownDaemon();
- File srcDir = new File(IoTDBDescriptor.getInstance().getConfig().getDataDirs()[0]);
+ File srcDir = new File(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()[0]);
if (tmpDir.exists()) {
FileUtils.deleteDirectory(tmpDir);
}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverLoaderIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverLoaderIT.java
index f907a03d89..8810d5874a 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverLoaderIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverLoaderIT.java
@@ -62,7 +62,7 @@ public class IoTDBSyncReceiverLoaderIT {
IoTDBDescriptor.getInstance().getConfig().setEnableCrossSpaceCompaction(false);
SyncTestUtil.insertData();
EnvironmentUtils.shutdownDaemon();
- File srcDir = new File(IoTDBDescriptor.getInstance().getConfig().getDataDirs()[0]);
+ File srcDir = new File(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()[0]);
FileUtils.moveDirectory(srcDir, tmpDir);
}
diff --git a/node-commons/src/assembly/resources/conf/iotdb-common.properties b/node-commons/src/assembly/resources/conf/iotdb-common.properties
index 48bd73ad80..031024e011 100644
--- a/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -404,11 +404,11 @@ cluster_name=defaultCluster
# The max capacity of a TsBlock
# Datatype: int, Unit: byte
-# max_tsblock_size_in_bytes=131072
+# max_ts_block_size_in_bytes=131072
# The max number of lines in a single TsBlock
# Datatype: int
-# max_tsblock_line_number=1000
+# max_ts_block_line_number=1000
# Time cost(ms) threshold for slow query
# Datatype: long
@@ -450,7 +450,7 @@ cluster_name=defaultCluster
# When the waiting time (in ms) of an inserting exceeds this, throw an exception. 10000 by default.
# If the insertion has been rejected and the read load is low, it can be set larger
# Datatype: int
-# max_waiting_time_when_insert_blocked=10000
+# max_waiting_time_when_insert_blocked_in_ms=10000
# Add a switch to drop ouf-of-order data
# Out-of-order data will impact the aggregation query a lot. Users may not care about discarding some out-of-order data.
@@ -800,16 +800,16 @@ cluster_name=defaultCluster
# Datatype: string
# admin_name=root
+# admin password, default is root
+# Datatype: string
+# admin_password=root
+
# encryption provider class
# iotdb_server_encrypt_decrypt_provider=org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt
# encryption provided class parameter
# iotdb_server_encrypt_decrypt_provider_parameter=
-# admin password, default is root
-# Datatype: string
-# admin_password=root
-
# Cache size of user and role
# Datatype: int
# author_cache_size=1000
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 7731b680a4..40c25dab86 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -18,12 +18,14 @@
*/
package org.apache.iotdb.commons.conf;
-import org.apache.iotdb.commons.client.property.ClientPoolProperty.DefaultProperty;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.consensus.ConsensusProtocolClass;
import org.apache.iotdb.commons.enums.HandleSystemErrorStrategy;
import org.apache.iotdb.commons.loadbalance.LeaderDistributionPolicy;
import org.apache.iotdb.commons.loadbalance.RegionGroupExtensionPolicy;
+import org.apache.iotdb.commons.utils.datastructure.TVListSortAlgorithm;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
import org.apache.iotdb.tsfile.fileSystem.FSType;
import org.slf4j.Logger;
@@ -106,28 +108,187 @@ public class CommonConfig {
private double diskSpaceWarningThreshold = 0.05;
/** Memory Control Configuration */
- // TODO: Move from IoTDBConfig
+ // Is the writing mem control for writing enable
+ private boolean enableMemControl = true;
+ // TODO:
+
+ // Memory allocated for the write process
+ private long allocateMemoryForStorageEngine = Runtime.getRuntime().maxMemory() * 3 / 10;
+
+ // Memory allocated for the read process
+ private long allocateMemoryForRead = Runtime.getRuntime().maxMemory() * 3 / 10;
+
+ // Memory allocated for the MTree
+ private long allocateMemoryForSchema = Runtime.getRuntime().maxMemory() / 10;
+
+ // Memory allocated for the consensus layer
+ private long allocateMemoryForConsensus = Runtime.getRuntime().maxMemory() / 10;
/** Schema Engine Configuration */
- // TODO: Move from IoTDBConfig
+ // ThreadPool size for read operation in coordinator
+ private int coordinatorReadExecutorSize = 20;
+ // ThreadPool size for write operation in coordinator
+ private int coordinatorWriteExecutorSize = 50;
+
+ // Cache size of partition cache in {@link
+ // org.apache.iotdb.db.mpp.plan.analyze.ClusterPartitionFetcher}
+ private int partitionCacheSize = 1000;
+
+ // Size of log buffer for every MetaData operation. If the size of a MetaData operation plan is
+ // larger than this parameter, then the MetaData operation plan will be rejected by SchemaRegion.
+ // Unit: byte
+ private int mlogBufferSize = 1024 * 1024;
+
+ // The cycle when metadata log is periodically forced to be written to disk(in milliseconds) If
+ // set this parameter to 0 it means call channel.force(true) after every each operation
+ private long syncMlogPeriodInMs = 100;
+
+ // Interval num of tag and attribute records when force flushing to disk
+ private int tagAttributeFlushInterval = 1000;
+ // max size for tag and attribute of one time series
+ private int tagAttributeTotalSize = 700;
+
+ // Maximum number of measurement in one create timeseries plan node. If the number of measurement
+ // in user request exceeds this limit, the request will be split.
+ private int maxMeasurementNumOfInternalRequest = 10000;
/** Configurations for creating schema automatically */
- // TODO: Move from IoTDBConfig
+ // Switch of creating schema automatically
+ private boolean enableAutoCreateSchema = true;
+ // Database level when creating schema automatically is enabled
+ private int defaultStorageGroupLevel = 1;
+
+ // Register time series as which type when receiving boolean string "true" or "false"
+ private TSDataType booleanStringInferType = TSDataType.BOOLEAN;
+ // register time series as which type when receiving an integer string "67"
+ private TSDataType integerStringInferType = TSDataType.FLOAT;
+ // register time series as which type when receiving an integer string and using float may lose
+ // precision num > 2 ^ 24
+ private TSDataType longStringInferType = TSDataType.DOUBLE;
+ // register time series as which type when receiving a floating number string "6.7"
+ private TSDataType floatingStringInferType = TSDataType.FLOAT;
+ // register time series as which type when receiving the Literal NaN. Values can be DOUBLE, FLOAT
+ // or TEXT
+ private TSDataType nanStringInferType = TSDataType.DOUBLE;
+
+ // BOOLEAN encoding when creating schema automatically is enabled
+ private TSEncoding defaultBooleanEncoding = TSEncoding.RLE;
+ // INT32 encoding when creating schema automatically is enabled
+ private TSEncoding defaultInt32Encoding = TSEncoding.RLE;
+ // INT64 encoding when creating schema automatically is enabled
+ private TSEncoding defaultInt64Encoding = TSEncoding.RLE;
+ // FLOAT encoding when creating schema automatically is enabled
+ private TSEncoding defaultFloatEncoding = TSEncoding.GORILLA;
+ // DOUBLE encoding when creating schema automatically is enabled
+ private TSEncoding defaultDoubleEncoding = TSEncoding.GORILLA;
+ // TEXT encoding when creating schema automatically is enabled
+ private TSEncoding defaultTextEncoding = TSEncoding.PLAIN;
/** Query Configurations */
// The read consistency level
private String readConsistencyLevel = "strong";
- // TODO: Move from IoTDBConfig
+
+ // Whether to cache metadata(ChunkMetaData and TsFileMetaData) or not
+ private boolean metaDataCacheEnable = true;
+ // TODO:
+
+ // Whether to enable last cache
+ private boolean lastCacheEnable = true;
+
+ private volatile int maxDeduplicatedPathNum = 1000;
+
+ // Core pool size of mpp data exchange
+ private int mppDataExchangeCorePoolSize = 10;
+ // Max pool size of mpp data exchange
+ private int mppDataExchangeMaxPoolSize = 10;
+ // Thread keep alive time in ms of mpp data exchange
+ private int mppDataExchangeKeepAliveTimeInMs = 1000;
+
+ // Maximum execution time of a DriverTask
+ private int driverTaskExecutionTimeSliceInMs = 100;
+
+ // Maximum capacity of a TsBlock, allow up to two pages
+ private int maxTsBlockSizeInBytes = 128 * 1024;
+ // Maximum number of lines in a single TsBlock
+ private int maxTsBlockLineNumber = 1000;
+
+ // Time cost(ms) threshold for slow query. Unit: millisecond
+ private long slowQueryThreshold = 5000;
+ // The max executing time of query in ms. Unit: millisecond
+ private long queryTimeoutThreshold = 60000;
+ // How many queries can be concurrently executed. When <= 0, use 1000
+ private int maxAllowedConcurrentQueries = 1000;
+ // How many threads can concurrently execute query statement. When <= 0, use CPU core number
+ private int queryThreadCount = Runtime.getRuntime().availableProcessors();
+ // The amount of data iterate each time in server
+ private int batchSize = 100000;
/** Storage Engine Configuration */
+ // This variable set timestamp precision as millisecond, microsecond or nanosecond
+ private String timestampPrecision = "ms";
// Default TTL for databases that are not set TTL by statements, in ms.
// <p> Notice: if this property is changed, previous created database which are not set TTL will
// also be affected. Unit: millisecond
private long defaultTtlInMs = Long.MAX_VALUE;
- // TODO: Move from IoTDBConfig
+
+ // When inserting rejected exceeds this, throw an exception. Unit: millisecond
+ private int maxWaitingTimeWhenInsertBlockedInMs = 10000;
+
+ private boolean enableDiscardOutOfOrderData = false;
+
+ // What will the system do when unrecoverable error occurs
+ private HandleSystemErrorStrategy handleSystemErrorStrategy =
+ HandleSystemErrorStrategy.CHANGE_TO_READ_ONLY;
+
+ // When a memTable's size (in byte) exceeds this, the memtable is flushed to disk. Unit: byte
+ private long memtableSizeThreshold = 1024 * 1024 * 1024L;
+
+ // Whether to timed flush sequence tsfiles' memtables
+ private boolean enableTimedFlushSeqMemtable = true;
+
+ // If a memTable's created time is older than current time minus this, the memtable will be
+ // flushed to disk.(only check sequence tsfiles' memtables) Unit: ms
+ private long seqMemtableFlushInterval = 3 * 60 * 60 * 1000L;
+
+ // The interval to check whether sequence memtables need flushing. Unit: ms
+ private long seqMemtableFlushCheckInterval = 10 * 60 * 1000L;
+
+ // Whether to timed flush unsequence tsfiles' memtables
+ private boolean enableTimedFlushUnseqMemtable = true;
+
+ // If a memTable's created time is older than current time minus this, the memtable will be
+ // flushed to disk.(only check unsequence tsfiles' memtables) Unit: ms
+ private long unseqMemtableFlushInterval = 3 * 60 * 60 * 1000L;
+
+ // The interval to check whether unsequence memtables need flushing. Unit: ms
+ private long unseqMemtableFlushCheckInterval = 10 * 60 * 1000L;
+
+ // The sort algorithm used in TVList
+ private TVListSortAlgorithm tvListSortAlgorithm = TVListSortAlgorithm.TIM;
+
+ // When average series point number reaches this, flush the memtable to disk
+ private int avgSeriesPointNumberThreshold = 100000;
+
+ // How many threads can concurrently flush. When <= 0, use CPU core number
+ private int flushThreadCount = Runtime.getRuntime().availableProcessors();
+
+ // In one insert (one device, one timestamp, multiple measurements),
+ // if enable partial insert, one measurement failure will not impact other measurements
+ private boolean enablePartialInsert = true;
+
+ // The interval to log recover progress of each vsg when starting iotdb
+ private long recoveryLogIntervalInMs = 5_000L;
+
+ // How many threads will be set up to perform upgrade tasks
+ private int upgradeThreadCount = 1;
/** Compaction Configurations */
- // TODO: Move from IoTDBConfig
+ // Enable inner space compaction for sequence files
+ private boolean enableSeqSpaceCompaction = true;
+ // Enable inner space compaction for unsequence files
+ private boolean enableUnseqSpaceCompaction = true;
+ // Compact the unsequence files into the overlapped sequence files
+ private boolean enableCrossSpaceCompaction = true;
/** Write Ahead Log Configuration */
// TODO: Move from IoTDBConfig
@@ -145,6 +306,9 @@ public class CommonConfig {
// Open ID Secret
private String openIdProviderUrl = "";
+ private String adminName = "root";
+ private String adminPassword = "root";
+
// Encryption provider class
private String encryptDecryptProvider =
"org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt";
@@ -152,10 +316,6 @@ public class CommonConfig {
// Encryption provided class parameter
private String encryptDecryptProviderParameter;
- private String adminName = "root";
-
- private String adminPassword = "root";
-
// TODO: Move from IoTDBConfig
/** UDF Configuration */
@@ -295,21 +455,10 @@ public class CommonConfig {
+ IoTDBConstant.SYSTEM_FOLDER_NAME
+ File.separator
+ "procedure";
- // Sync directory, including the log and hardlink tsfiles
- private String syncDir =
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYNC_FOLDER_NAME;
- // WAL directories
- private String[] walDirs = {
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.WAL_FOLDER_NAME
- };
// Default system file storage is in local file system (unsupported)
private FSType systemFileStorageFs = FSType.LOCAL;
- // What will the system do when unrecoverable error occurs
- private HandleSystemErrorStrategy handleSystemErrorStrategy =
- HandleSystemErrorStrategy.CHANGE_TO_READ_ONLY;
-
CommonConfig() {
// Empty constructor
}
@@ -347,7 +496,8 @@ public class CommonConfig {
return configNodeConsensusProtocolClass;
}
- public void setConfigNodeConsensusProtocolClass(ConsensusProtocolClass configNodeConsensusProtocolClass) {
+ public void setConfigNodeConsensusProtocolClass(
+ ConsensusProtocolClass configNodeConsensusProtocolClass) {
this.configNodeConsensusProtocolClass = configNodeConsensusProtocolClass;
}
@@ -363,7 +513,8 @@ public class CommonConfig {
return schemaRegionConsensusProtocolClass;
}
- public void setSchemaRegionConsensusProtocolClass(ConsensusProtocolClass schemaRegionConsensusProtocolClass) {
+ public void setSchemaRegionConsensusProtocolClass(
+ ConsensusProtocolClass schemaRegionConsensusProtocolClass) {
this.schemaRegionConsensusProtocolClass = schemaRegionConsensusProtocolClass;
}
@@ -379,7 +530,8 @@ public class CommonConfig {
return dataRegionConsensusProtocolClass;
}
- public void setDataRegionConsensusProtocolClass(ConsensusProtocolClass dataRegionConsensusProtocolClass) {
+ public void setDataRegionConsensusProtocolClass(
+ ConsensusProtocolClass dataRegionConsensusProtocolClass) {
this.dataRegionConsensusProtocolClass = dataRegionConsensusProtocolClass;
}
@@ -419,7 +571,8 @@ public class CommonConfig {
return schemaRegionGroupExtensionPolicy;
}
- public void setSchemaRegionGroupExtensionPolicy(RegionGroupExtensionPolicy schemaRegionGroupExtensionPolicy) {
+ public void setSchemaRegionGroupExtensionPolicy(
+ RegionGroupExtensionPolicy schemaRegionGroupExtensionPolicy) {
this.schemaRegionGroupExtensionPolicy = schemaRegionGroupExtensionPolicy;
}
@@ -435,7 +588,8 @@ public class CommonConfig {
return dataRegionGroupExtensionPolicy;
}
- public void setDataRegionGroupExtensionPolicy(RegionGroupExtensionPolicy dataRegionGroupExtensionPolicy) {
+ public void setDataRegionGroupExtensionPolicy(
+ RegionGroupExtensionPolicy dataRegionGroupExtensionPolicy) {
this.dataRegionGroupExtensionPolicy = dataRegionGroupExtensionPolicy;
}
@@ -483,7 +637,8 @@ public class CommonConfig {
return enableAutoLeaderBalanceForRatisConsensus;
}
- public void setEnableAutoLeaderBalanceForRatisConsensus(boolean enableAutoLeaderBalanceForRatisConsensus) {
+ public void setEnableAutoLeaderBalanceForRatisConsensus(
+ boolean enableAutoLeaderBalanceForRatisConsensus) {
this.enableAutoLeaderBalanceForRatisConsensus = enableAutoLeaderBalanceForRatisConsensus;
}
@@ -491,7 +646,8 @@ public class CommonConfig {
return enableAutoLeaderBalanceForIoTConsensus;
}
- public void setEnableAutoLeaderBalanceForIoTConsensus(boolean enableAutoLeaderBalanceForIoTConsensus) {
+ public void setEnableAutoLeaderBalanceForIoTConsensus(
+ boolean enableAutoLeaderBalanceForIoTConsensus) {
this.enableAutoLeaderBalanceForIoTConsensus = enableAutoLeaderBalanceForIoTConsensus;
}
@@ -619,31 +775,38 @@ public class CommonConfig {
return configNodeRatisConsensusLogAppenderBufferSize;
}
- public void setConfigNodeRatisConsensusLogAppenderBufferSize(long configNodeRatisConsensusLogAppenderBufferSize) {
- this.configNodeRatisConsensusLogAppenderBufferSize = configNodeRatisConsensusLogAppenderBufferSize;
+ public void setConfigNodeRatisConsensusLogAppenderBufferSize(
+ long configNodeRatisConsensusLogAppenderBufferSize) {
+ this.configNodeRatisConsensusLogAppenderBufferSize =
+ configNodeRatisConsensusLogAppenderBufferSize;
}
public long getSchemaRegionRatisConsensusLogAppenderBufferSize() {
return schemaRegionRatisConsensusLogAppenderBufferSize;
}
- public void setSchemaRegionRatisConsensusLogAppenderBufferSize(long schemaRegionRatisConsensusLogAppenderBufferSize) {
- this.schemaRegionRatisConsensusLogAppenderBufferSize = schemaRegionRatisConsensusLogAppenderBufferSize;
+ public void setSchemaRegionRatisConsensusLogAppenderBufferSize(
+ long schemaRegionRatisConsensusLogAppenderBufferSize) {
+ this.schemaRegionRatisConsensusLogAppenderBufferSize =
+ schemaRegionRatisConsensusLogAppenderBufferSize;
}
public long getDataRegionRatisConsensusLogAppenderBufferSize() {
return dataRegionRatisConsensusLogAppenderBufferSize;
}
- public void setDataRegionRatisConsensusLogAppenderBufferSize(long dataRegionRatisConsensusLogAppenderBufferSize) {
- this.dataRegionRatisConsensusLogAppenderBufferSize = dataRegionRatisConsensusLogAppenderBufferSize;
+ public void setDataRegionRatisConsensusLogAppenderBufferSize(
+ long dataRegionRatisConsensusLogAppenderBufferSize) {
+ this.dataRegionRatisConsensusLogAppenderBufferSize =
+ dataRegionRatisConsensusLogAppenderBufferSize;
}
public long getConfigNodeRatisSnapshotTriggerThreshold() {
return configNodeRatisSnapshotTriggerThreshold;
}
- public void setConfigNodeRatisSnapshotTriggerThreshold(long configNodeRatisSnapshotTriggerThreshold) {
+ public void setConfigNodeRatisSnapshotTriggerThreshold(
+ long configNodeRatisSnapshotTriggerThreshold) {
this.configNodeRatisSnapshotTriggerThreshold = configNodeRatisSnapshotTriggerThreshold;
}
@@ -651,7 +814,8 @@ public class CommonConfig {
return schemaRegionRatisSnapshotTriggerThreshold;
}
- public void setSchemaRegionRatisSnapshotTriggerThreshold(long schemaRegionRatisSnapshotTriggerThreshold) {
+ public void setSchemaRegionRatisSnapshotTriggerThreshold(
+ long schemaRegionRatisSnapshotTriggerThreshold) {
this.schemaRegionRatisSnapshotTriggerThreshold = schemaRegionRatisSnapshotTriggerThreshold;
}
@@ -659,7 +823,8 @@ public class CommonConfig {
return dataRegionRatisSnapshotTriggerThreshold;
}
- public void setDataRegionRatisSnapshotTriggerThreshold(long dataRegionRatisSnapshotTriggerThreshold) {
+ public void setDataRegionRatisSnapshotTriggerThreshold(
+ long dataRegionRatisSnapshotTriggerThreshold) {
this.dataRegionRatisSnapshotTriggerThreshold = dataRegionRatisSnapshotTriggerThreshold;
}
@@ -675,7 +840,8 @@ public class CommonConfig {
return schemaRegionRatisLogUnsafeFlushEnable;
}
- public void setSchemaRegionRatisLogUnsafeFlushEnable(boolean schemaRegionRatisLogUnsafeFlushEnable) {
+ public void setSchemaRegionRatisLogUnsafeFlushEnable(
+ boolean schemaRegionRatisLogUnsafeFlushEnable) {
this.schemaRegionRatisLogUnsafeFlushEnable = schemaRegionRatisLogUnsafeFlushEnable;
}
@@ -715,7 +881,8 @@ public class CommonConfig {
return configNodeSimpleConsensusLogSegmentSizeMax;
}
- public void setConfigNodeSimpleConsensusLogSegmentSizeMax(long configNodeSimpleConsensusLogSegmentSizeMax) {
+ public void setConfigNodeSimpleConsensusLogSegmentSizeMax(
+ long configNodeSimpleConsensusLogSegmentSizeMax) {
this.configNodeSimpleConsensusLogSegmentSizeMax = configNodeSimpleConsensusLogSegmentSizeMax;
}
@@ -731,7 +898,8 @@ public class CommonConfig {
return schemaRegionRatisGrpcFlowControlWindow;
}
- public void setSchemaRegionRatisGrpcFlowControlWindow(long schemaRegionRatisGrpcFlowControlWindow) {
+ public void setSchemaRegionRatisGrpcFlowControlWindow(
+ long schemaRegionRatisGrpcFlowControlWindow) {
this.schemaRegionRatisGrpcFlowControlWindow = schemaRegionRatisGrpcFlowControlWindow;
}
@@ -747,48 +915,60 @@ public class CommonConfig {
return configNodeRatisRpcLeaderElectionTimeoutMinMs;
}
- public void setConfigNodeRatisRpcLeaderElectionTimeoutMinMs(long configNodeRatisRpcLeaderElectionTimeoutMinMs) {
- this.configNodeRatisRpcLeaderElectionTimeoutMinMs = configNodeRatisRpcLeaderElectionTimeoutMinMs;
+ public void setConfigNodeRatisRpcLeaderElectionTimeoutMinMs(
+ long configNodeRatisRpcLeaderElectionTimeoutMinMs) {
+ this.configNodeRatisRpcLeaderElectionTimeoutMinMs =
+ configNodeRatisRpcLeaderElectionTimeoutMinMs;
}
public long getSchemaRegionRatisRpcLeaderElectionTimeoutMinMs() {
return schemaRegionRatisRpcLeaderElectionTimeoutMinMs;
}
- public void setSchemaRegionRatisRpcLeaderElectionTimeoutMinMs(long schemaRegionRatisRpcLeaderElectionTimeoutMinMs) {
- this.schemaRegionRatisRpcLeaderElectionTimeoutMinMs = schemaRegionRatisRpcLeaderElectionTimeoutMinMs;
+ public void setSchemaRegionRatisRpcLeaderElectionTimeoutMinMs(
+ long schemaRegionRatisRpcLeaderElectionTimeoutMinMs) {
+ this.schemaRegionRatisRpcLeaderElectionTimeoutMinMs =
+ schemaRegionRatisRpcLeaderElectionTimeoutMinMs;
}
public long getDataRegionRatisRpcLeaderElectionTimeoutMinMs() {
return dataRegionRatisRpcLeaderElectionTimeoutMinMs;
}
- public void setDataRegionRatisRpcLeaderElectionTimeoutMinMs(long dataRegionRatisRpcLeaderElectionTimeoutMinMs) {
- this.dataRegionRatisRpcLeaderElectionTimeoutMinMs = dataRegionRatisRpcLeaderElectionTimeoutMinMs;
+ public void setDataRegionRatisRpcLeaderElectionTimeoutMinMs(
+ long dataRegionRatisRpcLeaderElectionTimeoutMinMs) {
+ this.dataRegionRatisRpcLeaderElectionTimeoutMinMs =
+ dataRegionRatisRpcLeaderElectionTimeoutMinMs;
}
public long getConfigNodeRatisRpcLeaderElectionTimeoutMaxMs() {
return configNodeRatisRpcLeaderElectionTimeoutMaxMs;
}
- public void setConfigNodeRatisRpcLeaderElectionTimeoutMaxMs(long configNodeRatisRpcLeaderElectionTimeoutMaxMs) {
- this.configNodeRatisRpcLeaderElectionTimeoutMaxMs = configNodeRatisRpcLeaderElectionTimeoutMaxMs;
+ public void setConfigNodeRatisRpcLeaderElectionTimeoutMaxMs(
+ long configNodeRatisRpcLeaderElectionTimeoutMaxMs) {
+ this.configNodeRatisRpcLeaderElectionTimeoutMaxMs =
+ configNodeRatisRpcLeaderElectionTimeoutMaxMs;
}
public long getSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs() {
return schemaRegionRatisRpcLeaderElectionTimeoutMaxMs;
}
- public void setSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs(long schemaRegionRatisRpcLeaderElectionTimeoutMaxMs) {
- this.schemaRegionRatisRpcLeaderElectionTimeoutMaxMs = schemaRegionRatisRpcLeaderElectionTimeoutMaxMs;
+ public void setSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs(
+ long schemaRegionRatisRpcLeaderElectionTimeoutMaxMs) {
+ this.schemaRegionRatisRpcLeaderElectionTimeoutMaxMs =
+ schemaRegionRatisRpcLeaderElectionTimeoutMaxMs;
}
public long getDataRegionRatisRpcLeaderElectionTimeoutMaxMs() {
return dataRegionRatisRpcLeaderElectionTimeoutMaxMs;
}
- public void setDataRegionRatisRpcLeaderElectionTimeoutMaxMs(long dataRegionRatisRpcLeaderElectionTimeoutMaxMs) {
- this.dataRegionRatisRpcLeaderElectionTimeoutMaxMs = dataRegionRatisRpcLeaderElectionTimeoutMaxMs;
+ public void setDataRegionRatisRpcLeaderElectionTimeoutMaxMs(
+ long dataRegionRatisRpcLeaderElectionTimeoutMaxMs) {
+ this.dataRegionRatisRpcLeaderElectionTimeoutMaxMs =
+ dataRegionRatisRpcLeaderElectionTimeoutMaxMs;
}
public long getConfigNodeRatisRequestTimeoutMs() {
@@ -899,7 +1079,8 @@ public class CommonConfig {
return schemaRegionRatisPreserveLogsWhenPurge;
}
- public void setSchemaRegionRatisPreserveLogsWhenPurge(long schemaRegionRatisPreserveLogsWhenPurge) {
+ public void setSchemaRegionRatisPreserveLogsWhenPurge(
+ long schemaRegionRatisPreserveLogsWhenPurge) {
this.schemaRegionRatisPreserveLogsWhenPurge = schemaRegionRatisPreserveLogsWhenPurge;
}
@@ -1039,6 +1220,493 @@ public class CommonConfig {
this.handleSystemErrorStrategy = handleSystemErrorStrategy;
}
+ public boolean isEnableMemControl() {
+ return enableMemControl;
+ }
+
+ public void setEnableMemControl(boolean enableMemControl) {
+ this.enableMemControl = enableMemControl;
+ }
+
+ public long getAllocateMemoryForStorageEngine() {
+ return allocateMemoryForStorageEngine;
+ }
+
+ public void setAllocateMemoryForStorageEngine(long allocateMemoryForStorageEngine) {
+ this.allocateMemoryForStorageEngine = allocateMemoryForStorageEngine;
+ }
+
+ public long getAllocateMemoryForRead() {
+ return allocateMemoryForRead;
+ }
+
+ public void setAllocateMemoryForRead(long allocateMemoryForRead) {
+ this.allocateMemoryForRead = allocateMemoryForRead;
+ }
+
+ public long getAllocateMemoryForSchema() {
+ return allocateMemoryForSchema;
+ }
+
+ public void setAllocateMemoryForSchema(long allocateMemoryForSchema) {
+ this.allocateMemoryForSchema = allocateMemoryForSchema;
+ }
+
+ public long getAllocateMemoryForConsensus() {
+ return allocateMemoryForConsensus;
+ }
+
+ public void setAllocateMemoryForConsensus(long allocateMemoryForConsensus) {
+ this.allocateMemoryForConsensus = allocateMemoryForConsensus;
+ }
+
+ public int getCoordinatorReadExecutorSize() {
+ return coordinatorReadExecutorSize;
+ }
+
+ public void setCoordinatorReadExecutorSize(int coordinatorReadExecutorSize) {
+ this.coordinatorReadExecutorSize = coordinatorReadExecutorSize;
+ }
+
+ public int getCoordinatorWriteExecutorSize() {
+ return coordinatorWriteExecutorSize;
+ }
+
+ public void setCoordinatorWriteExecutorSize(int coordinatorWriteExecutorSize) {
+ this.coordinatorWriteExecutorSize = coordinatorWriteExecutorSize;
+ }
+
+ public int getPartitionCacheSize() {
+ return partitionCacheSize;
+ }
+
+ public void setPartitionCacheSize(int partitionCacheSize) {
+ this.partitionCacheSize = partitionCacheSize;
+ }
+
+ public int getMlogBufferSize() {
+ return mlogBufferSize;
+ }
+
+ public void setMlogBufferSize(int mlogBufferSize) {
+ this.mlogBufferSize = mlogBufferSize;
+ }
+
+ public long getSyncMlogPeriodInMs() {
+ return syncMlogPeriodInMs;
+ }
+
+ public void setSyncMlogPeriodInMs(long syncMlogPeriodInMs) {
+ this.syncMlogPeriodInMs = syncMlogPeriodInMs;
+ }
+
+ public int getTagAttributeFlushInterval() {
+ return tagAttributeFlushInterval;
+ }
+
+ public void setTagAttributeFlushInterval(int tagAttributeFlushInterval) {
+ this.tagAttributeFlushInterval = tagAttributeFlushInterval;
+ }
+
+ public int getTagAttributeTotalSize() {
+ return tagAttributeTotalSize;
+ }
+
+ public void setTagAttributeTotalSize(int tagAttributeTotalSize) {
+ this.tagAttributeTotalSize = tagAttributeTotalSize;
+ }
+
+ public int getMaxMeasurementNumOfInternalRequest() {
+ return maxMeasurementNumOfInternalRequest;
+ }
+
+ public void setMaxMeasurementNumOfInternalRequest(int maxMeasurementNumOfInternalRequest) {
+ this.maxMeasurementNumOfInternalRequest = maxMeasurementNumOfInternalRequest;
+ }
+
+ public boolean isEnableAutoCreateSchema() {
+ return enableAutoCreateSchema;
+ }
+
+ public void setEnableAutoCreateSchema(boolean enableAutoCreateSchema) {
+ this.enableAutoCreateSchema = enableAutoCreateSchema;
+ }
+
+ public int getDefaultStorageGroupLevel() {
+ return defaultStorageGroupLevel;
+ }
+
+ public void setDefaultStorageGroupLevel(int defaultStorageGroupLevel) {
+ this.defaultStorageGroupLevel = defaultStorageGroupLevel;
+ }
+
+ public TSDataType getBooleanStringInferType() {
+ return booleanStringInferType;
+ }
+
+ public void setBooleanStringInferType(TSDataType booleanStringInferType) {
+ this.booleanStringInferType = booleanStringInferType;
+ }
+
+ public TSDataType getIntegerStringInferType() {
+ return integerStringInferType;
+ }
+
+ public void setIntegerStringInferType(TSDataType integerStringInferType) {
+ this.integerStringInferType = integerStringInferType;
+ }
+
+ public TSDataType getLongStringInferType() {
+ return longStringInferType;
+ }
+
+ public void setLongStringInferType(TSDataType longStringInferType) {
+ this.longStringInferType = longStringInferType;
+ }
+
+ public TSDataType getFloatingStringInferType() {
+ return floatingStringInferType;
+ }
+
+ public void setFloatingStringInferType(TSDataType floatingStringInferType) {
+ this.floatingStringInferType = floatingStringInferType;
+ }
+
+ public TSDataType getNanStringInferType() {
+ return nanStringInferType;
+ }
+
+ public void setNanStringInferType(TSDataType nanStringInferType) {
+ if (nanStringInferType != TSDataType.DOUBLE
+ && nanStringInferType != TSDataType.FLOAT
+ && nanStringInferType != TSDataType.TEXT) {
+ throw new IllegalArgumentException(
+ "Config Property nan_string_infer_type can only be FLOAT, DOUBLE or TEXT but is "
+ + nanStringInferType);
+ }
+ this.nanStringInferType = nanStringInferType;
+ }
+
+ public TSEncoding getDefaultBooleanEncoding() {
+ return defaultBooleanEncoding;
+ }
+
+ public void setDefaultBooleanEncoding(TSEncoding defaultBooleanEncoding) {
+ this.defaultBooleanEncoding = defaultBooleanEncoding;
+ }
+
+ public TSEncoding getDefaultInt32Encoding() {
+ return defaultInt32Encoding;
+ }
+
+ public void setDefaultInt32Encoding(TSEncoding defaultInt32Encoding) {
+ this.defaultInt32Encoding = defaultInt32Encoding;
+ }
+
+ public TSEncoding getDefaultInt64Encoding() {
+ return defaultInt64Encoding;
+ }
+
+ public void setDefaultInt64Encoding(TSEncoding defaultInt64Encoding) {
+ this.defaultInt64Encoding = defaultInt64Encoding;
+ }
+
+ public TSEncoding getDefaultFloatEncoding() {
+ return defaultFloatEncoding;
+ }
+
+ public void setDefaultFloatEncoding(TSEncoding defaultFloatEncoding) {
+ this.defaultFloatEncoding = defaultFloatEncoding;
+ }
+
+ public TSEncoding getDefaultDoubleEncoding() {
+ return defaultDoubleEncoding;
+ }
+
+ public void setDefaultDoubleEncoding(TSEncoding defaultDoubleEncoding) {
+ this.defaultDoubleEncoding = defaultDoubleEncoding;
+ }
+
+ public TSEncoding getDefaultTextEncoding() {
+ return defaultTextEncoding;
+ }
+
+ public void setDefaultTextEncoding(TSEncoding defaultTextEncoding) {
+ this.defaultTextEncoding = defaultTextEncoding;
+ }
+
+ public boolean isMetaDataCacheEnable() {
+ return metaDataCacheEnable;
+ }
+
+ public void setMetaDataCacheEnable(boolean metaDataCacheEnable) {
+ this.metaDataCacheEnable = metaDataCacheEnable;
+ }
+
+ public boolean isLastCacheEnable() {
+ return lastCacheEnable;
+ }
+
+ public void setLastCacheEnable(boolean lastCacheEnable) {
+ this.lastCacheEnable = lastCacheEnable;
+ }
+
+ public int getMaxDeduplicatedPathNum() {
+ return maxDeduplicatedPathNum;
+ }
+
+ public void setMaxDeduplicatedPathNum(int maxDeduplicatedPathNum) {
+ this.maxDeduplicatedPathNum = maxDeduplicatedPathNum;
+ }
+
+ public int getMppDataExchangeCorePoolSize() {
+ return mppDataExchangeCorePoolSize;
+ }
+
+ public void setMppDataExchangeCorePoolSize(int mppDataExchangeCorePoolSize) {
+ this.mppDataExchangeCorePoolSize = mppDataExchangeCorePoolSize;
+ }
+
+ public int getMppDataExchangeMaxPoolSize() {
+ return mppDataExchangeMaxPoolSize;
+ }
+
+ public void setMppDataExchangeMaxPoolSize(int mppDataExchangeMaxPoolSize) {
+ this.mppDataExchangeMaxPoolSize = mppDataExchangeMaxPoolSize;
+ }
+
+ public int getMppDataExchangeKeepAliveTimeInMs() {
+ return mppDataExchangeKeepAliveTimeInMs;
+ }
+
+ public void setMppDataExchangeKeepAliveTimeInMs(int mppDataExchangeKeepAliveTimeInMs) {
+ this.mppDataExchangeKeepAliveTimeInMs = mppDataExchangeKeepAliveTimeInMs;
+ }
+
+ public int getDriverTaskExecutionTimeSliceInMs() {
+ return driverTaskExecutionTimeSliceInMs;
+ }
+
+ public void setDriverTaskExecutionTimeSliceInMs(int driverTaskExecutionTimeSliceInMs) {
+ this.driverTaskExecutionTimeSliceInMs = driverTaskExecutionTimeSliceInMs;
+ }
+
+ public int getMaxTsBlockSizeInBytes() {
+ return maxTsBlockSizeInBytes;
+ }
+
+ public void setMaxTsBlockSizeInBytes(int maxTsBlockSizeInBytes) {
+ this.maxTsBlockSizeInBytes = maxTsBlockSizeInBytes;
+ }
+
+ public int getMaxTsBlockLineNumber() {
+ return maxTsBlockLineNumber;
+ }
+
+ public void setMaxTsBlockLineNumber(int maxTsBlockLineNumber) {
+ this.maxTsBlockLineNumber = maxTsBlockLineNumber;
+ }
+
+ public long getSlowQueryThreshold() {
+ return slowQueryThreshold;
+ }
+
+ public void setSlowQueryThreshold(long slowQueryThreshold) {
+ this.slowQueryThreshold = slowQueryThreshold;
+ }
+
+ public long getQueryTimeoutThreshold() {
+ return queryTimeoutThreshold;
+ }
+
+ public void setQueryTimeoutThreshold(long queryTimeoutThreshold) {
+ this.queryTimeoutThreshold = queryTimeoutThreshold;
+ }
+
+ public int getMaxAllowedConcurrentQueries() {
+ return maxAllowedConcurrentQueries;
+ }
+
+ public void setMaxAllowedConcurrentQueries(int maxAllowedConcurrentQueries) {
+ this.maxAllowedConcurrentQueries = maxAllowedConcurrentQueries;
+ }
+
+ public int getQueryThreadCount() {
+ return queryThreadCount;
+ }
+
+ public void setQueryThreadCount(int queryThreadCount) {
+ this.queryThreadCount = queryThreadCount;
+ }
+
+ public int getBatchSize() {
+ return batchSize;
+ }
+
+ public void setBatchSize(int batchSize) {
+ this.batchSize = batchSize;
+ }
+
+ public String getTimestampPrecision() {
+ return timestampPrecision;
+ }
+
+ public void setTimestampPrecision(String timestampPrecision) {
+ if (!("ms".equals(timestampPrecision)
+ || "us".equals(timestampPrecision)
+ || "ns".equals(timestampPrecision))) {
+ logger.error(
+ "Wrong timestamp precision, please set as: ms, us or ns ! Current is: {}",
+ timestampPrecision);
+ System.exit(-1);
+ }
+ this.timestampPrecision = timestampPrecision;
+ }
+
+ public int getMaxWaitingTimeWhenInsertBlockedInMs() {
+ return maxWaitingTimeWhenInsertBlockedInMs;
+ }
+
+ public void setMaxWaitingTimeWhenInsertBlockedInMs(int maxWaitingTimeWhenInsertBlockedInMs) {
+ this.maxWaitingTimeWhenInsertBlockedInMs = maxWaitingTimeWhenInsertBlockedInMs;
+ }
+
+ public boolean isEnableDiscardOutOfOrderData() {
+ return enableDiscardOutOfOrderData;
+ }
+
+ public void setEnableDiscardOutOfOrderData(boolean enableDiscardOutOfOrderData) {
+ this.enableDiscardOutOfOrderData = enableDiscardOutOfOrderData;
+ }
+
+ public long getMemtableSizeThreshold() {
+ return memtableSizeThreshold;
+ }
+
+ public void setMemtableSizeThreshold(long memtableSizeThreshold) {
+ this.memtableSizeThreshold = memtableSizeThreshold;
+ }
+
+ public boolean isEnableTimedFlushSeqMemtable() {
+ return enableTimedFlushSeqMemtable;
+ }
+
+ public void setEnableTimedFlushSeqMemtable(boolean enableTimedFlushSeqMemtable) {
+ this.enableTimedFlushSeqMemtable = enableTimedFlushSeqMemtable;
+ }
+
+ public long getSeqMemtableFlushInterval() {
+ return seqMemtableFlushInterval;
+ }
+
+ public void setSeqMemtableFlushInterval(long seqMemtableFlushInterval) {
+ this.seqMemtableFlushInterval = seqMemtableFlushInterval;
+ }
+
+ public long getSeqMemtableFlushCheckInterval() {
+ return seqMemtableFlushCheckInterval;
+ }
+
+ public void setSeqMemtableFlushCheckInterval(long seqMemtableFlushCheckInterval) {
+ this.seqMemtableFlushCheckInterval = seqMemtableFlushCheckInterval;
+ }
+
+ public boolean isEnableTimedFlushUnseqMemtable() {
+ return enableTimedFlushUnseqMemtable;
+ }
+
+ public void setEnableTimedFlushUnseqMemtable(boolean enableTimedFlushUnseqMemtable) {
+ this.enableTimedFlushUnseqMemtable = enableTimedFlushUnseqMemtable;
+ }
+
+ public long getUnseqMemtableFlushInterval() {
+ return unseqMemtableFlushInterval;
+ }
+
+ public void setUnseqMemtableFlushInterval(long unseqMemtableFlushInterval) {
+ this.unseqMemtableFlushInterval = unseqMemtableFlushInterval;
+ }
+
+ public long getUnseqMemtableFlushCheckInterval() {
+ return unseqMemtableFlushCheckInterval;
+ }
+
+ public void setUnseqMemtableFlushCheckInterval(long unseqMemtableFlushCheckInterval) {
+ this.unseqMemtableFlushCheckInterval = unseqMemtableFlushCheckInterval;
+ }
+
+ public TVListSortAlgorithm getTvListSortAlgorithm() {
+ return tvListSortAlgorithm;
+ }
+
+ public void setTvListSortAlgorithm(TVListSortAlgorithm tvListSortAlgorithm) {
+ this.tvListSortAlgorithm = tvListSortAlgorithm;
+ }
+
+ public int getAvgSeriesPointNumberThreshold() {
+ return avgSeriesPointNumberThreshold;
+ }
+
+ public void setAvgSeriesPointNumberThreshold(int avgSeriesPointNumberThreshold) {
+ this.avgSeriesPointNumberThreshold = avgSeriesPointNumberThreshold;
+ }
+
+ public int getFlushThreadCount() {
+ return flushThreadCount;
+ }
+
+ public void setFlushThreadCount(int flushThreadCount) {
+ this.flushThreadCount = flushThreadCount;
+ }
+
+ public boolean isEnablePartialInsert() {
+ return enablePartialInsert;
+ }
+
+ public void setEnablePartialInsert(boolean enablePartialInsert) {
+ this.enablePartialInsert = enablePartialInsert;
+ }
+
+ public long getRecoveryLogIntervalInMs() {
+ return recoveryLogIntervalInMs;
+ }
+
+ public void setRecoveryLogIntervalInMs(long recoveryLogIntervalInMs) {
+ this.recoveryLogIntervalInMs = recoveryLogIntervalInMs;
+ }
+
+ public int getUpgradeThreadCount() {
+ return upgradeThreadCount;
+ }
+
+ public void setUpgradeThreadCount(int upgradeThreadCount) {
+ this.upgradeThreadCount = upgradeThreadCount;
+ }
+
+ public boolean isEnableSeqSpaceCompaction() {
+ return enableSeqSpaceCompaction;
+ }
+
+ public void setEnableSeqSpaceCompaction(boolean enableSeqSpaceCompaction) {
+ this.enableSeqSpaceCompaction = enableSeqSpaceCompaction;
+ }
+
+ public boolean isEnableUnseqSpaceCompaction() {
+ return enableUnseqSpaceCompaction;
+ }
+
+ public void setEnableUnseqSpaceCompaction(boolean enableUnseqSpaceCompaction) {
+ this.enableUnseqSpaceCompaction = enableUnseqSpaceCompaction;
+ }
+
+ public boolean isEnableCrossSpaceCompaction() {
+ return enableCrossSpaceCompaction;
+ }
+
+ public void setEnableCrossSpaceCompaction(boolean enableCrossSpaceCompaction) {
+ this.enableCrossSpaceCompaction = enableCrossSpaceCompaction;
+ }
+
public boolean isReadOnly() {
return status == NodeStatus.ReadOnly;
}
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonDescriptor.java b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonDescriptor.java
index 3928f48c4c..a17c973deb 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonDescriptor.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonDescriptor.java
@@ -23,7 +23,9 @@ import org.apache.iotdb.commons.consensus.ConsensusProtocolClass;
import org.apache.iotdb.commons.enums.HandleSystemErrorStrategy;
import org.apache.iotdb.commons.loadbalance.LeaderDistributionPolicy;
import org.apache.iotdb.commons.loadbalance.RegionGroupExtensionPolicy;
+import org.apache.iotdb.commons.utils.datastructure.TVListSortAlgorithm;
import org.apache.iotdb.confignode.rpc.thrift.TGlobalConfig;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -65,193 +67,335 @@ public class CommonDescriptor {
CONF.setProcedureWalFolder(systemDir + File.separator + "procedure");
}
-
-
private void loadCommonProps(Properties properties) {
+
+ /* Cluster Configuration */
CONF.setClusterName(
- properties.getProperty(IoTDBConstant.CLUSTER_NAME, CONF.getClusterName()).trim());
+ properties.getProperty(IoTDBConstant.CLUSTER_NAME, CONF.getClusterName()).trim());
+ /* Replication configuration */
try {
CONF.setConfigNodeConsensusProtocolClass(
- ConsensusProtocolClass.parse(
- properties
- .getProperty(
- "config_node_consensus_protocol_class", CONF.getConfigNodeConsensusProtocolClass().getProtocol())
- .trim()));
+ ConsensusProtocolClass.parse(
+ properties
+ .getProperty(
+ "config_node_consensus_protocol_class",
+ CONF.getConfigNodeConsensusProtocolClass().getProtocol())
+ .trim()));
} catch (IOException e) {
- LOGGER.warn("Unknown config_node_consensus_protocol_class in iotdb-common.properties file, use default config", e);
+ LOGGER.warn(
+ "Unknown config_node_consensus_protocol_class in iotdb-common.properties file, use default config",
+ e);
}
CONF.setSchemaReplicationFactor(
- Integer.parseInt(
- properties
- .getProperty(
- "schema_replication_factor", String.valueOf(CONF.getSchemaReplicationFactor()))
- .trim()));
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "schema_replication_factor", String.valueOf(CONF.getSchemaReplicationFactor()))
+ .trim()));
try {
CONF.setSchemaRegionConsensusProtocolClass(
- ConsensusProtocolClass.parse(
- properties
- .getProperty(
- "schema_region_consensus_protocol_class", CONF.getSchemaRegionConsensusProtocolClass().getProtocol())
- .trim()));
+ ConsensusProtocolClass.parse(
+ properties
+ .getProperty(
+ "schema_region_consensus_protocol_class",
+ CONF.getSchemaRegionConsensusProtocolClass().getProtocol())
+ .trim()));
} catch (IOException e) {
- LOGGER.warn("Unknown schema_region_consensus_protocol_class in iotdb-common.properties file, use default config", e);
+ LOGGER.warn(
+ "Unknown schema_region_consensus_protocol_class in iotdb-common.properties file, use default config",
+ e);
}
CONF.setDataReplicationFactor(
- Integer.parseInt(
- properties
- .getProperty(
- "data_replication_factor", String.valueOf(CONF.getDataReplicationFactor()))
- .trim()));
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "data_replication_factor", String.valueOf(CONF.getDataReplicationFactor()))
+ .trim()));
try {
CONF.setDataRegionConsensusProtocolClass(
- ConsensusProtocolClass.parse(
- properties
- .getProperty(
- "data_region_consensus_protocol_class", CONF.getDataRegionConsensusProtocolClass().getProtocol())
- .trim()));
+ ConsensusProtocolClass.parse(
+ properties
+ .getProperty(
+ "data_region_consensus_protocol_class",
+ CONF.getDataRegionConsensusProtocolClass().getProtocol())
+ .trim()));
} catch (IOException e) {
- LOGGER.warn("Unknown data_region_consensus_protocol_class in iotdb-common.properties file, use default config", e);
+ LOGGER.warn(
+ "Unknown data_region_consensus_protocol_class in iotdb-common.properties file, use default config",
+ e);
}
+ /* Load balancing configuration */
CONF.setSeriesSlotNum(
- Integer.parseInt(
- properties
- .getProperty("series_slot_num", String.valueOf(CONF.getSeriesSlotNum()))
- .trim()));
+ Integer.parseInt(
+ properties
+ .getProperty("series_slot_num", String.valueOf(CONF.getSeriesSlotNum()))
+ .trim()));
CONF.setSeriesPartitionExecutorClass(
- properties
- .getProperty("series_partition_executor_class", CONF.getSeriesPartitionExecutorClass())
- .trim());
+ properties
+ .getProperty("series_partition_executor_class", CONF.getSeriesPartitionExecutorClass())
+ .trim());
CONF.setSchemaRegionPerDataNode(
- Double.parseDouble(
- properties
- .getProperty(
- "schema_region_per_data_node",
- String.valueOf(CONF.getSchemaReplicationFactor()))
- .trim()));
+ Double.parseDouble(
+ properties
+ .getProperty(
+ "schema_region_per_data_node",
+ String.valueOf(CONF.getSchemaReplicationFactor()))
+ .trim()));
CONF.setDataRegionPerProcessor(
- Double.parseDouble(
- properties
- .getProperty(
- "data_region_per_processor", String.valueOf(CONF.getDataRegionPerProcessor()))
- .trim()));
+ Double.parseDouble(
+ properties
+ .getProperty(
+ "data_region_per_processor", String.valueOf(CONF.getDataRegionPerProcessor()))
+ .trim()));
try {
CONF.setSchemaRegionGroupExtensionPolicy(
- RegionGroupExtensionPolicy.parse(
- properties.getProperty(
- "schema_region_group_extension_policy",
- CONF.getSchemaRegionGroupExtensionPolicy().getPolicy().trim())));
+ RegionGroupExtensionPolicy.parse(
+ properties.getProperty(
+ "schema_region_group_extension_policy",
+ CONF.getSchemaRegionGroupExtensionPolicy().getPolicy().trim())));
} catch (IOException e) {
- LOGGER.warn("Unknown schema_region_group_extension_policy in iotdb-common.properties file, use default config", e);
+ LOGGER.warn(
+ "Unknown schema_region_group_extension_policy in iotdb-common.properties file, use default config",
+ e);
}
CONF.setSchemaRegionGroupPerDatabase(
- Integer.parseInt(
- properties.getProperty(
- "schema_region_group_per_database",
- String.valueOf(CONF.getSchemaRegionGroupPerDatabase()).trim())));
+ Integer.parseInt(
+ properties.getProperty(
+ "schema_region_group_per_database",
+ String.valueOf(CONF.getSchemaRegionGroupPerDatabase()).trim())));
try {
CONF.setDataRegionGroupExtensionPolicy(
- RegionGroupExtensionPolicy.parse(
- properties.getProperty(
- "data_region_group_extension_policy",
- CONF.getDataRegionGroupExtensionPolicy().getPolicy().trim())));
+ RegionGroupExtensionPolicy.parse(
+ properties.getProperty(
+ "data_region_group_extension_policy",
+ CONF.getDataRegionGroupExtensionPolicy().getPolicy().trim())));
} catch (IOException e) {
- LOGGER.warn("Unknown data_region_group_extension_policy in iotdb-common.properties file, use default config", e);
+ LOGGER.warn(
+ "Unknown data_region_group_extension_policy in iotdb-common.properties file, use default config",
+ e);
}
CONF.setDataRegionGroupPerDatabase(
- Integer.parseInt(
- properties.getProperty(
- "data_region_group_per_database",
- String.valueOf(CONF.getDataRegionGroupPerDatabase()).trim())));
+ Integer.parseInt(
+ properties.getProperty(
+ "data_region_group_per_database",
+ String.valueOf(CONF.getDataRegionGroupPerDatabase()).trim())));
CONF.setLeastDataRegionGroupNum(
- Integer.parseInt(
- properties.getProperty(
- "least_data_region_group_num", String.valueOf(CONF.getLeastDataRegionGroupNum()))));
+ Integer.parseInt(
+ properties.getProperty(
+ "least_data_region_group_num", String.valueOf(CONF.getLeastDataRegionGroupNum()))));
CONF.setEnableDataPartitionInheritPolicy(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_data_partition_inherit_policy",
- String.valueOf(CONF.isEnableDataPartitionInheritPolicy()))));
+ Boolean.parseBoolean(
+ properties.getProperty(
+ "enable_data_partition_inherit_policy",
+ String.valueOf(CONF.isEnableDataPartitionInheritPolicy()))));
try {
CONF.setLeaderDistributionPolicy(
- LeaderDistributionPolicy.parse(
- properties.getProperty(
- "leader_distribution_policy",
- CONF.getLeaderDistributionPolicy().getPolicy().trim())));
+ LeaderDistributionPolicy.parse(
+ properties.getProperty(
+ "leader_distribution_policy",
+ CONF.getLeaderDistributionPolicy().getPolicy().trim())));
} catch (IOException e) {
- LOGGER.warn("Unknown leader_distribution_policy in iotdb-common.properties file, use default config", e);
+ LOGGER.warn(
+ "Unknown leader_distribution_policy in iotdb-common.properties file, use default config",
+ e);
}
CONF.setEnableAutoLeaderBalanceForRatisConsensus(
- Boolean.parseBoolean(
- properties
- .getProperty(
- "enable_auto_leader_balance_for_ratis_consensus",
- String.valueOf(CONF.isEnableAutoLeaderBalanceForRatisConsensus()))
- .trim()));
+ Boolean.parseBoolean(
+ properties
+ .getProperty(
+ "enable_auto_leader_balance_for_ratis_consensus",
+ String.valueOf(CONF.isEnableAutoLeaderBalanceForRatisConsensus()))
+ .trim()));
CONF.setEnableAutoLeaderBalanceForIoTConsensus(
- Boolean.parseBoolean(
- properties
- .getProperty(
- "enable_auto_leader_balance_for_iot_consensus",
- String.valueOf(CONF.isEnableAutoLeaderBalanceForIoTConsensus()))
- .trim()));
+ Boolean.parseBoolean(
+ properties
+ .getProperty(
+ "enable_auto_leader_balance_for_iot_consensus",
+ String.valueOf(CONF.isEnableAutoLeaderBalanceForIoTConsensus()))
+ .trim()));
+ /* Cluster management */
CONF.setTimePartitionInterval(
- Long.parseLong(
- properties
- .getProperty(
- "time_partition_interval", String.valueOf(CONF.getTimePartitionInterval()))
- .trim()));
+ Long.parseLong(
+ properties
+ .getProperty(
+ "time_partition_interval", String.valueOf(CONF.getTimePartitionInterval()))
+ .trim()));
CONF.setHeartbeatIntervalInMs(
- Long.parseLong(
- properties
- .getProperty(
- "heartbeat_interval_in_ms", String.valueOf(CONF.getHeartbeatIntervalInMs()))
- .trim()));
+ Long.parseLong(
+ properties
+ .getProperty(
+ "heartbeat_interval_in_ms", String.valueOf(CONF.getHeartbeatIntervalInMs()))
+ .trim()));
CONF.setDiskSpaceWarningThreshold(
- Double.parseDouble(
- properties
- .getProperty(
- "disk_space_warning_threshold",
- String.valueOf(CONF.getDiskSpaceWarningThreshold()))
- .trim()));
+ Double.parseDouble(
+ properties
+ .getProperty(
+ "disk_space_warning_threshold",
+ String.valueOf(CONF.getDiskSpaceWarningThreshold()))
+ .trim()));
+
+ /* Schema Engine Configuration */
+ CONF.setCoordinatorReadExecutorSize(
+ Integer.parseInt(
+ properties.getProperty(
+ "coordinator_read_executor_size",
+ Integer.toString(CONF.getCoordinatorReadExecutorSize()))));
+
+ CONF.setCoordinatorWriteExecutorSize(
+ Integer.parseInt(
+ properties.getProperty(
+ "coordinator_write_executor_size",
+ Integer.toString(CONF.getCoordinatorWriteExecutorSize()))));
+
+ CONF.setPartitionCacheSize(
+ Integer.parseInt(
+ properties.getProperty(
+ "partition_cache_size", Integer.toString(CONF.getPartitionCacheSize()))));
+
+ int mlogBufferSize =
+ Integer.parseInt(
+ properties.getProperty("mlog_buffer_size", Integer.toString(CONF.getMlogBufferSize())));
+ if (mlogBufferSize > 0) {
+ CONF.setMlogBufferSize(mlogBufferSize);
+ }
+
+ long forceMlogPeriodInMs =
+ Long.parseLong(
+ properties.getProperty(
+ "sync_mlog_period_in_ms", Long.toString(CONF.getSyncMlogPeriodInMs())));
+ if (forceMlogPeriodInMs > 0) {
+ CONF.setSyncMlogPeriodInMs(forceMlogPeriodInMs);
+ }
+
+ CONF.setTagAttributeFlushInterval(
+ Integer.parseInt(
+ properties.getProperty(
+ "tag_attribute_flush_interval",
+ String.valueOf(CONF.getTagAttributeFlushInterval()))));
+
+ CONF.setTagAttributeTotalSize(
+ Integer.parseInt(
+ properties.getProperty(
+ "tag_attribute_total_size", String.valueOf(CONF.getTagAttributeTotalSize()))));
+
+ CONF.setMaxMeasurementNumOfInternalRequest(
+ Integer.parseInt(
+ properties.getProperty(
+ "max_measurement_num_of_internal_request",
+ String.valueOf(CONF.getMaxMeasurementNumOfInternalRequest()))));
+
+ /* Configurations for creating schema automatically */
+ loadAutoCreateSchemaProps(properties);
+
+ /* Query Configurations */
+
+ /* Storage Engine Configuration */
+ CONF.setTimestampPrecision(
+ properties.getProperty("timestamp_precision", CONF.getTimestampPrecision()).trim());
+
+ CONF.setDefaultTtlInMs(
+ Long.parseLong(
+ properties
+ .getProperty("default_ttl_in_ms", String.valueOf(CONF.getDefaultTtlInMs()))
+ .trim()));
+
+ CONF.setMaxWaitingTimeWhenInsertBlockedInMs(
+ Integer.parseInt(
+ properties.getProperty(
+ "max_waiting_time_when_insert_blocked",
+ Integer.toString(CONF.getMaxWaitingTimeWhenInsertBlockedInMs()))));
+
+ CONF.setEnableDiscardOutOfOrderData(
+ Boolean.parseBoolean(
+ properties.getProperty(
+ "enable_discard_out_of_order_data",
+ Boolean.toString(CONF.isEnableDiscardOutOfOrderData()))));
+
+ CONF.setHandleSystemErrorStrategy(
+ HandleSystemErrorStrategy.valueOf(
+ properties
+ .getProperty(
+ "handle_system_error", String.valueOf(CONF.getHandleSystemErrorStrategy()))
+ .trim()));
+
+ long memTableSizeThreshold =
+ Long.parseLong(
+ properties
+ .getProperty(
+ "memtable_size_threshold", Long.toString(CONF.getMemtableSizeThreshold()))
+ .trim());
+ if (memTableSizeThreshold > 0) {
+ CONF.setMemtableSizeThreshold(memTableSizeThreshold);
+ }
+
+ loadTimedService(properties);
+
+ CONF.setTvListSortAlgorithm(
+ TVListSortAlgorithm.valueOf(
+ properties.getProperty(
+ "tvlist_sort_algorithm", CONF.getTvListSortAlgorithm().toString())));
+
+ CONF.setAvgSeriesPointNumberThreshold(
+ Integer.parseInt(
+ properties.getProperty(
+ "avg_series_point_number_threshold",
+ Integer.toString(CONF.getAvgSeriesPointNumberThreshold()))));
+
+ CONF.setFlushThreadCount(
+ Integer.parseInt(
+ properties.getProperty(
+ "flush_thread_count", Integer.toString(CONF.getFlushThreadCount()))));
+ if (CONF.getFlushThreadCount() <= 0) {
+ CONF.setFlushThreadCount(Runtime.getRuntime().availableProcessors());
+ }
+
+ CONF.setEnablePartialInsert(
+ Boolean.parseBoolean(
+ properties.getProperty(
+ "enable_partial_insert", String.valueOf(CONF.isEnablePartialInsert()))));
+
+ CONF.setRecoveryLogIntervalInMs(
+ Long.parseLong(
+ properties.getProperty(
+ "recovery_log_interval_in_ms", String.valueOf(CONF.getRecoveryLogIntervalInMs()))));
+
+ CONF.setUpgradeThreadCount(
+ Integer.parseInt(
+ properties.getProperty(
+ "upgrade_thread_count", Integer.toString(CONF.getUpgradeThreadCount()))));
String readConsistencyLevel =
- properties.getProperty("read_consistency_level", CONF.getReadConsistencyLevel()).trim();
+ properties.getProperty("read_consistency_level", CONF.getReadConsistencyLevel()).trim();
if (readConsistencyLevel.equals("strong") || readConsistencyLevel.equals("weak")) {
CONF.setReadConsistencyLevel(readConsistencyLevel);
} else {
LOGGER.warn(
- String.format(
- "Unknown read_consistency_level: %s, please set to \"strong\" or \"weak\"",
- readConsistencyLevel));
+ String.format(
+ "Unknown read_consistency_level: %s, please set to \"strong\" or \"weak\"",
+ readConsistencyLevel));
}
- CONF.setDefaultTtlInMs(
- Long.parseLong(
- properties
- .getProperty("default_ttl_in_ms", String.valueOf(CONF.getDefaultTtlInMs()))
- .trim()));
-
CONF.setAuthorizerProvider(
properties.getProperty("authorizer_provider_class", CONF.getAuthorizerProvider()).trim());
@@ -261,13 +405,11 @@ public class CommonDescriptor {
CONF.setAdminName(properties.getProperty("admin_name", CONF.getAdminName()).trim());
- CONF.setAdminPassword(
- properties.getProperty("admin_password", CONF.getAdminPassword()).trim());
+ CONF.setAdminPassword(properties.getProperty("admin_password", CONF.getAdminPassword()).trim());
CONF.setEncryptDecryptProvider(
properties
- .getProperty(
- "iotdb_server_encrypt_decrypt_provider", CONF.getEncryptDecryptProvider())
+ .getProperty("iotdb_server_encrypt_decrypt_provider", CONF.getEncryptDecryptProvider())
.trim());
CONF.setEncryptDecryptProviderParameter(
@@ -275,7 +417,6 @@ public class CommonDescriptor {
"iotdb_server_encrypt_decrypt_provider_parameter",
CONF.getEncryptDecryptProviderParameter()));
-
CONF.setUdfDir(properties.getProperty("udf_lib_dir", CONF.getUdfDir()).trim());
CONF.setTriggerDir(properties.getProperty("trigger_lib_dir", CONF.getTriggerDir()).trim());
@@ -287,60 +428,119 @@ public class CommonDescriptor {
.getProperty("dn_wal_dirs", String.join(",", CONF.getWalDirs()))
.trim()
.split(","));
+ }
- CONF.setRpcThriftCompressionEnabled(
+ private void loadAutoCreateSchemaProps(Properties properties) {
+
+ CONF.setEnableAutoCreateSchema(
Boolean.parseBoolean(
- properties
- .getProperty(
- "cn_rpc_thrift_compression_enable",
- String.valueOf(CONF.isRpcThriftCompressionEnabled()))
- .trim()));
+ properties.getProperty(
+ "enable_auto_create_schema",
+ Boolean.toString(CONF.isEnableAutoCreateSchema()).trim())));
- CONF.setConnectionTimeoutInMS(
+ CONF.setDefaultStorageGroupLevel(
Integer.parseInt(
- properties
- .getProperty(
- "dn_connection_timeout_ms", String.valueOf(CONF.getConnectionTimeoutInMS()))
- .trim()));
+ properties.getProperty(
+ "default_storage_group_level",
+ Integer.toString(CONF.getDefaultStorageGroupLevel()))));
+
+ CONF.setBooleanStringInferType(
+ TSDataType.valueOf(
+ properties.getProperty(
+ "boolean_string_infer_type", CONF.getBooleanStringInferType().toString())));
+ CONF.setIntegerStringInferType(
+ TSDataType.valueOf(
+ properties.getProperty(
+ "integer_string_infer_type", CONF.getIntegerStringInferType().toString())));
+ CONF.setLongStringInferType(
+ TSDataType.valueOf(
+ properties.getProperty(
+ "long_string_infer_type", CONF.getLongStringInferType().toString())));
+ CONF.setFloatingStringInferType(
+ TSDataType.valueOf(
+ properties.getProperty(
+ "floating_string_infer_type", CONF.getFloatingStringInferType().toString())));
+ CONF.setNanStringInferType(
+ TSDataType.valueOf(
+ properties.getProperty(
+ "nan_string_infer_type", CONF.getNanStringInferType().toString())));
+
+ CONF.setDefaultBooleanEncoding(
+ properties.getProperty(
+ "default_boolean_encoding", CONF.getDefaultBooleanEncoding().toString()));
+ CONF.setDefaultInt32Encoding(
+ properties.getProperty(
+ "default_int32_encoding", CONF.getDefaultInt32Encoding().toString()));
+ CONF.setDefaultInt64Encoding(
+ properties.getProperty(
+ "default_int64_encoding", CONF.getDefaultInt64Encoding().toString()));
+ CONF.setDefaultFloatEncoding(
+ properties.getProperty(
+ "default_float_encoding", CONF.getDefaultFloatEncoding().toString()));
+ CONF.setDefaultDoubleEncoding(
+ properties.getProperty(
+ "default_double_encoding", CONF.getDefaultDoubleEncoding().toString()));
+ CONF.setDefaultTextEncoding(
+ properties.getProperty("default_text_encoding", CONF.getDefaultTextEncoding().toString()));
+ }
- CONF.setRpcThriftCompressionEnabled(
+ // Timed flush memtable
+ private void loadTimedService(Properties properties) {
+ CONF.setEnableTimedFlushSeqMemtable(
Boolean.parseBoolean(
- properties
- .getProperty(
- "dn_rpc_thrift_compression_enable",
- String.valueOf(CONF.isRpcThriftCompressionEnabled()))
- .trim()));
+ properties.getProperty(
+ "enable_timed_flush_seq_memtable",
+ Boolean.toString(CONF.isEnableTimedFlushSeqMemtable()))));
- CONF.setSelectorNumOfClientManager(
- Integer.parseInt(
+ long seqMemTableFlushInterval =
+ Long.parseLong(
properties
.getProperty(
- "dn_selector_thread_nums_of_client_manager",
- String.valueOf(CONF.getSelectorNumOfClientManager()))
- .trim()));
+ "seq_memtable_flush_interval_in_ms",
+ Long.toString(CONF.getSeqMemtableFlushInterval()))
+ .trim());
+ if (seqMemTableFlushInterval > 0) {
+ CONF.setSeqMemtableFlushInterval(seqMemTableFlushInterval);
+ }
- CONF.setMaxTotalClientForEachNode(
- Integer.parseInt(
+ long seqMemTableFlushCheckInterval =
+ Long.parseLong(
properties
.getProperty(
- "dn_max_connection_for_internal_service",
- String.valueOf(CONF.getMaxTotalClientForEachNode()))
- .trim()));
+ "seq_memtable_flush_check_interval_in_ms",
+ Long.toString(CONF.getSeqMemtableFlushCheckInterval()))
+ .trim());
+ if (seqMemTableFlushCheckInterval > 0) {
+ CONF.setSeqMemtableFlushCheckInterval(seqMemTableFlushCheckInterval);
+ }
- CONF.setMaxIdleClientForEachNode(
- Integer.parseInt(
+ CONF.setEnableTimedFlushUnseqMemtable(
+ Boolean.parseBoolean(
+ properties.getProperty(
+ "enable_timed_flush_unseq_memtable",
+ Boolean.toString(CONF.isEnableTimedFlushUnseqMemtable()))));
+
+ long unseqMemTableFlushInterval =
+ Long.parseLong(
properties
.getProperty(
- "dn_core_connection_for_internal_service",
- String.valueOf(CONF.getMaxIdleClientForEachNode()))
- .trim()));
+ "unseq_memtable_flush_interval_in_ms",
+ Long.toString(CONF.getUnseqMemtableFlushInterval()))
+ .trim());
+ if (unseqMemTableFlushInterval > 0) {
+ CONF.setUnseqMemtableFlushInterval(unseqMemTableFlushInterval);
+ }
- CONF.setHandleSystemErrorStrategy(
- HandleSystemErrorStrategy.valueOf(
+ long unseqMemTableFlushCheckInterval =
+ Long.parseLong(
properties
.getProperty(
- "handle_system_error", String.valueOf(CONF.getHandleSystemErrorStrategy()))
- .trim()));
+ "unseq_memtable_flush_check_interval_in_ms",
+ Long.toString(CONF.getUnseqMemtableFlushCheckInterval()))
+ .trim());
+ if (unseqMemTableFlushCheckInterval > 0) {
+ CONF.setUnseqMemtableFlushCheckInterval(unseqMemTableFlushCheckInterval);
+ }
}
public void loadGlobalConfig(TGlobalConfig globalConfig) {
diff --git a/server/src/main/java/org/apache/iotdb/db/utils/datastructure/TVListSortAlgorithm.java b/node-commons/src/main/java/org/apache/iotdb/commons/utils/datastructure/TVListSortAlgorithm.java
similarity index 94%
rename from server/src/main/java/org/apache/iotdb/db/utils/datastructure/TVListSortAlgorithm.java
rename to node-commons/src/main/java/org/apache/iotdb/commons/utils/datastructure/TVListSortAlgorithm.java
index e067da3f15..11d7ce1e6a 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/datastructure/TVListSortAlgorithm.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/utils/datastructure/TVListSortAlgorithm.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.iotdb.db.utils.datastructure;
+package org.apache.iotdb.commons.utils.datastructure;
public enum TVListSortAlgorithm {
TIM,
diff --git a/schema-engine-rocksdb/src/main/java/org/apache/iotdb/db/metadata/schemaregion/rocksdb/RSchemaReadWriteHandler.java b/schema-engine-rocksdb/src/main/java/org/apache/iotdb/db/metadata/schemaregion/rocksdb/RSchemaReadWriteHandler.java
index ea127b46df..b61b41a962 100644
--- a/schema-engine-rocksdb/src/main/java/org/apache/iotdb/db/metadata/schemaregion/rocksdb/RSchemaReadWriteHandler.java
+++ b/schema-engine-rocksdb/src/main/java/org/apache/iotdb/db/metadata/schemaregion/rocksdb/RSchemaReadWriteHandler.java
@@ -89,7 +89,7 @@ public class RSchemaReadWriteHandler {
private static final String[] INNER_TABLES =
new String[] {new String(RocksDB.DEFAULT_COLUMN_FAMILY), TABLE_NAME_TAGS};
- public static final String ROCKSDB_PATH = config.getSystemDir() + File.separator + ROCKSDB_FOLDER;
+ public static final String ROCKSDB_PATH = config.getDnSystemDir() + File.separator + ROCKSDB_FOLDER;
private RocksDB rocksDB;
diff --git a/server/src/assembly/resources/conf/iotdb-datanode.properties b/server/src/assembly/resources/conf/iotdb-datanode.properties
index 4993cbf0cb..143455f8c2 100644
--- a/server/src/assembly/resources/conf/iotdb-datanode.properties
+++ b/server/src/assembly/resources/conf/iotdb-datanode.properties
@@ -18,7 +18,7 @@
#
####################
-### Data Node RPC Configuration
+### DataNode RPC Configuration
####################
# Used for connection of IoTDB native clients(Session)
@@ -61,7 +61,7 @@ dn_data_region_consensus_port=10760
# dn_join_cluster_retry_interval_ms=5000
####################
-### Target Config Nodes
+### Target ConfigNodes
####################
# For the first ConfigNode to start, cn_target_config_node_list points to its own cn_internal_address:cn_internal_port.
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 5dda4be62d..1625c99299 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
@@ -22,7 +22,7 @@ import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.commons.client.property.ClientPoolProperty.DefaultProperty;
import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.consensus.ConsensusFactory;
+import org.apache.iotdb.commons.utils.datastructure.TVListSortAlgorithm;
import org.apache.iotdb.db.audit.AuditLogOperation;
import org.apache.iotdb.db.audit.AuditLogStorage;
import org.apache.iotdb.db.conf.directories.DirectoryManager;
@@ -37,14 +37,11 @@ import org.apache.iotdb.db.engine.storagegroup.timeindex.TimeIndexLevel;
import org.apache.iotdb.db.exception.LoadConfigurationException;
import org.apache.iotdb.db.service.thrift.impl.ClientRPCServiceImpl;
import org.apache.iotdb.db.service.thrift.impl.NewInfluxDBServiceImpl;
-import org.apache.iotdb.db.utils.datastructure.TVListSortAlgorithm;
import org.apache.iotdb.db.wal.utils.WALMode;
import org.apache.iotdb.rpc.RpcTransportFactory;
import org.apache.iotdb.rpc.RpcUtils;
import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
import org.apache.iotdb.tsfile.common.constant.TsFileConstant;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
import org.apache.iotdb.tsfile.fileSystem.FSType;
import org.slf4j.Logger;
@@ -65,6 +62,32 @@ import static org.apache.iotdb.tsfile.common.constant.TsFileConstant.PATH_SEPARA
public class IoTDBConfig {
+ public static final String CONFIG_NAME = "iotdb-datanode.properties";
+ private static final Logger logger = LoggerFactory.getLogger(IoTDBConfig.class);
+
+ /** DataNode RPC Configuration */
+ // Rpc binding address
+ private String dnRpcAddress = "127.0.0.1";
+ // Port which the JDBC server listens to
+ private int dnRpcPort = 6667;
+ // Internal address for DataNode
+ private String dnInternalAddress = "127.0.0.1";
+ // Internal port for coordinator
+ private int dnInternalPort = 10730;
+ // Port that mpp data exchange thrift service listen to
+ private int dnMppDataExchangePort = 10740;
+ // Internal port for SchemaRegion consensus protocol
+ private int dnSchemaRegionConsensusPort = 10750;
+ // Internal port for dataRegion consensus protocol
+ private int dnDataRegionConsensusPort = 10760;
+ // The time of data node waiting for the next retry to join into the cluster
+ private long dnJoinClusterRetryIntervalMs = TimeUnit.SECONDS.toMillis(5);
+
+ /** Target ConfigNodes */
+ // Ip and port of ConfigNodes
+ private List<TEndPoint> dnTargetConfigNodeList =
+ Collections.singletonList(new TEndPoint("127.0.0.1", 10710));
+
/** Connection Configuration */
// The max time to live of a session in ms. Unit: millisecond
private int dnSessionTimeoutThreshold = 0;
@@ -81,25 +104,56 @@ public class IoTDBConfig {
// Thrift max frame size, 512MB by default
private int dnThriftMaxFrameSize = 536870912;
// Thrift init buffer size
- private int dnThriftDefaultBufferSize = RpcUtils.THRIFT_DEFAULT_BUF_CAPACITY;
+ private int dnThriftInitBufferSize = RpcUtils.THRIFT_DEFAULT_BUF_CAPACITY;
// Thrift socket and connection timeout between DataNode and ConfigNode
private int dnConnectionTimeoutInMS = (int) TimeUnit.SECONDS.toMillis(20);
- // The maximum number of clients that can be idle for a node's InternalService. When the number of idle clients on a node exceeds this number, newly returned clients will be released
- private int dnCoreConnectionForInternalService = 100;
- // The maximum number of clients that can be applied for a node's InternalService
- private int dnMaxConnectionForInternalService = 100;
- // ClientManager will have so many selector threads (TAsyncClientManager) to distribute to its clients
+ // ClientManager will have so many selector threads (TAsyncClientManager) to distribute to its
+ // clients
private int dnSelectorThreadCountOfClientManager =
- Runtime.getRuntime().availableProcessors() / 4 > 0
- ? Runtime.getRuntime().availableProcessors() / 4
- : 1;
+ Runtime.getRuntime().availableProcessors() / 4 > 0
+ ? Runtime.getRuntime().availableProcessors() / 4
+ : 1;
+ // The maximum number of clients that can be idle for a node's InternalService. When the number of
+ // idle clients on a node exceeds this number, newly returned clients will be released
+ private int dnCoreClientCountForEachNodeInClientManager = 200;
+ // The maximum number of clients that can be applied for a node's InternalService
+ private int dnMaxClientCountForEachNodeInClientManager = 300;
+
+ /** Directory Configuration */
+ // System directory, including version file for each database and metadata
+ private String dnSystemDir =
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYSTEM_FOLDER_NAME;
+
+ // Data directories. It can be settled as dataDirs = {"data1", "data2", "data3"};
+ private String[] dnDataDirs = {
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.DATA_FOLDER_NAME
+ };
+ // Strategy of multiple directories
+ private String dnMultiDirStrategyClassName = null;
+
+ // Consensus directory
+ private String dnConsensusDir = IoTDBConstant.DEFAULT_BASE_DIR + File.separator + "consensus";
+
+ // WAL directories
+ private String[] dnWalDirs = {
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.WAL_FOLDER_NAME
+ };
+
+ // Performance tracing directory, stores performance tracing files
+ private String dnTracingDir =
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.TRACING_FOLDER_NAME;
+
+ // Sync directory, including the log and hardlink tsfiles
+ private String dnSyncDir =
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYNC_FOLDER_NAME;
+
+ /** Metric Configuration */
+ // TODO: Add if necessary
/* Names of Watermark methods */
- public static final String WATERMARK_GROUPED_LSB = "GroupBasedLSBMethod";
- public static final String CONFIG_NAME = "iotdb-datanode.properties";
- private static final Logger logger = LoggerFactory.getLogger(IoTDBConfig.class);
private static final String MULTI_DIR_STRATEGY_PREFIX =
"org.apache.iotdb.db.conf.directories.strategy.";
+
private static final String DEFAULT_MULTI_DIR_STRATEGY = "MaxDiskUsableSpaceFirstStrategy";
private static final String STORAGE_GROUP_MATCHER = "([a-zA-Z0-9`_.\\-\\u2E80-\\u9FFF]+)";
@@ -134,29 +188,9 @@ public class IoTDBConfig {
/** max mqtt message size. Unit: byte */
private int mqttMaxMessageSize = 1048576;
- /** Rpc binding address. */
- private String rpcAddress = "127.0.0.1";
-
- /** Port which the JDBC server listens to. */
- private int rpcPort = 6667;
-
/** Port which the influxdb protocol server listens to. */
private int influxDBRpcPort = 8086;
- /** Memory allocated for the write process */
- private long allocateMemoryForStorageEngine = Runtime.getRuntime().maxMemory() * 3 / 10;
-
- /** Memory allocated for the read process */
- private long allocateMemoryForRead = Runtime.getRuntime().maxMemory() * 3 / 10;
-
- /** Memory allocated for the mtree */
- private long allocateMemoryForSchema = Runtime.getRuntime().maxMemory() / 10;
-
- /** Memory allocated for the consensus layer */
- private long allocateMemoryForConsensus = Runtime.getRuntime().maxMemory() / 10;
-
- private volatile int maxQueryDeduplicatedPathNum = 1000;
-
/** Ratio of memory allocated for buffered arrays */
private double bufferedArraysMemoryProportion = 0.6;
@@ -185,12 +219,6 @@ public class IoTDBConfig {
/** When inserting rejected, waiting period to check system again. Unit: millisecond */
private int checkPeriodWhenInsertBlocked = 50;
- /** When inserting rejected exceeds this, throw an exception. Unit: millisecond */
- private int maxWaitingTimeWhenInsertBlockedInMs = 10000;
-
- /** this variable set timestamp precision as millisecond, microsecond or nanosecond */
- private String timestampPrecision = "ms";
-
// region Write Ahead Log Configuration
/** Write mode of wal */
private volatile WALMode walMode = WALMode.ASYNC;
@@ -233,19 +261,6 @@ public class IoTDBConfig {
private volatile long deleteWalFilesPeriodInMs = 20 * 1000L;
// endregion
- /**
- * Size of log buffer for every MetaData operation. If the size of a MetaData operation plan is
- * larger than this parameter, then the MetaData operation plan will be rejected by SchemaRegion.
- * Unit: byte
- */
- private int mlogBufferSize = 1024 * 1024;
-
- /**
- * The cycle when metadata log is periodically forced to be written to disk(in milliseconds) If
- * set this parameter to 0 it means call channel.force(true) after every each operation
- */
- private long syncMlogPeriodInMs = 100;
-
/**
* The size of log buffer for every trigger management operation plan. If the size of a trigger
* management operation plan is larger than this parameter, the trigger management operation plan
@@ -253,10 +268,6 @@ public class IoTDBConfig {
*/
private int tlogBufferSize = 1024 * 1024;
- /** System directory, including version file for each database and metadata */
- private String systemDir =
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYSTEM_FOLDER_NAME;
-
/** Schema directory, including storage set of values. */
private String schemaDir =
IoTDBConstant.DEFAULT_BASE_DIR
@@ -265,10 +276,6 @@ public class IoTDBConfig {
+ File.separator
+ IoTDBConstant.SCHEMA_FOLDER_NAME;
- /** Performance tracing directory, stores performance tracing files */
- private String tracingDir =
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.TRACING_FOLDER_NAME;
-
/** Query directory, stores temporary files of query */
private String queryDir =
IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.QUERY_FOLDER_NAME;
@@ -299,16 +306,8 @@ public class IoTDBConfig {
private String mqttDir =
IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.MQTT_FOLDER_NAME;
- /** Data directories. It can be settled as dataDirs = {"data1", "data2", "data3"}; */
- private String[] dataDirs = {
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.DATA_FOLDER_NAME
- };
-
private String loadTsFileDir =
- dataDirs[0] + File.separator + IoTDBConstant.LOAD_TSFILE_FOLDER_NAME;
-
- /** Strategy of multiple directories. */
- private String multiDirStrategyClassName = null;
+ dnDataDirs[0] + File.separator + IoTDBConstant.LOAD_TSFILE_FOLDER_NAME;
private String ratisDataRegionSnapshotDir =
IoTDBConstant.DEFAULT_BASE_DIR
@@ -317,28 +316,13 @@ public class IoTDBConfig {
+ File.separator
+ IoTDBConstant.SNAPSHOT_FOLDER_NAME;
- /** Consensus directory. */
- private String consensusDir = IoTDBConstant.DEFAULT_BASE_DIR + File.separator + "consensus";
-
- private String dataRegionConsensusDir = consensusDir + File.separator + "data_region";
+ private String dataRegionConsensusDir = dnConsensusDir + File.separator + "data_region";
- private String schemaRegionConsensusDir = consensusDir + File.separator + "schema_region";
+ private String schemaRegionConsensusDir = dnConsensusDir + File.separator + "schema_region";
/** Maximum MemTable number. Invalid when enableMemControl is true. */
private int maxMemtableNumber = 0;
- /** The amount of data iterate each time in server */
- private int batchSize = 100000;
-
- /** How many threads can concurrently flush. When <= 0, use CPU core number. */
- private int flushThreadCount = Runtime.getRuntime().availableProcessors();
-
- /** How many threads can concurrently execute query statement. When <= 0, use CPU core number. */
- private int queryThreadCount = Runtime.getRuntime().availableProcessors();
-
- /** How many queries can be concurrently executed. When <= 0, use 1000. */
- private int maxAllowedConcurrentQueries = 1000;
-
/**
* How many threads can concurrently read data for raw data query. When <= 0, use CPU core number.
*/
@@ -356,9 +340,6 @@ public class IoTDBConfig {
*/
private int maxPendingWindowEvaluationTasks = 64;
- /** Is the write mem control for writing enable. */
- private boolean enableMemControl = true;
-
/** Is the write ahead log enable. */
private boolean enableIndex = false;
@@ -380,48 +361,6 @@ public class IoTDBConfig {
/** When a sequence TsFile's file size (in byte) exceed this, the TsFile is forced closed. */
private long seqTsFileSize = 0L;
- /** When a memTable's size (in byte) exceeds this, the memtable is flushed to disk. Unit: byte */
- private long memtableSizeThreshold = 1024 * 1024 * 1024L;
-
- /** Whether to timed flush sequence tsfiles' memtables. */
- private boolean enableTimedFlushSeqMemtable = true;
-
- /**
- * If a memTable's created time is older than current time minus this, the memtable will be
- * flushed to disk.(only check sequence tsfiles' memtables) Unit: ms
- */
- private long seqMemtableFlushInterval = 3 * 60 * 60 * 1000L;
-
- /** The interval to check whether sequence memtables need flushing. Unit: ms */
- private long seqMemtableFlushCheckInterval = 10 * 60 * 1000L;
-
- /** Whether to timed flush unsequence tsfiles' memtables. */
- private boolean enableTimedFlushUnseqMemtable = true;
-
- /**
- * If a memTable's created time is older than current time minus this, the memtable will be
- * flushed to disk.(only check unsequence tsfiles' memtables) Unit: ms
- */
- private long unseqMemtableFlushInterval = 3 * 60 * 60 * 1000L;
-
- /** The interval to check whether unsequence memtables need flushing. Unit: ms */
- private long unseqMemtableFlushCheckInterval = 10 * 60 * 1000L;
-
- /** The sort algorithm used in TVList */
- private TVListSortAlgorithm tvListSortAlgorithm = TVListSortAlgorithm.TIM;
-
- /** When average series point number reaches this, flush the memtable to disk */
- private int avgSeriesPointNumberThreshold = 100000;
-
- /** Enable inner space compaction for sequence files */
- private boolean enableSeqSpaceCompaction = true;
-
- /** Enable inner space compaction for unsequence files */
- private boolean enableUnseqSpaceCompaction = true;
-
- /** Compact the unsequence files into the overlapped sequence files */
- private boolean enableCrossSpaceCompaction = true;
-
/**
* The strategy of inner space compaction task. There are just one inner space compaction strategy
* SIZE_TIRED_COMPACTION:
@@ -438,12 +377,11 @@ public class IoTDBConfig {
private InnerUnseqCompactionPerformer innerUnseqCompactionPerformer =
InnerUnseqCompactionPerformer.READ_POINT;
- /**
- * The strategy of cross space compaction task. There are just one cross space compaction strategy
- * SIZE_TIRED_COMPACTION:
- */
+ // TODO: Move it to CommonConfig
+ // The strategy of cross space compaction task. There are just one cross space compaction strategy
+ // SIZE_TIRED_COMPACTION:
private CrossCompactionSelector crossCompactionSelector = CrossCompactionSelector.REWRITE;
-
+ // TODO: Move it to CommonConfig
private CrossCompactionPerformer crossCompactionPerformer = CrossCompactionPerformer.READ_POINT;
/**
@@ -506,9 +444,6 @@ public class IoTDBConfig {
private boolean enableCompactionValidation = true;
- /** whether to cache meta data(ChunkMetaData and TsFileMetaData) or not. */
- private boolean metaDataCacheEnable = true;
-
/** Memory allocated for bloomFilter cache in read process */
private long allocateMemoryForBloomFilterCache = allocateMemoryForRead / 1001;
@@ -541,9 +476,6 @@ public class IoTDBConfig {
*/
private boolean enableQueryMemoryEstimation = true;
- /** Whether to enable Last cache */
- private boolean lastCacheEnable = true;
-
/** Set true to enable statistics monitor service, false to disable statistics service. */
private boolean enableStatMonitor = false;
@@ -576,9 +508,6 @@ public class IoTDBConfig {
/** Examining period of cache file reader : 100 seconds. Unit: millisecond */
private long cacheFileReaderClearPeriod = 100000;
- /** the max executing time of query in ms. Unit: millisecond */
- private long queryTimeoutThreshold = 60000;
-
/** Replace implementation class of JDBC service */
private String rpcImplClassName = ClientRPCServiceImpl.class.getName();
@@ -615,54 +544,6 @@ public class IoTDBConfig {
/** Watermark method and parameters */
private String watermarkMethod = "GroupBasedLSBMethod(embed_row_cycle=2,embed_lsb_num=5)";
- /** Switch of creating schema automatically */
- private boolean enableAutoCreateSchema = true;
-
- /** register time series as which type when receiving boolean string "true" or "false" */
- private TSDataType booleanStringInferType = TSDataType.BOOLEAN;
-
- /** register time series as which type when receiving an integer string "67" */
- private TSDataType integerStringInferType = TSDataType.FLOAT;
-
- /**
- * register time series as which type when receiving an integer string and using float may lose
- * precision num > 2 ^ 24
- */
- private TSDataType longStringInferType = TSDataType.DOUBLE;
-
- /** register time series as which type when receiving a floating number string "6.7" */
- private TSDataType floatingStringInferType = TSDataType.FLOAT;
-
- /**
- * register time series as which type when receiving the Literal NaN. Values can be DOUBLE, FLOAT
- * or TEXT
- */
- private TSDataType nanStringInferType = TSDataType.DOUBLE;
-
- /** Database level when creating schema automatically is enabled */
- private int defaultStorageGroupLevel = 1;
-
- /** BOOLEAN encoding when creating schema automatically is enabled */
- private TSEncoding defaultBooleanEncoding = TSEncoding.RLE;
-
- /** INT32 encoding when creating schema automatically is enabled */
- private TSEncoding defaultInt32Encoding = TSEncoding.RLE;
-
- /** INT64 encoding when creating schema automatically is enabled */
- private TSEncoding defaultInt64Encoding = TSEncoding.RLE;
-
- /** FLOAT encoding when creating schema automatically is enabled */
- private TSEncoding defaultFloatEncoding = TSEncoding.GORILLA;
-
- /** DOUBLE encoding when creating schema automatically is enabled */
- private TSEncoding defaultDoubleEncoding = TSEncoding.GORILLA;
-
- /** TEXT encoding when creating schema automatically is enabled */
- private TSEncoding defaultTextEncoding = TSEncoding.PLAIN;
-
- /** How many threads will be set up to perform upgrade tasks. */
- private int upgradeThreadCount = 1;
-
/** How many threads will be set up to perform settle tasks. */
private int settleThreadNum = 1;
@@ -771,16 +652,6 @@ public class IoTDBConfig {
// wait for 60 second by default.
private int thriftServerAwaitTimeForStopService = 60;
- // max size for tag and attribute of one time series
- private int tagAttributeTotalSize = 700;
-
- // Interval num of tag and attribute records when force flushing to disk
- private int tagAttributeFlushInterval = 1000;
-
- // In one insert (one device, one timestamp, multiple measurements),
- // if enable partial insert, one measurement failure will not impact other measurements
- private boolean enablePartialInsert = true;
-
/**
* Used to estimate the memory usage of text fields in a UDF query. It is recommended to set this
* value to be slightly larger than the average length of all text records.
@@ -812,9 +683,6 @@ public class IoTDBConfig {
/** time interval in minute for calculating query frequency. Unit: minute */
private int frequencyIntervalInMinute = 1;
- /** time cost(ms) threshold for slow query. Unit: millisecond */
- private long slowQueryThreshold = 5000;
-
private int patternMatchingThreshold = 1000000;
/**
@@ -832,14 +700,6 @@ public class IoTDBConfig {
/** the size of ioTaskQueue */
private int ioTaskQueueSizeForFlushing = 10;
- /** the number of data regions per user-defined database */
- private int dataRegionNum = 1;
-
- /** the interval to log recover progress of each vsg when starting iotdb */
- private long recoveryLogIntervalInMs = 5_000L;
-
- private boolean enableDiscardOutOfOrderData = false;
-
/** the method to transform device path to device id, can be 'Plain' or 'SHA256' */
private String deviceIDTransformationMethod = "Plain";
@@ -866,68 +726,6 @@ public class IoTDBConfig {
/** maximum number of logged pages before log erased */
private int schemaFileLogSize = 16384;
- /**
- * Maximum number of measurement in one create timeseries plan node. If the number of measurement
- * in user request exceeds this limit, the request will be split.
- */
- private int maxMeasurementNumOfInternalRequest = 10000;
-
- /** Internal address for data node */
- private String internalAddress = "127.0.0.1";
-
- /** Internal port for coordinator */
- private int internalPort = 10730;
-
- /** Internal port for dataRegion consensus protocol */
- private int dataRegionConsensusPort = 10760;
-
- /** Internal port for schemaRegion consensus protocol */
- private int schemaRegionConsensusPort = 10750;
-
- /** Ip and port of config nodes. */
- private List<TEndPoint> targetConfigNodeList =
- Collections.singletonList(new TEndPoint("127.0.0.1", 10710));
-
- /** The time of data node waiting for the next retry to join into the cluster */
- private long joinClusterRetryIntervalMs = TimeUnit.SECONDS.toMillis(5);
-
- /**
- * The consensus protocol class for data region. The Datanode should communicate with ConfigNode
- * on startup and set this variable so that the correct class name can be obtained later when the
- * data region consensus layer singleton is initialized
- */
- private String dataRegionConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
-
- /**
- * The consensus protocol class for schema region. The Datanode should communicate with ConfigNode
- * on startup and set this variable so that the correct class name can be obtained later when the
- * schema region consensus layer singleton is initialized
- */
- private String schemaRegionConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
-
- /**
- * The series partition executor class. The Datanode should communicate with ConfigNode on startup
- * and set this variable so that the correct class name can be obtained later when calculating the
- * series partition
- */
- private String seriesPartitionExecutorClass =
- "org.apache.iotdb.commons.partition.executor.hash.APHashExecutor";
-
- /** The number of series partitions in a database */
- private int seriesPartitionSlotNum = 10000;
-
- /** Port that mpp data exchange thrift service listen to. */
- private int mppDataExchangePort = 10740;
-
- /** Core pool size of mpp data exchange. */
- private int mppDataExchangeCorePoolSize = 10;
-
- /** Max pool size of mpp data exchange. */
- private int mppDataExchangeMaxPoolSize = 10;
-
- /** Thread keep alive time in ms of mpp data exchange. */
- private int mppDataExchangeKeepAliveTimeInMs = 1000;
-
/** Thrift socket and connection timeout between data node and config node. */
private int connectionTimeoutInMS = (int) TimeUnit.SECONDS.toMillis(20);
@@ -954,12 +752,6 @@ public class IoTDBConfig {
*/
private int maxClientNumForEachNode = DefaultProperty.MAX_CLIENT_NUM_FOR_EACH_NODE;
- /**
- * Cache size of partition cache in {@link
- * org.apache.iotdb.db.mpp.plan.analyze.ClusterPartitionFetcher}
- */
- private int partitionCacheSize = 1000;
-
/** Cache size of user and role */
private int authorCacheSize = 100;
@@ -986,12 +778,6 @@ public class IoTDBConfig {
/** How many times will we retry to find an instance of stateful trigger */
private int retryNumToFindStatefulTrigger = 3;
- /** ThreadPool size for read operation in coordinator */
- private int coordinatorReadExecutorSize = 20;
-
- /** ThreadPool size for write operation in coordinator */
- private int coordinatorWriteExecutorSize = 50;
-
/**
* Whether the schema memory allocation is default config. Used for cluster mode initialization
* judgement
@@ -1010,11 +796,6 @@ public class IoTDBConfig {
/** Memory allocated for LastCache */
private long allocateMemoryForLastCache = allocateMemoryForSchema / 10;
- private String readConsistencyLevel = "strong";
-
- /** Maximum execution time of a DriverTask */
- private int driverTaskExecutionTimeSliceInMs = 100;
-
/** Maximum size of wal buffer used in IoTConsensus. Unit: byte */
private long throttleThreshold = 50 * 1024 * 1024 * 1024L;
@@ -1171,11 +952,11 @@ public class IoTDBConfig {
/** if the folders are relative paths, add IOTDB_DATA_HOME as the path prefix */
private void formulateFolders() {
- systemDir = addDataHomeDir(systemDir);
+ dnSystemDir = addDataHomeDir(dnSystemDir);
schemaDir = addDataHomeDir(schemaDir);
loadTsFileDir = addDataHomeDir(loadTsFileDir);
- tracingDir = addDataHomeDir(tracingDir);
- consensusDir = addDataHomeDir(consensusDir);
+ dnTracingDir = addDataHomeDir(dnTracingDir);
+ dnConsensusDir = addDataHomeDir(dnConsensusDir);
dataRegionConsensusDir = addDataHomeDir(dataRegionConsensusDir);
ratisDataRegionSnapshotDir = addDataHomeDir(ratisDataRegionSnapshotDir);
schemaRegionConsensusDir = addDataHomeDir(schemaRegionConsensusDir);
@@ -1192,13 +973,13 @@ public class IoTDBConfig {
if (TSFileDescriptor.getInstance().getConfig().getTSFileStorageFs().equals(FSType.HDFS)) {
String hdfsDir = getHdfsDir();
queryDir = hdfsDir + File.separatorChar + queryDir;
- for (int i = 0; i < dataDirs.length; i++) {
- dataDirs[i] = hdfsDir + File.separatorChar + dataDirs[i];
+ for (int i = 0; i < dnDataDirs.length; i++) {
+ dnDataDirs[i] = hdfsDir + File.separatorChar + dnDataDirs[i];
}
} else {
queryDir = addDataHomeDir(queryDir);
- for (int i = 0; i < dataDirs.length; i++) {
- dataDirs[i] = addDataHomeDir(dataDirs[i]);
+ for (int i = 0; i < dnDataDirs.length; i++) {
+ dnDataDirs[i] = addDataHomeDir(dnDataDirs[i]);
}
}
}
@@ -1217,7 +998,7 @@ public class IoTDBConfig {
}
// make sure old data directories not removed
HashSet<String> newDirs = new HashSet<>(Arrays.asList(dataDirs));
- for (String oldDir : this.dataDirs) {
+ for (String oldDir : this.dnDataDirs) {
if (!newDirs.contains(oldDir)) {
String msg =
String.format("%s is removed from data_dirs parameter, please add it back.", oldDir);
@@ -1225,7 +1006,7 @@ public class IoTDBConfig {
throw new LoadConfigurationException(msg);
}
}
- this.dataDirs = dataDirs;
+ this.dnDataDirs = dataDirs;
DirectoryManager.getInstance().updateFileFolders();
}
@@ -1255,21 +1036,21 @@ public class IoTDBConfig {
}
void confirmMultiDirStrategy() {
- if (getMultiDirStrategyClassName() == null) {
- multiDirStrategyClassName = DEFAULT_MULTI_DIR_STRATEGY;
+ if (getDnMultiDirStrategyClassName() == null) {
+ dnMultiDirStrategyClassName = DEFAULT_MULTI_DIR_STRATEGY;
}
- if (!getMultiDirStrategyClassName().contains(TsFileConstant.PATH_SEPARATOR)) {
- multiDirStrategyClassName = MULTI_DIR_STRATEGY_PREFIX + multiDirStrategyClassName;
+ if (!getDnMultiDirStrategyClassName().contains(TsFileConstant.PATH_SEPARATOR)) {
+ dnMultiDirStrategyClassName = MULTI_DIR_STRATEGY_PREFIX + dnMultiDirStrategyClassName;
}
try {
- Class.forName(multiDirStrategyClassName);
+ Class.forName(dnMultiDirStrategyClassName);
} catch (ClassNotFoundException e) {
logger.warn(
"Cannot find given directory strategy {}, using the default value",
- getMultiDirStrategyClassName(),
+ getDnMultiDirStrategyClassName(),
e);
- setMultiDirStrategyClassName(MULTI_DIR_STRATEGY_PREFIX + DEFAULT_MULTI_DIR_STRATEGY);
+ setDnMultiDirStrategyClassName(MULTI_DIR_STRATEGY_PREFIX + DEFAULT_MULTI_DIR_STRATEGY);
}
}
@@ -1284,32 +1065,32 @@ public class IoTDBConfig {
return hdfsDir;
}
- public String[] getDataDirs() {
- return dataDirs;
+ public String[] getDnDataDirs() {
+ return dnDataDirs;
}
- public void setDataDirs(String[] dataDirs) {
- this.dataDirs = dataDirs;
+ public void setDnDataDirs(String[] dnDataDirs) {
+ this.dnDataDirs = dnDataDirs;
// TODO(szywilliam): rewrite the logic here when ratis supports complete snapshot semantic
setRatisDataRegionSnapshotDir(
- dataDirs[0] + File.separator + IoTDBConstant.SNAPSHOT_FOLDER_NAME);
- setLoadTsFileDir(dataDirs[0] + File.separator + IoTDBConstant.LOAD_TSFILE_FOLDER_NAME);
+ dnDataDirs[0] + File.separator + IoTDBConstant.SNAPSHOT_FOLDER_NAME);
+ setLoadTsFileDir(dnDataDirs[0] + File.separator + IoTDBConstant.LOAD_TSFILE_FOLDER_NAME);
}
- public String getRpcAddress() {
- return rpcAddress;
+ public String getDnRpcAddress() {
+ return dnRpcAddress;
}
- public void setRpcAddress(String rpcAddress) {
- this.rpcAddress = rpcAddress;
+ public void setDnRpcAddress(String dnRpcAddress) {
+ this.dnRpcAddress = dnRpcAddress;
}
- public int getRpcPort() {
- return rpcPort;
+ public int getDnRpcPort() {
+ return dnRpcPort;
}
- public void setRpcPort(int rpcPort) {
- this.rpcPort = rpcPort;
+ public void setDnRpcPort(int dnRpcPort) {
+ this.dnRpcPort = dnRpcPort;
}
public int getInfluxDBRpcPort() {
@@ -1320,36 +1101,12 @@ public class IoTDBConfig {
this.influxDBRpcPort = influxDBRpcPort;
}
- public String getTimestampPrecision() {
- return timestampPrecision;
- }
-
- public void setTimestampPrecision(String timestampPrecision) {
- if (!("ms".equals(timestampPrecision)
- || "us".equals(timestampPrecision)
- || "ns".equals(timestampPrecision))) {
- logger.error(
- "Wrong timestamp precision, please set as: ms, us or ns ! Current is: {}",
- timestampPrecision);
- System.exit(-1);
- }
- this.timestampPrecision = timestampPrecision;
- }
-
- public boolean isEnableDiscardOutOfOrderData() {
- return enableDiscardOutOfOrderData;
- }
-
- public void setEnableDiscardOutOfOrderData(boolean enableDiscardOutOfOrderData) {
- this.enableDiscardOutOfOrderData = enableDiscardOutOfOrderData;
+ public String getDnSystemDir() {
+ return dnSystemDir;
}
- public String getSystemDir() {
- return systemDir;
- }
-
- void setSystemDir(String systemDir) {
- this.systemDir = systemDir;
+ void setDnSystemDir(String dnSystemDir) {
+ this.dnSystemDir = dnSystemDir;
}
public String getLoadTsFileDir() {
@@ -1368,12 +1125,12 @@ public class IoTDBConfig {
this.schemaDir = schemaDir;
}
- public String getTracingDir() {
- return tracingDir;
+ public String getDnTracingDir() {
+ return dnTracingDir;
}
- void setTracingDir(String tracingDir) {
- this.tracingDir = tracingDir;
+ void setDnTracingDir(String dnTracingDir) {
+ this.dnTracingDir = dnTracingDir;
}
public String getQueryDir() {
@@ -1392,14 +1149,14 @@ public class IoTDBConfig {
this.ratisDataRegionSnapshotDir = ratisDataRegionSnapshotDir;
}
- public String getConsensusDir() {
- return consensusDir;
+ public String getDnConsensusDir() {
+ return dnConsensusDir;
}
- public void setConsensusDir(String consensusDir) {
- this.consensusDir = consensusDir;
- setDataRegionConsensusDir(consensusDir + File.separator + "data_region");
- setSchemaRegionConsensusDir(consensusDir + File.separator + "schema_region");
+ public void setDnConsensusDir(String dnConsensusDir) {
+ this.dnConsensusDir = dnConsensusDir;
+ setDataRegionConsensusDir(dnConsensusDir + File.separator + "data_region");
+ setSchemaRegionConsensusDir(dnConsensusDir + File.separator + "schema_region");
}
public String getDataRegionConsensusDir() {
@@ -1468,23 +1225,23 @@ public class IoTDBConfig {
this.mqttDir = mqttDir;
}
- public String getMultiDirStrategyClassName() {
- return multiDirStrategyClassName;
+ public String getDnMultiDirStrategyClassName() {
+ return dnMultiDirStrategyClassName;
}
- void setMultiDirStrategyClassName(String multiDirStrategyClassName) {
- this.multiDirStrategyClassName = multiDirStrategyClassName;
+ void setDnMultiDirStrategyClassName(String dnMultiDirStrategyClassName) {
+ this.dnMultiDirStrategyClassName = dnMultiDirStrategyClassName;
}
public void checkMultiDirStrategyClassName() {
if (isClusterMode
- && !(multiDirStrategyClassName.equals(DEFAULT_MULTI_DIR_STRATEGY)
- || multiDirStrategyClassName.equals(
+ && !(dnMultiDirStrategyClassName.equals(DEFAULT_MULTI_DIR_STRATEGY)
+ || dnMultiDirStrategyClassName.equals(
MULTI_DIR_STRATEGY_PREFIX + DEFAULT_MULTI_DIR_STRATEGY))) {
String msg =
String.format(
"Cannot set multi_dir_strategy to %s, because cluster mode only allows MaxDiskUsableSpaceFirstStrategy.",
- multiDirStrategyClassName);
+ dnMultiDirStrategyClassName);
logger.error(msg);
throw new RuntimeException(msg);
}
@@ -2138,14 +1895,6 @@ public class IoTDBConfig {
this.enableQueryMemoryEstimation = enableQueryMemoryEstimation;
}
- public boolean isLastCacheEnabled() {
- return lastCacheEnable;
- }
-
- public void setEnableLastCache(boolean lastCacheEnable) {
- this.lastCacheEnable = lastCacheEnable;
- }
-
public boolean isEnableWatermark() {
return enableWatermark;
}
@@ -2208,141 +1957,6 @@ public class IoTDBConfig {
return null;
}
- public boolean isAutoCreateSchemaEnabled() {
- return enableAutoCreateSchema;
- }
-
- public void setAutoCreateSchemaEnabled(boolean enableAutoCreateSchema) {
- this.enableAutoCreateSchema = enableAutoCreateSchema;
- }
-
- public TSDataType getBooleanStringInferType() {
- return booleanStringInferType;
- }
-
- public void setBooleanStringInferType(TSDataType booleanStringInferType) {
- this.booleanStringInferType = booleanStringInferType;
- }
-
- public TSDataType getIntegerStringInferType() {
- return integerStringInferType;
- }
-
- public void setIntegerStringInferType(TSDataType integerStringInferType) {
- this.integerStringInferType = integerStringInferType;
- }
-
- public void setLongStringInferType(TSDataType longStringInferType) {
- this.longStringInferType = longStringInferType;
- }
-
- public TSDataType getLongStringInferType() {
- return longStringInferType;
- }
-
- public TSDataType getFloatingStringInferType() {
- return floatingStringInferType;
- }
-
- public void setFloatingStringInferType(TSDataType floatingNumberStringInferType) {
- this.floatingStringInferType = floatingNumberStringInferType;
- }
-
- public TSDataType getNanStringInferType() {
- return nanStringInferType;
- }
-
- public void setNanStringInferType(TSDataType nanStringInferType) {
- if (nanStringInferType != TSDataType.DOUBLE
- && nanStringInferType != TSDataType.FLOAT
- && nanStringInferType != TSDataType.TEXT) {
- throw new IllegalArgumentException(
- "Config Property nan_string_infer_type can only be FLOAT, DOUBLE or TEXT but is "
- + nanStringInferType);
- }
- this.nanStringInferType = nanStringInferType;
- }
-
- public int getDefaultStorageGroupLevel() {
- return defaultStorageGroupLevel;
- }
-
- void setDefaultStorageGroupLevel(int defaultStorageGroupLevel) {
- this.defaultStorageGroupLevel = defaultStorageGroupLevel;
- }
-
- public TSEncoding getDefaultBooleanEncoding() {
- return defaultBooleanEncoding;
- }
-
- public void setDefaultBooleanEncoding(TSEncoding defaultBooleanEncoding) {
- this.defaultBooleanEncoding = defaultBooleanEncoding;
- }
-
- void setDefaultBooleanEncoding(String defaultBooleanEncoding) {
- this.defaultBooleanEncoding = TSEncoding.valueOf(defaultBooleanEncoding);
- }
-
- public TSEncoding getDefaultInt32Encoding() {
- return defaultInt32Encoding;
- }
-
- public void setDefaultInt32Encoding(TSEncoding defaultInt32Encoding) {
- this.defaultInt32Encoding = defaultInt32Encoding;
- }
-
- void setDefaultInt32Encoding(String defaultInt32Encoding) {
- this.defaultInt32Encoding = TSEncoding.valueOf(defaultInt32Encoding);
- }
-
- public TSEncoding getDefaultInt64Encoding() {
- return defaultInt64Encoding;
- }
-
- public void setDefaultInt64Encoding(TSEncoding defaultInt64Encoding) {
- this.defaultInt64Encoding = defaultInt64Encoding;
- }
-
- void setDefaultInt64Encoding(String defaultInt64Encoding) {
- this.defaultInt64Encoding = TSEncoding.valueOf(defaultInt64Encoding);
- }
-
- public TSEncoding getDefaultFloatEncoding() {
- return defaultFloatEncoding;
- }
-
- public void setDefaultFloatEncoding(TSEncoding defaultFloatEncoding) {
- this.defaultFloatEncoding = defaultFloatEncoding;
- }
-
- void setDefaultFloatEncoding(String defaultFloatEncoding) {
- this.defaultFloatEncoding = TSEncoding.valueOf(defaultFloatEncoding);
- }
-
- public TSEncoding getDefaultDoubleEncoding() {
- return defaultDoubleEncoding;
- }
-
- public void setDefaultDoubleEncoding(TSEncoding defaultDoubleEncoding) {
- this.defaultDoubleEncoding = defaultDoubleEncoding;
- }
-
- void setDefaultDoubleEncoding(String defaultDoubleEncoding) {
- this.defaultDoubleEncoding = TSEncoding.valueOf(defaultDoubleEncoding);
- }
-
- public TSEncoding getDefaultTextEncoding() {
- return defaultTextEncoding;
- }
-
- public void setDefaultTextEncoding(TSEncoding defaultTextEncoding) {
- this.defaultTextEncoding = defaultTextEncoding;
- }
-
- void setDefaultTextEncoding(String defaultTextEncoding) {
- this.defaultTextEncoding = TSEncoding.valueOf(defaultTextEncoding);
- }
-
FSType getTsFileStorageFs() {
return tsFileStorageFs;
}
@@ -2552,13 +2166,13 @@ public class IoTDBConfig {
RpcTransportFactory.setThriftMaxFrameSize(this.dnThriftMaxFrameSize);
}
- public int getDnThriftDefaultBufferSize() {
- return dnThriftDefaultBufferSize;
+ public int getDnThriftInitBufferSize() {
+ return dnThriftInitBufferSize;
}
- public void setDnThriftDefaultBufferSize(int dnThriftDefaultBufferSize) {
- this.dnThriftDefaultBufferSize = dnThriftDefaultBufferSize;
- RpcTransportFactory.setDefaultBufferCapacity(this.dnThriftDefaultBufferSize);
+ public void setDnThriftInitBufferSize(int dnThriftInitBufferSize) {
+ this.dnThriftInitBufferSize = dnThriftInitBufferSize;
+ RpcTransportFactory.setDefaultBufferCapacity(this.dnThriftInitBufferSize);
}
public int getMaxQueryDeduplicatedPathNum() {
@@ -2958,52 +2572,52 @@ public class IoTDBConfig {
this.maxMeasurementNumOfInternalRequest = maxMeasurementNumOfInternalRequest;
}
- public String getInternalAddress() {
- return internalAddress;
+ public String getDnInternalAddress() {
+ return dnInternalAddress;
}
- public void setInternalAddress(String internalAddress) {
- this.internalAddress = internalAddress;
+ public void setDnInternalAddress(String dnInternalAddress) {
+ this.dnInternalAddress = dnInternalAddress;
}
- public int getInternalPort() {
- return internalPort;
+ public int getDnInternalPort() {
+ return dnInternalPort;
}
- public void setInternalPort(int internalPort) {
- this.internalPort = internalPort;
+ public void setDnInternalPort(int dnInternalPort) {
+ this.dnInternalPort = dnInternalPort;
}
- public int getDataRegionConsensusPort() {
- return dataRegionConsensusPort;
+ public int getDnDataRegionConsensusPort() {
+ return dnDataRegionConsensusPort;
}
- public void setDataRegionConsensusPort(int dataRegionConsensusPort) {
- this.dataRegionConsensusPort = dataRegionConsensusPort;
+ public void setDnDataRegionConsensusPort(int dnDataRegionConsensusPort) {
+ this.dnDataRegionConsensusPort = dnDataRegionConsensusPort;
}
- public int getSchemaRegionConsensusPort() {
- return schemaRegionConsensusPort;
+ public int getDnSchemaRegionConsensusPort() {
+ return dnSchemaRegionConsensusPort;
}
- public void setSchemaRegionConsensusPort(int schemaRegionConsensusPort) {
- this.schemaRegionConsensusPort = schemaRegionConsensusPort;
+ public void setDnSchemaRegionConsensusPort(int dnSchemaRegionConsensusPort) {
+ this.dnSchemaRegionConsensusPort = dnSchemaRegionConsensusPort;
}
- public List<TEndPoint> getTargetConfigNodeList() {
- return targetConfigNodeList;
+ public List<TEndPoint> getDnTargetConfigNodeList() {
+ return dnTargetConfigNodeList;
}
- public void setTargetConfigNodeList(List<TEndPoint> targetConfigNodeList) {
- this.targetConfigNodeList = targetConfigNodeList;
+ public void setDnTargetConfigNodeList(List<TEndPoint> dnTargetConfigNodeList) {
+ this.dnTargetConfigNodeList = dnTargetConfigNodeList;
}
- public long getJoinClusterRetryIntervalMs() {
- return joinClusterRetryIntervalMs;
+ public long getDnJoinClusterRetryIntervalMs() {
+ return dnJoinClusterRetryIntervalMs;
}
- public void setJoinClusterRetryIntervalMs(long joinClusterRetryIntervalMs) {
- this.joinClusterRetryIntervalMs = joinClusterRetryIntervalMs;
+ public void setDnJoinClusterRetryIntervalMs(long dnJoinClusterRetryIntervalMs) {
+ this.dnJoinClusterRetryIntervalMs = dnJoinClusterRetryIntervalMs;
}
public String getDataRegionConsensusProtocolClass() {
@@ -3038,12 +2652,12 @@ public class IoTDBConfig {
this.seriesPartitionSlotNum = seriesPartitionSlotNum;
}
- public int getMppDataExchangePort() {
- return mppDataExchangePort;
+ public int getDnMppDataExchangePort() {
+ return dnMppDataExchangePort;
}
- public void setMppDataExchangePort(int mppDataExchangePort) {
- this.mppDataExchangePort = mppDataExchangePort;
+ public void setDnMppDataExchangePort(int dnMppDataExchangePort) {
+ this.dnMppDataExchangePort = dnMppDataExchangePort;
}
public int getMppDataExchangeCorePoolSize() {
@@ -3078,20 +2692,22 @@ public class IoTDBConfig {
this.dnConnectionTimeoutInMS = dnConnectionTimeoutInMS;
}
- public int getDnMaxConnectionForInternalService() {
- return dnMaxConnectionForInternalService;
+ public int getDnMaxClientCountForEachNodeInClientManager() {
+ return dnMaxClientCountForEachNodeInClientManager;
}
- public void setDnMaxConnectionForInternalService(int dnMaxConnectionForInternalService) {
- this.dnMaxConnectionForInternalService = dnMaxConnectionForInternalService;
+ public void setDnMaxClientCountForEachNodeInClientManager(
+ int dnMaxClientCountForEachNodeInClientManager) {
+ this.dnMaxClientCountForEachNodeInClientManager = dnMaxClientCountForEachNodeInClientManager;
}
- public int getDnCoreConnectionForInternalService() {
- return dnCoreConnectionForInternalService;
+ public int getDnCoreClientCountForEachNodeInClientManager() {
+ return dnCoreClientCountForEachNodeInClientManager;
}
- public void setDnCoreConnectionForInternalService(int dnCoreConnectionForInternalService) {
- this.dnCoreConnectionForInternalService = dnCoreConnectionForInternalService;
+ public void setDnCoreClientCountForEachNodeInClientManager(
+ int dnCoreClientCountForEachNodeInClientManager) {
+ this.dnCoreClientCountForEachNodeInClientManager = dnCoreClientCountForEachNodeInClientManager;
}
public int getDnSelectorThreadCountOfClientManager() {
@@ -3232,7 +2848,7 @@ public class IoTDBConfig {
}
public TEndPoint getAddressAndPort() {
- return new TEndPoint(rpcAddress, rpcPort);
+ return new TEndPoint(dnRpcAddress, dnRpcPort);
}
boolean isDefaultSchemaMemoryConfig() {
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index ff07d75747..07ff22c5d3 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -40,7 +40,6 @@ import org.apache.iotdb.db.exception.query.QueryProcessException;
import org.apache.iotdb.db.rescon.SystemInfo;
import org.apache.iotdb.db.service.metrics.IoTDBInternalLocalReporter;
import org.apache.iotdb.db.utils.DateTimeUtils;
-import org.apache.iotdb.db.utils.datastructure.TVListSortAlgorithm;
import org.apache.iotdb.db.wal.WALManager;
import org.apache.iotdb.db.wal.utils.WALMode;
import org.apache.iotdb.external.api.IPropertiesLoader;
@@ -74,7 +73,7 @@ public class IoTDBDescriptor {
private final CommonDescriptor commonDescriptor = CommonDescriptor.getInstance();
- private final IoTDBConfig conf = new IoTDBConfig();
+ private final IoTDBConfig CONF = new IoTDBConfig();
protected IoTDBDescriptor() {
loadProps();
@@ -84,7 +83,7 @@ public class IoTDBDescriptor {
logger.info("Will reload properties from {} ", loader.getClass().getName());
Properties properties = loader.loadProperties();
loadProperties(properties);
- conf.setCustomizedProperties(loader.getCustomizedProperties());
+ CONF.setCustomizedProperties(loader.getCustomizedProperties());
TSFileDescriptor.getInstance().overwriteConfigByCustomSettings(properties);
TSFileDescriptor.getInstance()
.getConfig()
@@ -97,7 +96,7 @@ public class IoTDBDescriptor {
}
public IoTDBConfig getConfig() {
- return conf;
+ return CONF;
}
/**
@@ -124,7 +123,7 @@ public class IoTDBDescriptor {
+ "config file {}, use default configuration",
configFileName);
// update all data seriesPath
- conf.updatePath();
+ CONF.updatePath();
return null;
}
}
@@ -183,12 +182,12 @@ public class IoTDBDescriptor {
logger.warn("Incorrect format in config file, use default configuration", e);
} finally {
// update all data seriesPath
- conf.updatePath();
+ CONF.updatePath();
commonDescriptor.getConfig().updatePath(System.getProperty(IoTDBConstant.IOTDB_HOME, null));
MetricConfigDescriptor.getInstance().loadProps(commonProperties);
MetricConfigDescriptor.getInstance()
.getMetricConfig()
- .updateRpcInstance(conf.getInternalAddress(), conf.getInternalPort());
+ .updateRpcInstance(CONF.getDnInternalAddress(), CONF.getDnInternalPort());
}
} else {
logger.warn(
@@ -199,115 +198,112 @@ public class IoTDBDescriptor {
public void loadProperties(Properties properties) {
- conf.setClusterName(
- properties.getProperty(IoTDBConstant.CLUSTER_NAME, conf.getClusterName()).trim());
+ CONF.setClusterName(
+ properties.getProperty(IoTDBConstant.CLUSTER_NAME, CONF.getClusterName()).trim());
- conf.setRpcAddress(
- properties.getProperty(IoTDBConstant.DN_RPC_ADDRESS, conf.getRpcAddress()).trim());
+ CONF.setDnRpcAddress(
+ properties.getProperty(IoTDBConstant.DN_RPC_ADDRESS, CONF.getDnRpcAddress()).trim());
- conf.setDnRpcThriftCompressionEnable(
+ CONF.setDnRpcThriftCompressionEnable(
Boolean.parseBoolean(
properties
.getProperty(
"dn_rpc_thrift_compression_enable",
- Boolean.toString(conf.isDnRpcThriftCompressionEnable()))
+ Boolean.toString(CONF.isDnRpcThriftCompressionEnable()))
.trim()));
- conf.setDnRpcAdvancedCompressionEnable(
+ CONF.setDnRpcAdvancedCompressionEnable(
Boolean.parseBoolean(
properties
.getProperty(
"dn_rpc_advanced_compression_enable",
- Boolean.toString(conf.isDnRpcAdvancedCompressionEnable()))
+ Boolean.toString(CONF.isDnRpcAdvancedCompressionEnable()))
.trim()));
- conf.setDnConnectionTimeoutInMS(
+ CONF.setDnConnectionTimeoutInMS(
Integer.parseInt(
properties
.getProperty(
- "dn_connection_timeout_ms", String.valueOf(conf.getDnConnectionTimeoutInMS()))
+ "dn_connection_timeout_ms", String.valueOf(CONF.getDnConnectionTimeoutInMS()))
.trim()));
- conf.setCoreClientNumForEachNode(
+ CONF.setCoreClientNumForEachNode(
Integer.parseInt(
properties
.getProperty(
"dn_core_client_count_for_each_node_in_client_manager",
- String.valueOf(conf.getCoreClientNumForEachNode()))
+ String.valueOf(CONF.getCoreClientNumForEachNode()))
.trim()));
- conf.setMaxClientNumForEachNode(
+ CONF.setMaxClientNumForEachNode(
Integer.parseInt(
properties
.getProperty(
"dn_max_client_count_for_each_node_in_client_manager",
- String.valueOf(conf.getMaxClientNumForEachNode()))
+ String.valueOf(CONF.getMaxClientNumForEachNode()))
.trim()));
- conf.setDnSelectorThreadCountOfClientManager(
+ CONF.setDnSelectorThreadCountOfClientManager(
Integer.parseInt(
properties
.getProperty(
"dn_selector_thread_count_of_client_manager",
- String.valueOf(conf.getDnSelectorThreadCountOfClientManager()))
+ String.valueOf(CONF.getDnSelectorThreadCountOfClientManager()))
.trim()));
- conf.setRpcPort(
+ CONF.setDnRpcPort(
Integer.parseInt(
properties
- .getProperty(IoTDBConstant.DN_RPC_PORT, Integer.toString(conf.getRpcPort()))
+ .getProperty(IoTDBConstant.DN_RPC_PORT, Integer.toString(CONF.getDnRpcPort()))
.trim()));
- conf.setEnableInfluxDBRpcService(
+ CONF.setEnableInfluxDBRpcService(
Boolean.parseBoolean(
properties
.getProperty(
"enable_influxdb_rpc_service",
- Boolean.toString(conf.isEnableInfluxDBRpcService()))
+ Boolean.toString(CONF.isEnableInfluxDBRpcService()))
.trim()));
- conf.setInfluxDBRpcPort(
+ CONF.setInfluxDBRpcPort(
Integer.parseInt(
properties
- .getProperty("influxdb_rpc_port", Integer.toString(conf.getInfluxDBRpcPort()))
+ .getProperty("influxdb_rpc_port", Integer.toString(CONF.getInfluxDBRpcPort()))
.trim()));
- conf.setTimestampPrecision(
- properties.getProperty("timestamp_precision", conf.getTimestampPrecision()).trim());
-
- conf.setBufferedArraysMemoryProportion(
+ CONF.setBufferedArraysMemoryProportion(
Double.parseDouble(
properties
.getProperty(
"buffered_arrays_memory_proportion",
- Double.toString(conf.getBufferedArraysMemoryProportion()))
+ Double.toString(CONF.getBufferedArraysMemoryProportion()))
.trim()));
- conf.setFlushProportion(
+ CONF.setFlushProportion(
Double.parseDouble(
properties
- .getProperty("flush_proportion", Double.toString(conf.getFlushProportion()))
+ .getProperty("flush_proportion", Double.toString(CONF.getFlushProportion()))
.trim()));
- conf.setRejectProportion(
+ CONF.setRejectProportion(
Double.parseDouble(
properties
- .getProperty("reject_proportion", Double.toString(conf.getRejectProportion()))
+ .getProperty("reject_proportion", Double.toString(CONF.getRejectProportion()))
.trim()));
- conf.setWriteMemoryVariationReportProportion(
+ CONF.setWriteMemoryVariationReportProportion(
Double.parseDouble(
properties
.getProperty(
"write_memory_variation_report_proportion",
- Double.toString(conf.getWriteMemoryVariationReportProportion()))
+ Double.toString(CONF.getWriteMemoryVariationReportProportion()))
.trim()));
- conf.setMetaDataCacheEnable(
+ CONF.setMetaDataCacheEnable(
Boolean.parseBoolean(
properties
.getProperty(
- "meta_data_cache_enable", Boolean.toString(conf.isMetaDataCacheEnable()))
+ "meta_data_cache_enable", Boolean.toString(CONF.isMetaDataCacheEnable()))
.trim()));
initMemoryAllocate(properties);
@@ -320,656 +316,563 @@ public class IoTDBDescriptor {
if (systemDir != null) {
systemDir = FilePathUtils.regularizePath(systemDir) + IoTDBConstant.SYSTEM_FOLDER_NAME;
} else {
- systemDir = conf.getSystemDir();
+ systemDir = CONF.getDnSystemDir();
}
}
- conf.setSystemDir(systemDir);
-
- conf.setSchemaDir(
- FilePathUtils.regularizePath(conf.getSystemDir()) + IoTDBConstant.SCHEMA_FOLDER_NAME);
+ CONF.setDnSystemDir(systemDir);
- conf.setQueryDir(
- FilePathUtils.regularizePath(conf.getSystemDir() + IoTDBConstant.QUERY_FOLDER_NAME));
+ CONF.setSchemaDir(
+ FilePathUtils.regularizePath(CONF.getDnSystemDir()) + IoTDBConstant.SCHEMA_FOLDER_NAME);
- conf.setTracingDir(properties.getProperty("dn_tracing_dir", conf.getTracingDir()));
+ CONF.setQueryDir(
+ FilePathUtils.regularizePath(CONF.getDnSystemDir() + IoTDBConstant.QUERY_FOLDER_NAME));
- conf.setDataDirs(properties.getProperty("dn_data_dirs", conf.getDataDirs()[0]).split(","));
+ CONF.setDnTracingDir(properties.getProperty("dn_tracing_dir", CONF.getDnTracingDir()));
- conf.setConsensusDir(properties.getProperty("dn_consensus_dir", conf.getConsensusDir()));
+ CONF.setDnDataDirs(properties.getProperty("dn_data_dirs", CONF.getDnDataDirs()[0]).split(","));
- int mlogBufferSize =
- Integer.parseInt(
- properties.getProperty("mlog_buffer_size", Integer.toString(conf.getMlogBufferSize())));
- if (mlogBufferSize > 0) {
- conf.setMlogBufferSize(mlogBufferSize);
- }
+ CONF.setDnConsensusDir(properties.getProperty("dn_consensus_dir", CONF.getDnConsensusDir()));
- long forceMlogPeriodInMs =
- Long.parseLong(
- properties.getProperty(
- "sync_mlog_period_in_ms", Long.toString(conf.getSyncMlogPeriodInMs())));
- if (forceMlogPeriodInMs > 0) {
- conf.setSyncMlogPeriodInMs(forceMlogPeriodInMs);
- }
-
- String oldMultiDirStrategyClassName = conf.getMultiDirStrategyClassName();
- conf.setMultiDirStrategyClassName(
- properties.getProperty("dn_multi_dir_strategy", conf.getMultiDirStrategyClassName()));
+ String oldMultiDirStrategyClassName = CONF.getDnMultiDirStrategyClassName();
+ CONF.setDnMultiDirStrategyClassName(
+ properties.getProperty("dn_multi_dir_strategy", CONF.getDnMultiDirStrategyClassName()));
try {
- conf.checkMultiDirStrategyClassName();
+ CONF.checkMultiDirStrategyClassName();
} catch (Exception e) {
- conf.setMultiDirStrategyClassName(oldMultiDirStrategyClassName);
+ CONF.setDnMultiDirStrategyClassName(oldMultiDirStrategyClassName);
throw e;
}
- conf.setBatchSize(
+ CONF.setBatchSize(
Integer.parseInt(
- properties.getProperty("batch_size", Integer.toString(conf.getBatchSize()))));
+ properties.getProperty("batch_size", Integer.toString(CONF.getBatchSize()))));
- conf.setEnableMemControl(
+ CONF.setEnableMemControl(
(Boolean.parseBoolean(
properties.getProperty(
- "enable_mem_control", Boolean.toString(conf.isEnableMemControl())))));
- logger.info("IoTDB enable memory control: {}", conf.isEnableMemControl());
+ "enable_mem_control", Boolean.toString(CONF.isEnableMemControl())))));
+ logger.info("IoTDB enable memory control: {}", CONF.isEnableMemControl());
long memTableSizeThreshold =
Long.parseLong(
properties
.getProperty(
- "memtable_size_threshold", Long.toString(conf.getMemtableSizeThreshold()))
+ "memtable_size_threshold", Long.toString(CONF.getMemtableSizeThreshold()))
.trim());
if (memTableSizeThreshold > 0) {
- conf.setMemtableSizeThreshold(memTableSizeThreshold);
+ CONF.setMemtableSizeThreshold(memTableSizeThreshold);
}
- conf.setTvListSortAlgorithm(
- TVListSortAlgorithm.valueOf(
- properties.getProperty(
- "tvlist_sort_algorithm", conf.getTvListSortAlgorithm().toString())));
-
- conf.setAvgSeriesPointNumberThreshold(
- Integer.parseInt(
- properties.getProperty(
- "avg_series_point_number_threshold",
- Integer.toString(conf.getAvgSeriesPointNumberThreshold()))));
-
- conf.setCheckPeriodWhenInsertBlocked(
+ CONF.setCheckPeriodWhenInsertBlocked(
Integer.parseInt(
properties.getProperty(
"check_period_when_insert_blocked",
- Integer.toString(conf.getCheckPeriodWhenInsertBlocked()))));
+ Integer.toString(CONF.getCheckPeriodWhenInsertBlocked()))));
- conf.setMaxWaitingTimeWhenInsertBlocked(
- Integer.parseInt(
- properties.getProperty(
- "max_waiting_time_when_insert_blocked",
- Integer.toString(conf.getMaxWaitingTimeWhenInsertBlocked()))));
-
- conf.setIoTaskQueueSizeForFlushing(
+ CONF.setIoTaskQueueSizeForFlushing(
Integer.parseInt(
properties.getProperty(
"io_task_queue_size_for_flushing",
- Integer.toString(conf.getIoTaskQueueSizeForFlushing()))));
+ Integer.toString(CONF.getIoTaskQueueSizeForFlushing()))));
- conf.setCompactionScheduleIntervalInMs(
+ CONF.setCompactionScheduleIntervalInMs(
Long.parseLong(
properties.getProperty(
"compaction_schedule_interval_in_ms",
- Long.toString(conf.getCompactionScheduleIntervalInMs()))));
+ Long.toString(CONF.getCompactionScheduleIntervalInMs()))));
- conf.setCompactionSubmissionIntervalInMs(
+ CONF.setCompactionSubmissionIntervalInMs(
Long.parseLong(
properties.getProperty(
"compaction_submission_interval_in_ms",
- Long.toString(conf.getCompactionSubmissionIntervalInMs()))));
+ Long.toString(CONF.getCompactionSubmissionIntervalInMs()))));
- conf.setEnableCrossSpaceCompaction(
+ CONF.setEnableCrossSpaceCompaction(
Boolean.parseBoolean(
properties.getProperty(
"enable_cross_space_compaction",
- Boolean.toString(conf.isEnableCrossSpaceCompaction()))));
+ Boolean.toString(CONF.isEnableCrossSpaceCompaction()))));
- conf.setEnableSeqSpaceCompaction(
+ CONF.setEnableSeqSpaceCompaction(
Boolean.parseBoolean(
properties.getProperty(
"enable_seq_space_compaction",
- Boolean.toString(conf.isEnableSeqSpaceCompaction()))));
+ Boolean.toString(CONF.isEnableSeqSpaceCompaction()))));
- conf.setEnableUnseqSpaceCompaction(
+ CONF.setEnableUnseqSpaceCompaction(
Boolean.parseBoolean(
properties.getProperty(
"enable_unseq_space_compaction",
- Boolean.toString(conf.isEnableUnseqSpaceCompaction()))));
+ Boolean.toString(CONF.isEnableUnseqSpaceCompaction()))));
- conf.setCrossCompactionSelector(
+ CONF.setCrossCompactionSelector(
CrossCompactionSelector.getCrossCompactionSelector(
properties.getProperty(
- "cross_selector", conf.getCrossCompactionSelector().toString())));
+ "cross_selector", CONF.getCrossCompactionSelector().toString())));
- conf.setInnerSequenceCompactionSelector(
+ CONF.setInnerSequenceCompactionSelector(
InnerSequenceCompactionSelector.getInnerSequenceCompactionSelector(
properties.getProperty(
- "inner_seq_selector", conf.getInnerSequenceCompactionSelector().toString())));
+ "inner_seq_selector", CONF.getInnerSequenceCompactionSelector().toString())));
- conf.setInnerUnsequenceCompactionSelector(
+ CONF.setInnerUnsequenceCompactionSelector(
InnerUnsequenceCompactionSelector.getInnerUnsequenceCompactionSelector(
properties.getProperty(
- "inner_unseq_selector", conf.getInnerUnsequenceCompactionSelector().toString())));
+ "inner_unseq_selector", CONF.getInnerUnsequenceCompactionSelector().toString())));
- conf.setInnerSeqCompactionPerformer(
+ CONF.setInnerSeqCompactionPerformer(
InnerSeqCompactionPerformer.getInnerSeqCompactionPerformer(
properties.getProperty(
- "inner_seq_performer", conf.getInnerSeqCompactionPerformer().toString())));
+ "inner_seq_performer", CONF.getInnerSeqCompactionPerformer().toString())));
- conf.setInnerUnseqCompactionPerformer(
+ CONF.setInnerUnseqCompactionPerformer(
InnerUnseqCompactionPerformer.getInnerUnseqCompactionPerformer(
properties.getProperty(
- "inner_unseq_performer", conf.getInnerUnseqCompactionPerformer().toString())));
+ "inner_unseq_performer", CONF.getInnerUnseqCompactionPerformer().toString())));
- conf.setCrossCompactionPerformer(
+ CONF.setCrossCompactionPerformer(
CrossCompactionPerformer.getCrossCompactionPerformer(
properties.getProperty(
- "cross_performer", conf.getCrossCompactionPerformer().toString())));
+ "cross_performer", CONF.getCrossCompactionPerformer().toString())));
- conf.setCompactionPriority(
+ CONF.setCompactionPriority(
CompactionPriority.valueOf(
properties.getProperty(
- "compaction_priority", conf.getCompactionPriority().toString())));
+ "compaction_priority", CONF.getCompactionPriority().toString())));
int subtaskNum =
Integer.parseInt(
properties.getProperty(
- "sub_compaction_thread_count", Integer.toString(conf.getSubCompactionTaskNum())));
+ "sub_compaction_thread_count", Integer.toString(CONF.getSubCompactionTaskNum())));
subtaskNum = subtaskNum <= 0 ? 1 : subtaskNum;
- conf.setSubCompactionTaskNum(subtaskNum);
+ CONF.setSubCompactionTaskNum(subtaskNum);
- conf.setQueryTimeoutThreshold(
+ CONF.setQueryTimeoutThreshold(
Long.parseLong(
properties.getProperty(
- "query_timeout_threshold", Long.toString(conf.getQueryTimeoutThreshold()))));
+ "query_timeout_threshold", Long.toString(CONF.getQueryTimeoutThreshold()))));
- conf.setDnSessionTimeoutThreshold(
+ CONF.setDnSessionTimeoutThreshold(
Integer.parseInt(
properties.getProperty(
"dn_session_timeout_threshold",
- Integer.toString(conf.getDnSessionTimeoutThreshold()))));
- conf.setMaxNumberOfSyncFileRetry(
+ Integer.toString(CONF.getDnSessionTimeoutThreshold()))));
+ CONF.setMaxNumberOfSyncFileRetry(
Integer.parseInt(
properties
.getProperty(
"max_number_of_sync_file_retry",
- Integer.toString(conf.getMaxNumberOfSyncFileRetry()))
+ Integer.toString(CONF.getMaxNumberOfSyncFileRetry()))
.trim()));
- conf.setIpWhiteList(properties.getProperty("ip_white_list", conf.getIpWhiteList()));
-
- conf.setFlushThreadCount(
- Integer.parseInt(
- properties.getProperty(
- "flush_thread_count", Integer.toString(conf.getFlushThreadCount()))));
-
- if (conf.getFlushThreadCount() <= 0) {
- conf.setFlushThreadCount(Runtime.getRuntime().availableProcessors());
- }
+ CONF.setIpWhiteList(properties.getProperty("ip_white_list", CONF.getIpWhiteList()));
// start: index parameter setting
- conf.setIndexRootFolder(properties.getProperty("index_root_dir", conf.getIndexRootFolder()));
+ CONF.setIndexRootFolder(properties.getProperty("index_root_dir", CONF.getIndexRootFolder()));
- conf.setEnableIndex(
+ CONF.setEnableIndex(
Boolean.parseBoolean(
- properties.getProperty("enable_index", Boolean.toString(conf.isEnableIndex()))));
+ properties.getProperty("enable_index", Boolean.toString(CONF.isEnableIndex()))));
- conf.setConcurrentIndexBuildThread(
+ CONF.setConcurrentIndexBuildThread(
Integer.parseInt(
properties.getProperty(
"concurrent_index_build_thread",
- Integer.toString(conf.getConcurrentIndexBuildThread()))));
- if (conf.getConcurrentIndexBuildThread() <= 0) {
- conf.setConcurrentIndexBuildThread(Runtime.getRuntime().availableProcessors());
+ Integer.toString(CONF.getConcurrentIndexBuildThread()))));
+ if (CONF.getConcurrentIndexBuildThread() <= 0) {
+ CONF.setConcurrentIndexBuildThread(Runtime.getRuntime().availableProcessors());
}
- conf.setDefaultIndexWindowRange(
+ CONF.setDefaultIndexWindowRange(
Integer.parseInt(
properties.getProperty(
"default_index_window_range",
- Integer.toString(conf.getDefaultIndexWindowRange()))));
+ Integer.toString(CONF.getDefaultIndexWindowRange()))));
- conf.setQueryThreadCount(
+ CONF.setQueryThreadCount(
Integer.parseInt(
properties.getProperty(
- "query_thread_count", Integer.toString(conf.getQueryThreadCount()))));
+ "query_thread_count", Integer.toString(CONF.getQueryThreadCount()))));
- if (conf.getQueryThreadCount() <= 0) {
- conf.setQueryThreadCount(Runtime.getRuntime().availableProcessors());
+ if (CONF.getQueryThreadCount() <= 0) {
+ CONF.setQueryThreadCount(Runtime.getRuntime().availableProcessors());
}
- conf.setMaxAllowedConcurrentQueries(
+ CONF.setMaxAllowedConcurrentQueries(
Integer.parseInt(
properties.getProperty(
"max_allowed_concurrent_queries",
- Integer.toString(conf.getMaxAllowedConcurrentQueries()))));
+ Integer.toString(CONF.getMaxAllowedConcurrentQueries()))));
- if (conf.getMaxAllowedConcurrentQueries() <= 0) {
- conf.setMaxAllowedConcurrentQueries(1000);
+ if (CONF.getMaxAllowedConcurrentQueries() <= 0) {
+ CONF.setMaxAllowedConcurrentQueries(1000);
}
- conf.setSubRawQueryThreadCount(
+ CONF.setSubRawQueryThreadCount(
Integer.parseInt(
properties.getProperty(
- "sub_rawQuery_thread_count", Integer.toString(conf.getSubRawQueryThreadCount()))));
+ "sub_rawQuery_thread_count", Integer.toString(CONF.getSubRawQueryThreadCount()))));
- if (conf.getSubRawQueryThreadCount() <= 0) {
- conf.setSubRawQueryThreadCount(Runtime.getRuntime().availableProcessors());
+ if (CONF.getSubRawQueryThreadCount() <= 0) {
+ CONF.setSubRawQueryThreadCount(Runtime.getRuntime().availableProcessors());
}
- conf.setRawQueryBlockingQueueCapacity(
+ CONF.setRawQueryBlockingQueueCapacity(
Integer.parseInt(
properties.getProperty(
"raw_query_blocking_queue_capacity",
- Integer.toString(conf.getRawQueryBlockingQueueCapacity()))));
+ Integer.toString(CONF.getRawQueryBlockingQueueCapacity()))));
- conf.setmRemoteSchemaCacheSize(
+ CONF.setmRemoteSchemaCacheSize(
Integer.parseInt(
properties
.getProperty(
- "remote_schema_cache_size", Integer.toString(conf.getmRemoteSchemaCacheSize()))
+ "remote_schema_cache_size", Integer.toString(CONF.getmRemoteSchemaCacheSize()))
.trim()));
- conf.setLanguageVersion(
- properties.getProperty("language_version", conf.getLanguageVersion()).trim());
+ CONF.setLanguageVersion(
+ properties.getProperty("language_version", CONF.getLanguageVersion()).trim());
if (properties.containsKey("chunk_buffer_pool_enable")) {
- conf.setChunkBufferPoolEnable(
+ CONF.setChunkBufferPoolEnable(
Boolean.parseBoolean(properties.getProperty("chunk_buffer_pool_enable")));
}
- conf.setEnableExternalSort(
+ CONF.setEnableExternalSort(
Boolean.parseBoolean(
properties.getProperty(
- "enable_external_sort", Boolean.toString(conf.isEnableExternalSort()))));
- conf.setExternalSortThreshold(
- Integer.parseInt(
- properties.getProperty(
- "external_sort_threshold", Integer.toString(conf.getExternalSortThreshold()))));
- conf.setUpgradeThreadCount(
+ "enable_external_sort", Boolean.toString(CONF.isEnableExternalSort()))));
+ CONF.setExternalSortThreshold(
Integer.parseInt(
properties.getProperty(
- "upgrade_thread_count", Integer.toString(conf.getUpgradeThreadCount()))));
- conf.setCrossCompactionFileSelectionTimeBudget(
+ "external_sort_threshold", Integer.toString(CONF.getExternalSortThreshold()))));
+ CONF.setCrossCompactionFileSelectionTimeBudget(
Long.parseLong(
properties.getProperty(
"cross_compaction_file_selection_time_budget",
- Long.toString(conf.getCrossCompactionFileSelectionTimeBudget()))));
- conf.setMergeIntervalSec(
+ Long.toString(CONF.getCrossCompactionFileSelectionTimeBudget()))));
+ CONF.setMergeIntervalSec(
Long.parseLong(
properties.getProperty(
- "merge_interval_sec", Long.toString(conf.getMergeIntervalSec()))));
- conf.setCompactionThreadCount(
+ "merge_interval_sec", Long.toString(CONF.getMergeIntervalSec()))));
+ CONF.setCompactionThreadCount(
Integer.parseInt(
properties.getProperty(
- "compaction_thread_count", Integer.toString(conf.getCompactionThreadCount()))));
- conf.setChunkMetadataSizeProportion(
+ "compaction_thread_count", Integer.toString(CONF.getCompactionThreadCount()))));
+ CONF.setChunkMetadataSizeProportion(
Double.parseDouble(
properties.getProperty(
"chunk_metadata_size_proportion",
- Double.toString(conf.getChunkMetadataSizeProportion()))));
- conf.setTargetCompactionFileSize(
+ Double.toString(CONF.getChunkMetadataSizeProportion()))));
+ CONF.setTargetCompactionFileSize(
Long.parseLong(
properties.getProperty(
- "target_compaction_file_size", Long.toString(conf.getTargetCompactionFileSize()))));
- conf.setTargetChunkSize(
+ "target_compaction_file_size", Long.toString(CONF.getTargetCompactionFileSize()))));
+ CONF.setTargetChunkSize(
Long.parseLong(
- properties.getProperty("target_chunk_size", Long.toString(conf.getTargetChunkSize()))));
- conf.setTargetChunkPointNum(
+ properties.getProperty("target_chunk_size", Long.toString(CONF.getTargetChunkSize()))));
+ CONF.setTargetChunkPointNum(
Long.parseLong(
properties.getProperty(
- "target_chunk_point_num", Long.toString(conf.getTargetChunkPointNum()))));
- conf.setChunkPointNumLowerBoundInCompaction(
+ "target_chunk_point_num", Long.toString(CONF.getTargetChunkPointNum()))));
+ CONF.setChunkPointNumLowerBoundInCompaction(
Long.parseLong(
properties.getProperty(
"chunk_point_num_lower_bound_in_compaction",
- Long.toString(conf.getChunkPointNumLowerBoundInCompaction()))));
- conf.setChunkSizeLowerBoundInCompaction(
+ Long.toString(CONF.getChunkPointNumLowerBoundInCompaction()))));
+ CONF.setChunkSizeLowerBoundInCompaction(
Long.parseLong(
properties.getProperty(
"chunk_size_lower_bound_in_compaction",
- Long.toString(conf.getChunkSizeLowerBoundInCompaction()))));
- conf.setMaxInnerCompactionCandidateFileNum(
+ Long.toString(CONF.getChunkSizeLowerBoundInCompaction()))));
+ CONF.setMaxInnerCompactionCandidateFileNum(
Integer.parseInt(
properties.getProperty(
"max_inner_compaction_candidate_file_num",
- Integer.toString(conf.getMaxInnerCompactionCandidateFileNum()))));
- conf.setMaxCrossCompactionCandidateFileNum(
+ Integer.toString(CONF.getMaxInnerCompactionCandidateFileNum()))));
+ CONF.setMaxCrossCompactionCandidateFileNum(
Integer.parseInt(
properties.getProperty(
"max_cross_compaction_candidate_file_num",
- Integer.toString(conf.getMaxCrossCompactionCandidateFileNum()))));
- conf.setMaxCrossCompactionCandidateFileSize(
+ Integer.toString(CONF.getMaxCrossCompactionCandidateFileNum()))));
+ CONF.setMaxCrossCompactionCandidateFileSize(
Long.parseLong(
properties.getProperty(
"max_cross_compaction_candidate_file_size",
- Long.toString(conf.getMaxCrossCompactionCandidateFileSize()))));
+ Long.toString(CONF.getMaxCrossCompactionCandidateFileSize()))));
- conf.setCompactionWriteThroughputMbPerSec(
+ CONF.setCompactionWriteThroughputMbPerSec(
Integer.parseInt(
properties.getProperty(
"compaction_write_throughput_mb_per_sec",
- Integer.toString(conf.getCompactionWriteThroughputMbPerSec()))));
+ Integer.toString(CONF.getCompactionWriteThroughputMbPerSec()))));
- conf.setEnableCompactionValidation(
+ CONF.setEnableCompactionValidation(
Boolean.parseBoolean(
properties.getProperty(
"enable_compaction_validation",
- Boolean.toString(conf.isEnableCompactionValidation()))));
-
- conf.setEnablePartialInsert(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_partial_insert", String.valueOf(conf.isEnablePartialInsert()))));
+ Boolean.toString(CONF.isEnableCompactionValidation()))));
int rpcSelectorThreadNum =
Integer.parseInt(
properties.getProperty(
"dn_rpc_selector_thread_count",
- Integer.toString(conf.getDnRpcSelectorThreadCount()).trim()));
+ Integer.toString(CONF.getDnRpcSelectorThreadCount()).trim()));
if (rpcSelectorThreadNum <= 0) {
rpcSelectorThreadNum = 1;
}
- conf.setDnRpcSelectorThreadCount(rpcSelectorThreadNum);
+ CONF.setDnRpcSelectorThreadCount(rpcSelectorThreadNum);
int minConcurrentClientNum =
Integer.parseInt(
properties.getProperty(
"dn_rpc_min_concurrent_client_num",
- Integer.toString(conf.getDnRpcMinConcurrentClientNum()).trim()));
+ Integer.toString(CONF.getDnRpcMinConcurrentClientNum()).trim()));
if (minConcurrentClientNum <= 0) {
minConcurrentClientNum = Runtime.getRuntime().availableProcessors();
}
- conf.setDnRpcMinConcurrentClientNum(minConcurrentClientNum);
+ CONF.setDnRpcMinConcurrentClientNum(minConcurrentClientNum);
int maxConcurrentClientNum =
Integer.parseInt(
properties.getProperty(
"dn_rpc_max_concurrent_client_num",
- Integer.toString(conf.getDnRpcMaxConcurrentClientNum()).trim()));
+ Integer.toString(CONF.getDnRpcMaxConcurrentClientNum()).trim()));
if (maxConcurrentClientNum <= 0) {
maxConcurrentClientNum = 65535;
}
- conf.setDnRpcMaxConcurrentClientNum(maxConcurrentClientNum);
+ CONF.setDnRpcMaxConcurrentClientNum(maxConcurrentClientNum);
- conf.setEnableWatermark(
+ CONF.setEnableWatermark(
Boolean.parseBoolean(
properties.getProperty(
- "watermark_module_opened", Boolean.toString(conf.isEnableWatermark()).trim())));
- conf.setWatermarkSecretKey(
- properties.getProperty("watermark_secret_key", conf.getWatermarkSecretKey()));
- conf.setWatermarkBitString(
- properties.getProperty("watermark_bit_string", conf.getWatermarkBitString()));
- conf.setWatermarkMethod(properties.getProperty("watermark_method", conf.getWatermarkMethod()));
+ "watermark_module_opened", Boolean.toString(CONF.isEnableWatermark()).trim())));
+ CONF.setWatermarkSecretKey(
+ properties.getProperty("watermark_secret_key", CONF.getWatermarkSecretKey()));
+ CONF.setWatermarkBitString(
+ properties.getProperty("watermark_bit_string", CONF.getWatermarkBitString()));
+ CONF.setWatermarkMethod(properties.getProperty("watermark_method", CONF.getWatermarkMethod()));
loadAutoCreateSchemaProps(properties);
- conf.setTsFileStorageFs(
- properties.getProperty("tsfile_storage_fs", conf.getTsFileStorageFs().toString()));
- conf.setCoreSitePath(properties.getProperty("core_site_path", conf.getCoreSitePath()));
- conf.setHdfsSitePath(properties.getProperty("hdfs_site_path", conf.getHdfsSitePath()));
- conf.setHdfsIp(properties.getProperty("hdfs_ip", conf.getRawHDFSIp()).split(","));
- conf.setHdfsPort(properties.getProperty("hdfs_port", conf.getHdfsPort()));
- conf.setDfsNameServices(properties.getProperty("dfs_nameservices", conf.getDfsNameServices()));
- conf.setDfsHaNamenodes(
- properties.getProperty("dfs_ha_namenodes", conf.getRawDfsHaNamenodes()).split(","));
- conf.setDfsHaAutomaticFailoverEnabled(
+ CONF.setTsFileStorageFs(
+ properties.getProperty("tsfile_storage_fs", CONF.getTsFileStorageFs().toString()));
+ CONF.setCoreSitePath(properties.getProperty("core_site_path", CONF.getCoreSitePath()));
+ CONF.setHdfsSitePath(properties.getProperty("hdfs_site_path", CONF.getHdfsSitePath()));
+ CONF.setHdfsIp(properties.getProperty("hdfs_ip", CONF.getRawHDFSIp()).split(","));
+ CONF.setHdfsPort(properties.getProperty("hdfs_port", CONF.getHdfsPort()));
+ CONF.setDfsNameServices(properties.getProperty("dfs_nameservices", CONF.getDfsNameServices()));
+ CONF.setDfsHaNamenodes(
+ properties.getProperty("dfs_ha_namenodes", CONF.getRawDfsHaNamenodes()).split(","));
+ CONF.setDfsHaAutomaticFailoverEnabled(
Boolean.parseBoolean(
properties.getProperty(
"dfs_ha_automatic_failover_enabled",
- String.valueOf(conf.isDfsHaAutomaticFailoverEnabled()))));
- conf.setDfsClientFailoverProxyProvider(
+ String.valueOf(CONF.isDfsHaAutomaticFailoverEnabled()))));
+ CONF.setDfsClientFailoverProxyProvider(
properties.getProperty(
- "dfs_client_failover_proxy_provider", conf.getDfsClientFailoverProxyProvider()));
- conf.setUseKerberos(
+ "dfs_client_failover_proxy_provider", CONF.getDfsClientFailoverProxyProvider()));
+ CONF.setUseKerberos(
Boolean.parseBoolean(
- properties.getProperty("hdfs_use_kerberos", String.valueOf(conf.isUseKerberos()))));
- conf.setKerberosKeytabFilePath(
- properties.getProperty("kerberos_keytab_file_path", conf.getKerberosKeytabFilePath()));
- conf.setKerberosPrincipal(
- properties.getProperty("kerberos_principal", conf.getKerberosPrincipal()));
+ properties.getProperty("hdfs_use_kerberos", String.valueOf(CONF.isUseKerberos()))));
+ CONF.setKerberosKeytabFilePath(
+ properties.getProperty("kerberos_keytab_file_path", CONF.getKerberosKeytabFilePath()));
+ CONF.setKerberosPrincipal(
+ properties.getProperty("kerberos_principal", CONF.getKerberosPrincipal()));
// the num of memtables in each database
- conf.setConcurrentWritingTimePartition(
+ CONF.setConcurrentWritingTimePartition(
Integer.parseInt(
properties.getProperty(
"concurrent_writing_time_partition",
- String.valueOf(conf.getConcurrentWritingTimePartition()))));
+ String.valueOf(CONF.getConcurrentWritingTimePartition()))));
// the default fill interval in LinearFill and PreviousFill
- conf.setDefaultFillInterval(
+ CONF.setDefaultFillInterval(
Integer.parseInt(
properties.getProperty(
- "default_fill_interval", String.valueOf(conf.getDefaultFillInterval()))));
+ "default_fill_interval", String.valueOf(CONF.getDefaultFillInterval()))));
- conf.setTagAttributeTotalSize(
- Integer.parseInt(
- properties.getProperty(
- "tag_attribute_total_size", String.valueOf(conf.getTagAttributeTotalSize()))));
-
- conf.setTagAttributeFlushInterval(
- Integer.parseInt(
- properties.getProperty(
- "tag_attribute_flush_interval",
- String.valueOf(conf.getTagAttributeFlushInterval()))));
-
- conf.setPrimitiveArraySize(
+ CONF.setPrimitiveArraySize(
(Integer.parseInt(
properties.getProperty(
- "primitive_array_size", String.valueOf(conf.getPrimitiveArraySize())))));
+ "primitive_array_size", String.valueOf(CONF.getPrimitiveArraySize())))));
- conf.setDnThriftMaxFrameSize(
+ CONF.setDnThriftMaxFrameSize(
Integer.parseInt(
properties.getProperty(
- "dn_thrift_max_frame_size", String.valueOf(conf.getDnThriftMaxFrameSize()))));
+ "dn_thrift_max_frame_size", String.valueOf(CONF.getDnThriftMaxFrameSize()))));
- if (conf.getDnThriftMaxFrameSize() < IoTDBConstant.LEFT_SIZE_IN_REQUEST * 2) {
- conf.setDnThriftMaxFrameSize(IoTDBConstant.LEFT_SIZE_IN_REQUEST * 2);
+ if (CONF.getDnThriftMaxFrameSize() < IoTDBConstant.LEFT_SIZE_IN_REQUEST * 2) {
+ CONF.setDnThriftMaxFrameSize(IoTDBConstant.LEFT_SIZE_IN_REQUEST * 2);
}
- conf.setDnThriftDefaultBufferSize(
+ CONF.setDnThriftInitBufferSize(
Integer.parseInt(
properties.getProperty(
- "dn_thrift_init_buffer_size", String.valueOf(conf.getDnThriftDefaultBufferSize()))));
+ "dn_thrift_init_buffer_size", String.valueOf(CONF.getDnThriftInitBufferSize()))));
- conf.setFrequencyIntervalInMinute(
+ CONF.setFrequencyIntervalInMinute(
Integer.parseInt(
properties.getProperty(
"frequency_interval_in_minute",
- String.valueOf(conf.getFrequencyIntervalInMinute()))));
+ String.valueOf(CONF.getFrequencyIntervalInMinute()))));
- conf.setSlowQueryThreshold(
+ CONF.setSlowQueryThreshold(
Long.parseLong(
properties.getProperty(
- "slow_query_threshold", String.valueOf(conf.getSlowQueryThreshold()))));
-
- conf.setDataRegionNum(
- Integer.parseInt(
- properties.getProperty("data_region_num", String.valueOf(conf.getDataRegionNum()))));
-
- conf.setRecoveryLogIntervalInMs(
- Long.parseLong(
- properties.getProperty(
- "recovery_log_interval_in_ms", String.valueOf(conf.getRecoveryLogIntervalInMs()))));
-
- conf.setEnableDiscardOutOfOrderData(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_discard_out_of_order_data",
- Boolean.toString(conf.isEnableDiscardOutOfOrderData()))));
+ "slow_query_threshold", String.valueOf(CONF.getSlowQueryThreshold()))));
- conf.setWindowEvaluationThreadCount(
+ CONF.setWindowEvaluationThreadCount(
Integer.parseInt(
properties.getProperty(
"window_evaluation_thread_count",
- Integer.toString(conf.getWindowEvaluationThreadCount()))));
- if (conf.getWindowEvaluationThreadCount() <= 0) {
- conf.setWindowEvaluationThreadCount(Runtime.getRuntime().availableProcessors());
+ Integer.toString(CONF.getWindowEvaluationThreadCount()))));
+ if (CONF.getWindowEvaluationThreadCount() <= 0) {
+ CONF.setWindowEvaluationThreadCount(Runtime.getRuntime().availableProcessors());
}
- conf.setMaxPendingWindowEvaluationTasks(
+ CONF.setMaxPendingWindowEvaluationTasks(
Integer.parseInt(
properties.getProperty(
"max_pending_window_evaluation_tasks",
- Integer.toString(conf.getMaxPendingWindowEvaluationTasks()))));
- if (conf.getMaxPendingWindowEvaluationTasks() <= 0) {
- conf.setMaxPendingWindowEvaluationTasks(64);
+ Integer.toString(CONF.getMaxPendingWindowEvaluationTasks()))));
+ if (CONF.getMaxPendingWindowEvaluationTasks() <= 0) {
+ CONF.setMaxPendingWindowEvaluationTasks(64);
}
// id table related configuration
- conf.setDeviceIDTransformationMethod(
+ CONF.setDeviceIDTransformationMethod(
properties.getProperty(
- "device_id_transformation_method", conf.getDeviceIDTransformationMethod()));
+ "device_id_transformation_method", CONF.getDeviceIDTransformationMethod()));
- conf.setEnableIDTable(
+ CONF.setEnableIDTable(
Boolean.parseBoolean(
- properties.getProperty("enable_id_table", String.valueOf(conf.isEnableIDTable()))));
+ properties.getProperty("enable_id_table", String.valueOf(CONF.isEnableIDTable()))));
- conf.setEnableIDTableLogFile(
+ CONF.setEnableIDTableLogFile(
Boolean.parseBoolean(
properties.getProperty(
- "enable_id_table_log_file", String.valueOf(conf.isEnableIDTableLogFile()))));
+ "enable_id_table_log_file", String.valueOf(CONF.isEnableIDTableLogFile()))));
- conf.setSchemaEngineMode(
- properties.getProperty("schema_engine_mode", String.valueOf(conf.getSchemaEngineMode())));
+ CONF.setSchemaEngineMode(
+ properties.getProperty("schema_engine_mode", String.valueOf(CONF.getSchemaEngineMode())));
- conf.setEnableLastCache(
+ CONF.setEnableLastCache(
Boolean.parseBoolean(
properties.getProperty(
- "enable_last_cache", Boolean.toString(conf.isLastCacheEnabled()))));
+ "enable_last_cache", Boolean.toString(CONF.isLastCacheEnabled()))));
- if (conf.getSchemaEngineMode().equals("Rocksdb_based")) {
- conf.setEnableLastCache(false);
+ if (CONF.getSchemaEngineMode().equals("Rocksdb_based")) {
+ CONF.setEnableLastCache(false);
}
- conf.setCachedMNodeSizeInSchemaFileMode(
+ CONF.setCachedMNodeSizeInSchemaFileMode(
Integer.parseInt(
properties.getProperty(
"cached_mnode_size_in_schema_file_mode",
- String.valueOf(conf.getCachedMNodeSizeInSchemaFileMode()))));
+ String.valueOf(CONF.getCachedMNodeSizeInSchemaFileMode()))));
- conf.setMinimumSegmentInSchemaFile(
+ CONF.setMinimumSegmentInSchemaFile(
Short.parseShort(
properties.getProperty(
"minimum_schema_file_segment_in_bytes",
- String.valueOf(conf.getMinimumSegmentInSchemaFile()))));
-
- conf.setPageCacheSizeInSchemaFile(
- Integer.parseInt(
- properties.getProperty(
- "page_cache_in_schema_file", String.valueOf(conf.getPageCacheSizeInSchemaFile()))));
+ String.valueOf(CONF.getMinimumSegmentInSchemaFile()))));
- conf.setSchemaFileLogSize(
+ CONF.setPageCacheSizeInSchemaFile(
Integer.parseInt(
properties.getProperty(
- "schema_file_log_size", String.valueOf(conf.getSchemaFileLogSize()))));
+ "page_cache_in_schema_file", String.valueOf(CONF.getPageCacheSizeInSchemaFile()))));
- conf.setMaxMeasurementNumOfInternalRequest(
+ CONF.setSchemaFileLogSize(
Integer.parseInt(
properties.getProperty(
- "max_measurement_num_of_internal_request",
- String.valueOf(conf.getMaxMeasurementNumOfInternalRequest()))));
+ "schema_file_log_size", String.valueOf(CONF.getSchemaFileLogSize()))));
// mqtt
loadMqttProps(properties);
- conf.setSelectIntoInsertTabletPlanRowLimit(
+ CONF.setSelectIntoInsertTabletPlanRowLimit(
Integer.parseInt(
properties.getProperty(
"select_into_insert_tablet_plan_row_limit",
- String.valueOf(conf.getSelectIntoInsertTabletPlanRowLimit()))));
- conf.setIntoOperationExecutionThreadCount(
+ String.valueOf(CONF.getSelectIntoInsertTabletPlanRowLimit()))));
+ CONF.setIntoOperationExecutionThreadCount(
Integer.parseInt(
properties.getProperty(
"into_operation_execution_thread_count",
- String.valueOf(conf.getIntoOperationExecutionThreadCount()))));
- if (conf.getIntoOperationExecutionThreadCount() <= 0) {
- conf.setIntoOperationExecutionThreadCount(2);
+ String.valueOf(CONF.getIntoOperationExecutionThreadCount()))));
+ if (CONF.getIntoOperationExecutionThreadCount() <= 0) {
+ CONF.setIntoOperationExecutionThreadCount(2);
}
- conf.setExtPipeDir(properties.getProperty("ext_pipe_dir", conf.getExtPipeDir()).trim());
+ CONF.setExtPipeDir(properties.getProperty("ext_pipe_dir", CONF.getExtPipeDir()).trim());
// At the same time, set TSFileConfig
TSFileDescriptor.getInstance()
.getConfig()
.setTSFileStorageFs(
FSType.valueOf(
- properties.getProperty("tsfile_storage_fs", conf.getTsFileStorageFs().name())));
+ properties.getProperty("tsfile_storage_fs", CONF.getTsFileStorageFs().name())));
TSFileDescriptor.getInstance()
.getConfig()
- .setCoreSitePath(properties.getProperty("core_site_path", conf.getCoreSitePath()));
+ .setCoreSitePath(properties.getProperty("core_site_path", CONF.getCoreSitePath()));
TSFileDescriptor.getInstance()
.getConfig()
- .setHdfsSitePath(properties.getProperty("hdfs_site_path", conf.getHdfsSitePath()));
+ .setHdfsSitePath(properties.getProperty("hdfs_site_path", CONF.getHdfsSitePath()));
TSFileDescriptor.getInstance()
.getConfig()
- .setHdfsIp(properties.getProperty("hdfs_ip", conf.getRawHDFSIp()).split(","));
+ .setHdfsIp(properties.getProperty("hdfs_ip", CONF.getRawHDFSIp()).split(","));
TSFileDescriptor.getInstance()
.getConfig()
- .setHdfsPort(properties.getProperty("hdfs_port", conf.getHdfsPort()));
+ .setHdfsPort(properties.getProperty("hdfs_port", CONF.getHdfsPort()));
TSFileDescriptor.getInstance()
.getConfig()
- .setDfsNameServices(properties.getProperty("dfs_nameservices", conf.getDfsNameServices()));
+ .setDfsNameServices(properties.getProperty("dfs_nameservices", CONF.getDfsNameServices()));
TSFileDescriptor.getInstance()
.getConfig()
.setDfsHaNamenodes(
- properties.getProperty("dfs_ha_namenodes", conf.getRawDfsHaNamenodes()).split(","));
+ properties.getProperty("dfs_ha_namenodes", CONF.getRawDfsHaNamenodes()).split(","));
TSFileDescriptor.getInstance()
.getConfig()
.setDfsHaAutomaticFailoverEnabled(
Boolean.parseBoolean(
properties.getProperty(
"dfs_ha_automatic_failover_enabled",
- String.valueOf(conf.isDfsHaAutomaticFailoverEnabled()))));
+ String.valueOf(CONF.isDfsHaAutomaticFailoverEnabled()))));
TSFileDescriptor.getInstance()
.getConfig()
.setDfsClientFailoverProxyProvider(
properties.getProperty(
- "dfs_client_failover_proxy_provider", conf.getDfsClientFailoverProxyProvider()));
+ "dfs_client_failover_proxy_provider", CONF.getDfsClientFailoverProxyProvider()));
TSFileDescriptor.getInstance()
.getConfig()
.setPatternMatchingThreshold(
Integer.parseInt(
properties.getProperty(
"pattern_matching_threshold",
- String.valueOf(conf.getPatternMatchingThreshold()))));
+ String.valueOf(CONF.getPatternMatchingThreshold()))));
TSFileDescriptor.getInstance()
.getConfig()
.setUseKerberos(
Boolean.parseBoolean(
- properties.getProperty("hdfs_use_kerberos", String.valueOf(conf.isUseKerberos()))));
+ properties.getProperty("hdfs_use_kerberos", String.valueOf(CONF.isUseKerberos()))));
TSFileDescriptor.getInstance()
.getConfig()
.setKerberosKeytabFilePath(
- properties.getProperty("kerberos_keytab_file_path", conf.getKerberosKeytabFilePath()));
+ properties.getProperty("kerberos_keytab_file_path", CONF.getKerberosKeytabFilePath()));
TSFileDescriptor.getInstance()
.getConfig()
.setKerberosPrincipal(
- properties.getProperty("kerberos_principal", conf.getKerberosPrincipal()));
- TSFileDescriptor.getInstance().getConfig().setBatchSize(conf.getBatchSize());
-
- conf.setCoordinatorReadExecutorSize(
- Integer.parseInt(
- properties.getProperty(
- "coordinator_read_executor_size",
- Integer.toString(conf.getCoordinatorReadExecutorSize()))));
- conf.setCoordinatorWriteExecutorSize(
- Integer.parseInt(
- properties.getProperty(
- "coordinator_write_executor_size",
- Integer.toString(conf.getCoordinatorWriteExecutorSize()))));
+ properties.getProperty("kerberos_principal", CONF.getKerberosPrincipal()));
+ TSFileDescriptor.getInstance().getConfig().setBatchSize(CONF.getBatchSize());
// commons
commonDescriptor.loadCommonProps(properties);
- commonDescriptor.initCommonConfigDir(conf.getSystemDir());
+ commonDescriptor.initCommonConfigDir(CONF.getDnSystemDir());
// timed flush memtable
loadTimedService(properties);
@@ -998,56 +901,56 @@ public class IoTDBDescriptor {
// author cache
loadAuthorCache(properties);
- conf.setTimePartitionInterval(
+ CONF.setTimePartitionInterval(
DateTimeUtils.convertMilliTimeWithPrecision(
- conf.getTimePartitionInterval(), conf.getTimestampPrecision()));
+ CONF.getTimePartitionInterval(), CONF.getTimestampPrecision()));
}
private void loadAuthorCache(Properties properties) {
- conf.setAuthorCacheSize(
+ CONF.setAuthorCacheSize(
Integer.parseInt(
properties.getProperty(
- "author_cache_size", String.valueOf(conf.getAuthorCacheSize()))));
- conf.setAuthorCacheExpireTime(
+ "author_cache_size", String.valueOf(CONF.getAuthorCacheSize()))));
+ CONF.setAuthorCacheExpireTime(
Integer.parseInt(
properties.getProperty(
- "author_cache_expire_time", String.valueOf(conf.getAuthorCacheExpireTime()))));
+ "author_cache_expire_time", String.valueOf(CONF.getAuthorCacheExpireTime()))));
}
private void loadWALProps(Properties properties) {
- conf.setWalMode(
- WALMode.valueOf((properties.getProperty("wal_mode", conf.getWalMode().toString()))));
+ CONF.setWalMode(
+ WALMode.valueOf((properties.getProperty("wal_mode", CONF.getWalMode().toString()))));
int maxWalNodesNum =
Integer.parseInt(
properties.getProperty(
- "max_wal_nodes_num", Integer.toString(conf.getMaxWalNodesNum())));
+ "max_wal_nodes_num", Integer.toString(CONF.getMaxWalNodesNum())));
if (maxWalNodesNum > 0) {
- conf.setMaxWalNodesNum(maxWalNodesNum);
+ CONF.setMaxWalNodesNum(maxWalNodesNum);
}
int walBufferSize =
Integer.parseInt(
properties.getProperty(
- "wal_buffer_size_in_byte", Integer.toString(conf.getWalBufferSize())));
+ "wal_buffer_size_in_byte", Integer.toString(CONF.getWalBufferSize())));
if (walBufferSize > 0) {
- conf.setWalBufferSize(walBufferSize);
+ CONF.setWalBufferSize(walBufferSize);
}
int walBufferEntrySize =
Integer.parseInt(
properties.getProperty(
- "wal_buffer_entry_size_in_byte", Integer.toString(conf.getWalBufferEntrySize())));
+ "wal_buffer_entry_size_in_byte", Integer.toString(CONF.getWalBufferEntrySize())));
if (walBufferEntrySize > 0) {
- conf.setWalBufferEntrySize(walBufferEntrySize);
+ CONF.setWalBufferEntrySize(walBufferEntrySize);
}
int walBufferQueueCapacity =
Integer.parseInt(
properties.getProperty(
- "wal_buffer_queue_capacity", Integer.toString(conf.getWalBufferQueueCapacity())));
+ "wal_buffer_queue_capacity", Integer.toString(CONF.getWalBufferQueueCapacity())));
if (walBufferQueueCapacity > 0) {
- conf.setWalBufferQueueCapacity(walBufferQueueCapacity);
+ CONF.setWalBufferQueueCapacity(walBufferQueueCapacity);
}
loadWALHotModifiedProps(properties);
@@ -1057,125 +960,75 @@ public class IoTDBDescriptor {
long fsyncWalDelayInMs =
Long.parseLong(
properties.getProperty(
- "fsync_wal_delay_in_ms", Long.toString(conf.getFsyncWalDelayInMs())));
+ "fsync_wal_delay_in_ms", Long.toString(CONF.getFsyncWalDelayInMs())));
if (fsyncWalDelayInMs > 0) {
- conf.setFsyncWalDelayInMs(fsyncWalDelayInMs);
+ CONF.setFsyncWalDelayInMs(fsyncWalDelayInMs);
}
long walFileSizeThreshold =
Long.parseLong(
properties.getProperty(
"wal_file_size_threshold_in_byte",
- Long.toString(conf.getWalFileSizeThresholdInByte())));
+ Long.toString(CONF.getWalFileSizeThresholdInByte())));
if (walFileSizeThreshold > 0) {
- conf.setWalFileSizeThresholdInByte(walFileSizeThreshold);
+ CONF.setWalFileSizeThresholdInByte(walFileSizeThreshold);
}
double walMinEffectiveInfoRatio =
Double.parseDouble(
properties.getProperty(
"wal_min_effective_info_ratio",
- Double.toString(conf.getWalMinEffectiveInfoRatio())));
+ Double.toString(CONF.getWalMinEffectiveInfoRatio())));
if (walMinEffectiveInfoRatio > 0) {
- conf.setWalMinEffectiveInfoRatio(walMinEffectiveInfoRatio);
+ CONF.setWalMinEffectiveInfoRatio(walMinEffectiveInfoRatio);
}
long walMemTableSnapshotThreshold =
Long.parseLong(
properties.getProperty(
"wal_memtable_snapshot_threshold_in_byte",
- Long.toString(conf.getWalMemTableSnapshotThreshold())));
+ Long.toString(CONF.getWalMemTableSnapshotThreshold())));
if (walMemTableSnapshotThreshold > 0) {
- conf.setWalMemTableSnapshotThreshold(walMemTableSnapshotThreshold);
+ CONF.setWalMemTableSnapshotThreshold(walMemTableSnapshotThreshold);
}
int maxWalMemTableSnapshotNum =
Integer.parseInt(
properties.getProperty(
"max_wal_memtable_snapshot_num",
- Integer.toString(conf.getMaxWalMemTableSnapshotNum())));
+ Integer.toString(CONF.getMaxWalMemTableSnapshotNum())));
if (maxWalMemTableSnapshotNum > 0) {
- conf.setMaxWalMemTableSnapshotNum(maxWalMemTableSnapshotNum);
+ CONF.setMaxWalMemTableSnapshotNum(maxWalMemTableSnapshotNum);
}
long deleteWalFilesPeriod =
Long.parseLong(
properties.getProperty(
"delete_wal_files_period_in_ms",
- Long.toString(conf.getDeleteWalFilesPeriodInMs())));
+ Long.toString(CONF.getDeleteWalFilesPeriodInMs())));
if (deleteWalFilesPeriod > 0) {
- conf.setDeleteWalFilesPeriodInMs(deleteWalFilesPeriod);
+ CONF.setDeleteWalFilesPeriodInMs(deleteWalFilesPeriod);
}
long throttleDownThresholdInByte =
Long.parseLong(
properties.getProperty(
"iot_consensus_throttle_threshold_in_byte",
- Long.toString(conf.getThrottleThreshold())));
+ Long.toString(CONF.getThrottleThreshold())));
if (throttleDownThresholdInByte > 0) {
- conf.setThrottleThreshold(throttleDownThresholdInByte);
+ CONF.setThrottleThreshold(throttleDownThresholdInByte);
}
long cacheWindowInMs =
Long.parseLong(
properties.getProperty(
"iot_consensus_cache_window_time_in_ms",
- Long.toString(conf.getCacheWindowTimeInMs())));
+ Long.toString(CONF.getCacheWindowTimeInMs())));
if (cacheWindowInMs > 0) {
- conf.setCacheWindowTimeInMs(cacheWindowInMs);
+ CONF.setCacheWindowTimeInMs(cacheWindowInMs);
}
}
- private void loadAutoCreateSchemaProps(Properties properties) {
- conf.setAutoCreateSchemaEnabled(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_auto_create_schema",
- Boolean.toString(conf.isAutoCreateSchemaEnabled()).trim())));
- conf.setBooleanStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "boolean_string_infer_type", conf.getBooleanStringInferType().toString())));
- conf.setIntegerStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "integer_string_infer_type", conf.getIntegerStringInferType().toString())));
- conf.setLongStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "long_string_infer_type", conf.getLongStringInferType().toString())));
- conf.setFloatingStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "floating_string_infer_type", conf.getFloatingStringInferType().toString())));
- conf.setNanStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "nan_string_infer_type", conf.getNanStringInferType().toString())));
- conf.setDefaultStorageGroupLevel(
- Integer.parseInt(
- properties.getProperty(
- "default_storage_group_level",
- Integer.toString(conf.getDefaultStorageGroupLevel()))));
- conf.setDefaultBooleanEncoding(
- properties.getProperty(
- "default_boolean_encoding", conf.getDefaultBooleanEncoding().toString()));
- conf.setDefaultInt32Encoding(
- properties.getProperty(
- "default_int32_encoding", conf.getDefaultInt32Encoding().toString()));
- conf.setDefaultInt64Encoding(
- properties.getProperty(
- "default_int64_encoding", conf.getDefaultInt64Encoding().toString()));
- conf.setDefaultFloatEncoding(
- properties.getProperty(
- "default_float_encoding", conf.getDefaultFloatEncoding().toString()));
- conf.setDefaultDoubleEncoding(
- properties.getProperty(
- "default_double_encoding", conf.getDefaultDoubleEncoding().toString()));
- conf.setDefaultTextEncoding(
- properties.getProperty("default_text_encoding", conf.getDefaultTextEncoding().toString()));
- }
-
private void loadTsFileProps(Properties properties) {
TSFileDescriptor.getInstance()
.getConfig()
@@ -1272,7 +1125,7 @@ public class IoTDBDescriptor {
(int)
Math.min(
TSFileDescriptor.getInstance().getConfig().getMaxTsBlockSizeInBytes(),
- conf.getMaxBytesPerFragmentInstance()));
+ CONF.getMaxBytesPerFragmentInstance()));
TSFileDescriptor.getInstance()
.getConfig()
@@ -1286,110 +1139,51 @@ public class IoTDBDescriptor {
// Mqtt related
private void loadMqttProps(Properties properties) {
- conf.setMqttDir(properties.getProperty("mqtt_root_dir", conf.getMqttDir()));
+ CONF.setMqttDir(properties.getProperty("mqtt_root_dir", CONF.getMqttDir()));
if (properties.getProperty(IoTDBConstant.MQTT_HOST_NAME) != null) {
- conf.setMqttHost(properties.getProperty(IoTDBConstant.MQTT_HOST_NAME));
+ CONF.setMqttHost(properties.getProperty(IoTDBConstant.MQTT_HOST_NAME));
}
if (properties.getProperty(IoTDBConstant.MQTT_PORT_NAME) != null) {
- conf.setMqttPort(Integer.parseInt(properties.getProperty(IoTDBConstant.MQTT_PORT_NAME)));
+ CONF.setMqttPort(Integer.parseInt(properties.getProperty(IoTDBConstant.MQTT_PORT_NAME)));
}
if (properties.getProperty(IoTDBConstant.MQTT_HANDLER_POOL_SIZE_NAME) != null) {
- conf.setMqttHandlerPoolSize(
+ CONF.setMqttHandlerPoolSize(
Integer.parseInt(properties.getProperty(IoTDBConstant.MQTT_HANDLER_POOL_SIZE_NAME)));
}
if (properties.getProperty(IoTDBConstant.MQTT_PAYLOAD_FORMATTER_NAME) != null) {
- conf.setMqttPayloadFormatter(
+ CONF.setMqttPayloadFormatter(
properties.getProperty(IoTDBConstant.MQTT_PAYLOAD_FORMATTER_NAME));
}
if (properties.getProperty(IoTDBConstant.ENABLE_MQTT) != null) {
- conf.setEnableMQTTService(
+ CONF.setEnableMQTTService(
Boolean.parseBoolean(properties.getProperty(IoTDBConstant.ENABLE_MQTT)));
}
if (properties.getProperty(IoTDBConstant.MQTT_MAX_MESSAGE_SIZE) != null) {
- conf.setMqttMaxMessageSize(
+ CONF.setMqttMaxMessageSize(
Integer.parseInt(properties.getProperty(IoTDBConstant.MQTT_MAX_MESSAGE_SIZE)));
}
}
- // timed flush memtable
- private void loadTimedService(Properties properties) {
- conf.setEnableTimedFlushSeqMemtable(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_timed_flush_seq_memtable",
- Boolean.toString(conf.isEnableTimedFlushSeqMemtable()))));
-
- long seqMemTableFlushInterval =
- Long.parseLong(
- properties
- .getProperty(
- "seq_memtable_flush_interval_in_ms",
- Long.toString(conf.getSeqMemtableFlushInterval()))
- .trim());
- if (seqMemTableFlushInterval > 0) {
- conf.setSeqMemtableFlushInterval(seqMemTableFlushInterval);
- }
-
- long seqMemTableFlushCheckInterval =
- Long.parseLong(
- properties
- .getProperty(
- "seq_memtable_flush_check_interval_in_ms",
- Long.toString(conf.getSeqMemtableFlushCheckInterval()))
- .trim());
- if (seqMemTableFlushCheckInterval > 0) {
- conf.setSeqMemtableFlushCheckInterval(seqMemTableFlushCheckInterval);
- }
-
- conf.setEnableTimedFlushUnseqMemtable(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_timed_flush_unseq_memtable",
- Boolean.toString(conf.isEnableTimedFlushUnseqMemtable()))));
-
- long unseqMemTableFlushInterval =
- Long.parseLong(
- properties
- .getProperty(
- "unseq_memtable_flush_interval_in_ms",
- Long.toString(conf.getUnseqMemtableFlushInterval()))
- .trim());
- if (unseqMemTableFlushInterval > 0) {
- conf.setUnseqMemtableFlushInterval(unseqMemTableFlushInterval);
- }
-
- long unseqMemTableFlushCheckInterval =
- Long.parseLong(
- properties
- .getProperty(
- "unseq_memtable_flush_check_interval_in_ms",
- Long.toString(conf.getUnseqMemtableFlushCheckInterval()))
- .trim());
- if (unseqMemTableFlushCheckInterval > 0) {
- conf.setUnseqMemtableFlushCheckInterval(unseqMemTableFlushCheckInterval);
- }
- }
-
public void loadHotModifiedProps(Properties properties) throws QueryProcessException {
try {
// update data dirs
String dataDirs = properties.getProperty("dn_data_dirs", null);
if (dataDirs != null) {
- conf.reloadDataDirs(dataDirs.split(","));
+ CONF.reloadDataDirs(dataDirs.split(","));
}
// update dir strategy, must update after data dirs
String multiDirStrategyClassName = properties.getProperty("dn_multi_dir_strategy", null);
if (multiDirStrategyClassName != null
- && !multiDirStrategyClassName.equals(conf.getMultiDirStrategyClassName())) {
- conf.setMultiDirStrategyClassName(multiDirStrategyClassName);
- conf.confirmMultiDirStrategy();
+ && !multiDirStrategyClassName.equals(CONF.getDnMultiDirStrategyClassName())) {
+ CONF.setDnMultiDirStrategyClassName(multiDirStrategyClassName);
+ CONF.confirmMultiDirStrategy();
DirectoryManager.getInstance().updateDirectoryStrategy();
}
@@ -1397,73 +1191,60 @@ public class IoTDBDescriptor {
loadTimedService(properties);
StorageEngine.getInstance().rebootTimedService();
- long memTableSizeThreshold =
- Long.parseLong(
- properties
- .getProperty(
- "memtable_size_threshold", Long.toString(conf.getMemtableSizeThreshold()))
- .trim());
- if (memTableSizeThreshold > 0) {
- conf.setMemtableSizeThreshold(memTableSizeThreshold);
- }
-
- // update params of creating schema automatically
- loadAutoCreateSchemaProps(properties);
-
// update tsfile-format config
loadTsFileProps(properties);
// update max_deduplicated_path_num
- conf.setMaxQueryDeduplicatedPathNum(
+ CONF.setMaxQueryDeduplicatedPathNum(
Integer.parseInt(
properties.getProperty(
"max_deduplicated_path_num",
- Integer.toString(conf.getMaxQueryDeduplicatedPathNum()))));
+ Integer.toString(CONF.getMaxQueryDeduplicatedPathNum()))));
// update frequency_interval_in_minute
- conf.setFrequencyIntervalInMinute(
+ CONF.setFrequencyIntervalInMinute(
Integer.parseInt(
properties.getProperty(
"frequency_interval_in_minute",
- Integer.toString(conf.getFrequencyIntervalInMinute()))));
+ Integer.toString(CONF.getFrequencyIntervalInMinute()))));
// update slow_query_threshold
- conf.setSlowQueryThreshold(
+ CONF.setSlowQueryThreshold(
Long.parseLong(
properties.getProperty(
- "slow_query_threshold", Long.toString(conf.getSlowQueryThreshold()))));
+ "slow_query_threshold", Long.toString(CONF.getSlowQueryThreshold()))));
// update merge_write_throughput_mb_per_sec
- conf.setCompactionWriteThroughputMbPerSec(
+ CONF.setCompactionWriteThroughputMbPerSec(
Integer.parseInt(
properties.getProperty(
"merge_write_throughput_mb_per_sec",
- Integer.toString(conf.getCompactionWriteThroughputMbPerSec()))));
+ Integer.toString(CONF.getCompactionWriteThroughputMbPerSec()))));
// update insert-tablet-plan's row limit for select-into
- conf.setSelectIntoInsertTabletPlanRowLimit(
+ CONF.setSelectIntoInsertTabletPlanRowLimit(
Integer.parseInt(
properties.getProperty(
"select_into_insert_tablet_plan_row_limit",
- String.valueOf(conf.getSelectIntoInsertTabletPlanRowLimit()))));
+ String.valueOf(CONF.getSelectIntoInsertTabletPlanRowLimit()))));
// update sync config
- conf.setMaxNumberOfSyncFileRetry(
+ CONF.setMaxNumberOfSyncFileRetry(
Integer.parseInt(
properties
.getProperty(
"max_number_of_sync_file_retry",
- Integer.toString(conf.getMaxNumberOfSyncFileRetry()))
+ Integer.toString(CONF.getMaxNumberOfSyncFileRetry()))
.trim()));
- conf.setIpWhiteList(properties.getProperty("ip_white_list", conf.getIpWhiteList()));
+ CONF.setIpWhiteList(properties.getProperty("ip_white_list", CONF.getIpWhiteList()));
// update enable query memory estimation for memory control
- conf.setEnableQueryMemoryEstimation(
+ CONF.setEnableQueryMemoryEstimation(
Boolean.parseBoolean(
properties.getProperty(
"enable_query_memory_estimation",
- Boolean.toString(conf.isEnableQueryMemoryEstimation()))));
+ Boolean.toString(CONF.isEnableQueryMemoryEstimation()))));
// update wal config
- long prevDeleteWalFilesPeriodInMs = conf.getDeleteWalFilesPeriodInMs();
+ long prevDeleteWalFilesPeriodInMs = CONF.getDeleteWalFilesPeriodInMs();
loadWALHotModifiedProps(properties);
- if (prevDeleteWalFilesPeriodInMs != conf.getDeleteWalFilesPeriodInMs()) {
+ if (prevDeleteWalFilesPeriodInMs != CONF.getDeleteWalFilesPeriodInMs()) {
WALManager.getInstance().rebootWALDeleteThread();
}
} catch (Exception e) {
@@ -1531,36 +1312,36 @@ public class IoTDBDescriptor {
}
long maxMemoryAvailable = Runtime.getRuntime().maxMemory();
if (proportionSum != 0) {
- conf.setAllocateMemoryForStorageEngine(
+ CONF.setAllocateMemoryForStorageEngine(
maxMemoryAvailable * Integer.parseInt(proportions[0].trim()) / proportionSum);
- conf.setAllocateMemoryForRead(
+ CONF.setAllocateMemoryForRead(
maxMemoryAvailable * Integer.parseInt(proportions[1].trim()) / proportionSum);
- conf.setAllocateMemoryForSchema(
+ CONF.setAllocateMemoryForSchema(
maxMemoryAvailable * Integer.parseInt(proportions[2].trim()) / proportionSum);
- conf.setAllocateMemoryForConsensus(
+ CONF.setAllocateMemoryForConsensus(
maxMemoryAvailable * Integer.parseInt(proportions[3].trim()) / proportionSum);
}
}
- logger.info("initial allocateMemoryForRead = {}", conf.getAllocateMemoryForRead());
- logger.info("initial allocateMemoryForWrite = {}", conf.getAllocateMemoryForStorageEngine());
- logger.info("initial allocateMemoryForSchema = {}", conf.getAllocateMemoryForSchema());
- logger.info("initial allocateMemoryForConsensus = {}", conf.getAllocateMemoryForConsensus());
+ logger.info("initial allocateMemoryForRead = {}", CONF.getAllocateMemoryForRead());
+ logger.info("initial allocateMemoryForWrite = {}", CONF.getAllocateMemoryForStorageEngine());
+ logger.info("initial allocateMemoryForSchema = {}", CONF.getAllocateMemoryForSchema());
+ logger.info("initial allocateMemoryForConsensus = {}", CONF.getAllocateMemoryForConsensus());
initSchemaMemoryAllocate(properties);
initStorageEngineAllocate(properties);
- conf.setMaxQueryDeduplicatedPathNum(
+ CONF.setMaxQueryDeduplicatedPathNum(
Integer.parseInt(
properties.getProperty(
"max_deduplicated_path_num",
- Integer.toString(conf.getMaxQueryDeduplicatedPathNum()))));
+ Integer.toString(CONF.getMaxQueryDeduplicatedPathNum()))));
- conf.setEnableQueryMemoryEstimation(
+ CONF.setEnableQueryMemoryEstimation(
Boolean.parseBoolean(
properties.getProperty(
"enable_query_memory_estimation",
- Boolean.toString(conf.isEnableQueryMemoryEstimation()))));
+ Boolean.toString(CONF.isEnableQueryMemoryEstimation()))));
String queryMemoryAllocateProportion =
properties.getProperty("chunk_timeseriesmeta_free_memory_proportion");
@@ -1570,22 +1351,22 @@ public class IoTDBDescriptor {
for (String proportion : proportions) {
proportionSum += Integer.parseInt(proportion.trim());
}
- long maxMemoryAvailable = conf.getAllocateMemoryForRead();
+ long maxMemoryAvailable = CONF.getAllocateMemoryForRead();
if (proportionSum != 0) {
try {
- conf.setAllocateMemoryForBloomFilterCache(
+ CONF.setAllocateMemoryForBloomFilterCache(
maxMemoryAvailable * Integer.parseInt(proportions[0].trim()) / proportionSum);
- conf.setAllocateMemoryForChunkCache(
+ CONF.setAllocateMemoryForChunkCache(
maxMemoryAvailable * Integer.parseInt(proportions[1].trim()) / proportionSum);
- conf.setAllocateMemoryForTimeSeriesMetaDataCache(
+ CONF.setAllocateMemoryForTimeSeriesMetaDataCache(
maxMemoryAvailable * Integer.parseInt(proportions[2].trim()) / proportionSum);
- conf.setAllocateMemoryForCoordinator(
+ CONF.setAllocateMemoryForCoordinator(
maxMemoryAvailable * Integer.parseInt(proportions[3].trim()) / proportionSum);
- conf.setAllocateMemoryForOperators(
+ CONF.setAllocateMemoryForOperators(
maxMemoryAvailable * Integer.parseInt(proportions[4].trim()) / proportionSum);
- conf.setAllocateMemoryForDataExchange(
+ CONF.setAllocateMemoryForDataExchange(
maxMemoryAvailable * Integer.parseInt(proportions[5].trim()) / proportionSum);
- conf.setAllocateMemoryForTimeIndex(
+ CONF.setAllocateMemoryForTimeIndex(
maxMemoryAvailable * Integer.parseInt(proportions[6].trim()) / proportionSum);
} catch (Exception e) {
throw new RuntimeException(
@@ -1597,19 +1378,19 @@ public class IoTDBDescriptor {
}
// metadata cache is disabled, we need to move all their allocated memory to other parts
- if (!conf.isMetaDataCacheEnable()) {
+ if (!CONF.isMetaDataCacheEnable()) {
long sum =
- conf.getAllocateMemoryForBloomFilterCache()
- + conf.getAllocateMemoryForChunkCache()
- + conf.getAllocateMemoryForTimeSeriesMetaDataCache();
- conf.setAllocateMemoryForBloomFilterCache(0);
- conf.setAllocateMemoryForChunkCache(0);
- conf.setAllocateMemoryForTimeSeriesMetaDataCache(0);
+ CONF.getAllocateMemoryForBloomFilterCache()
+ + CONF.getAllocateMemoryForChunkCache()
+ + CONF.getAllocateMemoryForTimeSeriesMetaDataCache();
+ CONF.setAllocateMemoryForBloomFilterCache(0);
+ CONF.setAllocateMemoryForChunkCache(0);
+ CONF.setAllocateMemoryForTimeSeriesMetaDataCache(0);
long partForDataExchange = sum / 2;
long partForOperators = sum - partForDataExchange;
- conf.setAllocateMemoryForDataExchange(
- conf.getAllocateMemoryForDataExchange() + partForDataExchange);
- conf.setAllocateMemoryForOperators(conf.getAllocateMemoryForOperators() + partForOperators);
+ CONF.setAllocateMemoryForDataExchange(
+ CONF.getAllocateMemoryForDataExchange() + partForDataExchange);
+ CONF.setAllocateMemoryForOperators(CONF.getAllocateMemoryForOperators() + partForOperators);
}
}
@@ -1634,20 +1415,20 @@ public class IoTDBDescriptor {
double timePartitionInfoForWrite =
((double) (proportionForTimePartitionInfo)
/ (double) (proportionForMemTable + proportionForTimePartitionInfo));
- conf.setWriteProportionForMemtable(writeProportion * memtableProportionForWrite);
+ CONF.setWriteProportionForMemtable(writeProportion * memtableProportionForWrite);
- conf.setAllocateMemoryForTimePartitionInfo(
+ CONF.setAllocateMemoryForTimePartitionInfo(
(long)
((writeProportion * timePartitionInfoForWrite)
- * conf.getAllocateMemoryForStorageEngine()));
+ * CONF.getAllocateMemoryForStorageEngine()));
- conf.setCompactionProportion(
+ CONF.setCompactionProportion(
((double) (proportionForCompaction)
/ (double) (proportionForCompaction + proportionForWrite)));
}
private void initSchemaMemoryAllocate(Properties properties) {
- long schemaMemoryTotal = conf.getAllocateMemoryForSchema();
+ long schemaMemoryTotal = CONF.getAllocateMemoryForSchema();
int proportionSum = 10;
int schemaRegionProportion = 8;
@@ -1658,7 +1439,7 @@ public class IoTDBDescriptor {
String schemaMemoryAllocatePortion =
properties.getProperty("schema_memory_allocate_proportion");
if (schemaMemoryAllocatePortion != null) {
- conf.setDefaultSchemaMemoryConfig(false);
+ CONF.setDefaultSchemaMemoryConfig(false);
String[] proportions = schemaMemoryAllocatePortion.split(":");
int loadedProportionSum = 0;
for (String proportion : proportions) {
@@ -1673,22 +1454,22 @@ public class IoTDBDescriptor {
lastCacheProportion = Integer.parseInt(proportions[3].trim());
}
} else {
- conf.setDefaultSchemaMemoryConfig(true);
+ CONF.setDefaultSchemaMemoryConfig(true);
}
- conf.setAllocateMemoryForSchemaRegion(
+ CONF.setAllocateMemoryForSchemaRegion(
schemaMemoryTotal * schemaRegionProportion / proportionSum);
- logger.info("allocateMemoryForSchemaRegion = {}", conf.getAllocateMemoryForSchemaRegion());
+ logger.info("allocateMemoryForSchemaRegion = {}", CONF.getAllocateMemoryForSchemaRegion());
- conf.setAllocateMemoryForSchemaCache(schemaMemoryTotal * schemaCacheProportion / proportionSum);
- logger.info("allocateMemoryForSchemaCache = {}", conf.getAllocateMemoryForSchemaCache());
+ CONF.setAllocateMemoryForSchemaCache(schemaMemoryTotal * schemaCacheProportion / proportionSum);
+ logger.info("allocateMemoryForSchemaCache = {}", CONF.getAllocateMemoryForSchemaCache());
- conf.setAllocateMemoryForPartitionCache(
+ CONF.setAllocateMemoryForPartitionCache(
schemaMemoryTotal * partitionCacheProportion / proportionSum);
- logger.info("allocateMemoryForPartitionCache = {}", conf.getAllocateMemoryForPartitionCache());
+ logger.info("allocateMemoryForPartitionCache = {}", CONF.getAllocateMemoryForPartitionCache());
- conf.setAllocateMemoryForLastCache(schemaMemoryTotal * lastCacheProportion / proportionSum);
- logger.info("allocateMemoryForLastCache = {}", conf.getAllocateMemoryForLastCache());
+ CONF.setAllocateMemoryForLastCache(schemaMemoryTotal * lastCacheProportion / proportionSum);
+ logger.info("allocateMemoryForLastCache = {}", CONF.getAllocateMemoryForLastCache());
}
@SuppressWarnings("squid:S3518") // "proportionSum" can't be zero
@@ -1696,22 +1477,22 @@ public class IoTDBDescriptor {
String initialByteArrayLengthForMemoryControl =
properties.getProperty("udf_initial_byte_array_length_for_memory_control");
if (initialByteArrayLengthForMemoryControl != null) {
- conf.setUdfInitialByteArrayLengthForMemoryControl(
+ CONF.setUdfInitialByteArrayLengthForMemoryControl(
Integer.parseInt(initialByteArrayLengthForMemoryControl));
}
- conf.setUdfDir(properties.getProperty("udf_lib_dir", conf.getUdfDir()));
+ CONF.setUdfDir(properties.getProperty("udf_lib_dir", CONF.getUdfDir()));
String memoryBudgetInMb = properties.getProperty("udf_memory_budget_in_mb");
if (memoryBudgetInMb != null) {
- conf.setUdfMemoryBudgetInMB(
+ CONF.setUdfMemoryBudgetInMB(
(float)
- Math.min(Float.parseFloat(memoryBudgetInMb), 0.2 * conf.getAllocateMemoryForRead()));
+ Math.min(Float.parseFloat(memoryBudgetInMb), 0.2 * CONF.getAllocateMemoryForRead()));
}
String groupByFillCacheSizeInMB = properties.getProperty("group_by_fill_cache_size_in_mb");
if (groupByFillCacheSizeInMB != null) {
- conf.setGroupByFillCacheSizeInMB(Float.parseFloat(groupByFillCacheSizeInMB));
+ CONF.setGroupByFillCacheSizeInMB(Float.parseFloat(groupByFillCacheSizeInMB));
}
String readerTransformerCollectorMemoryProportion =
@@ -1722,13 +1503,13 @@ public class IoTDBDescriptor {
for (String proportion : proportions) {
proportionSum += Integer.parseInt(proportion.trim());
}
- float maxMemoryAvailable = conf.getUdfMemoryBudgetInMB();
+ float maxMemoryAvailable = CONF.getUdfMemoryBudgetInMB();
try {
- conf.setUdfReaderMemoryBudgetInMB(
+ CONF.setUdfReaderMemoryBudgetInMB(
maxMemoryAvailable * Integer.parseInt(proportions[0].trim()) / proportionSum);
- conf.setUdfTransformerMemoryBudgetInMB(
+ CONF.setUdfTransformerMemoryBudgetInMB(
maxMemoryAvailable * Integer.parseInt(proportions[1].trim()) / proportionSum);
- conf.setUdfCollectorMemoryBudgetInMB(
+ CONF.setUdfCollectorMemoryBudgetInMB(
maxMemoryAvailable * Integer.parseInt(proportions[2].trim()) / proportionSum);
} catch (Exception e) {
throw new RuntimeException(
@@ -1740,234 +1521,229 @@ public class IoTDBDescriptor {
}
private void loadTriggerProps(Properties properties) {
- conf.setTriggerDir(properties.getProperty("trigger_lib_dir", conf.getTriggerDir()));
- conf.setRetryNumToFindStatefulTrigger(
+ CONF.setTriggerDir(properties.getProperty("trigger_lib_dir", CONF.getTriggerDir()));
+ CONF.setRetryNumToFindStatefulTrigger(
Integer.parseInt(
properties.getProperty(
"stateful_trigger_retry_num_when_not_found",
- Integer.toString(conf.getRetryNumToFindStatefulTrigger()))));
+ Integer.toString(CONF.getRetryNumToFindStatefulTrigger()))));
int tlogBufferSize =
Integer.parseInt(
- properties.getProperty("tlog_buffer_size", Integer.toString(conf.getTlogBufferSize())));
+ properties.getProperty("tlog_buffer_size", Integer.toString(CONF.getTlogBufferSize())));
if (tlogBufferSize > 0) {
- conf.setTlogBufferSize(tlogBufferSize);
+ CONF.setTlogBufferSize(tlogBufferSize);
}
- conf.setTriggerForwardMaxQueueNumber(
+ CONF.setTriggerForwardMaxQueueNumber(
Integer.parseInt(
properties.getProperty(
"trigger_forward_max_queue_number",
- Integer.toString(conf.getTriggerForwardMaxQueueNumber()))));
- conf.setTriggerForwardMaxSizePerQueue(
+ Integer.toString(CONF.getTriggerForwardMaxQueueNumber()))));
+ CONF.setTriggerForwardMaxSizePerQueue(
Integer.parseInt(
properties.getProperty(
"trigger_forward_max_size_per_queue",
- Integer.toString(conf.getTriggerForwardMaxSizePerQueue()))));
- conf.setTriggerForwardBatchSize(
+ Integer.toString(CONF.getTriggerForwardMaxSizePerQueue()))));
+ CONF.setTriggerForwardBatchSize(
Integer.parseInt(
properties.getProperty(
"trigger_forward_batch_size",
- Integer.toString(conf.getTriggerForwardBatchSize()))));
- conf.setTriggerForwardHTTPPoolSize(
+ Integer.toString(CONF.getTriggerForwardBatchSize()))));
+ CONF.setTriggerForwardHTTPPoolSize(
Integer.parseInt(
properties.getProperty(
"trigger_forward_http_pool_size",
- Integer.toString(conf.getTriggerForwardHTTPPoolSize()))));
- conf.setTriggerForwardHTTPPOOLMaxPerRoute(
+ Integer.toString(CONF.getTriggerForwardHTTPPoolSize()))));
+ CONF.setTriggerForwardHTTPPOOLMaxPerRoute(
Integer.parseInt(
properties.getProperty(
"trigger_forward_http_pool_max_per_route",
- Integer.toString(conf.getTriggerForwardHTTPPOOLMaxPerRoute()))));
- conf.setTriggerForwardMQTTPoolSize(
+ Integer.toString(CONF.getTriggerForwardHTTPPOOLMaxPerRoute()))));
+ CONF.setTriggerForwardMQTTPoolSize(
Integer.parseInt(
properties.getProperty(
"trigger_forward_mqtt_pool_size",
- Integer.toString(conf.getTriggerForwardMQTTPoolSize()))));
+ Integer.toString(CONF.getTriggerForwardMQTTPoolSize()))));
}
private void loadCQProps(Properties properties) {
- conf.setContinuousQueryThreadNum(
+ CONF.setContinuousQueryThreadNum(
Integer.parseInt(
properties.getProperty(
"continuous_query_thread_num",
- Integer.toString(conf.getContinuousQueryThreadNum()))));
- if (conf.getContinuousQueryThreadNum() <= 0) {
- conf.setContinuousQueryThreadNum(Runtime.getRuntime().availableProcessors() / 2);
+ Integer.toString(CONF.getContinuousQueryThreadNum()))));
+ if (CONF.getContinuousQueryThreadNum() <= 0) {
+ CONF.setContinuousQueryThreadNum(Runtime.getRuntime().availableProcessors() / 2);
}
- conf.setContinuousQueryMinimumEveryInterval(
+ CONF.setContinuousQueryMinimumEveryInterval(
DateTimeUtils.convertDurationStrToLong(
properties.getProperty("continuous_query_minimum_every_interval", "1s"),
- conf.getTimestampPrecision()));
+ CONF.getTimestampPrecision()));
}
public void loadClusterProps(Properties properties) {
String configNodeUrls = properties.getProperty(IoTDBConstant.DN_TARGET_CONFIG_NODE_LIST);
if (configNodeUrls != null) {
try {
- conf.setTargetConfigNodeList(NodeUrlUtils.parseTEndPointUrls(configNodeUrls));
+ CONF.setDnTargetConfigNodeList(NodeUrlUtils.parseTEndPointUrls(configNodeUrls));
} catch (BadNodeUrlException e) {
logger.error(
"Config nodes are set in wrong format, please set them like 127.0.0.1:10710,127.0.0.1:10712");
}
}
- conf.setInternalAddress(
- properties.getProperty(IoTDBConstant.DN_INTERNAL_ADDRESS, conf.getInternalAddress()));
+ CONF.setDnInternalAddress(
+ properties.getProperty(IoTDBConstant.DN_INTERNAL_ADDRESS, CONF.getDnInternalAddress()));
- conf.setInternalPort(
+ CONF.setDnInternalPort(
Integer.parseInt(
properties.getProperty(
- IoTDBConstant.DN_INTERNAL_PORT, Integer.toString(conf.getInternalPort()))));
+ IoTDBConstant.DN_INTERNAL_PORT, Integer.toString(CONF.getDnInternalPort()))));
- conf.setDataRegionConsensusPort(
+ CONF.setDnDataRegionConsensusPort(
Integer.parseInt(
properties.getProperty(
"dn_data_region_consensus_port",
- Integer.toString(conf.getDataRegionConsensusPort()))));
+ Integer.toString(CONF.getDnDataRegionConsensusPort()))));
- conf.setSchemaRegionConsensusPort(
+ CONF.setDnSchemaRegionConsensusPort(
Integer.parseInt(
properties.getProperty(
"dn_schema_region_consensus_port",
- Integer.toString(conf.getSchemaRegionConsensusPort()))));
- conf.setJoinClusterRetryIntervalMs(
+ Integer.toString(CONF.getDnSchemaRegionConsensusPort()))));
+ CONF.setDnJoinClusterRetryIntervalMs(
Long.parseLong(
properties.getProperty(
"dn_join_cluster_retry_interval_ms",
- Long.toString(conf.getJoinClusterRetryIntervalMs()))));
+ Long.toString(CONF.getDnJoinClusterRetryIntervalMs()))));
}
public void loadShuffleProps(Properties properties) {
- conf.setMppDataExchangePort(
+ CONF.setDnMppDataExchangePort(
Integer.parseInt(
properties.getProperty(
- "dn_mpp_data_exchange_port", Integer.toString(conf.getMppDataExchangePort()))));
- conf.setMppDataExchangeCorePoolSize(
+ "dn_mpp_data_exchange_port", Integer.toString(CONF.getDnMppDataExchangePort()))));
+ CONF.setMppDataExchangeCorePoolSize(
Integer.parseInt(
properties.getProperty(
"mpp_data_exchange_core_pool_size",
- Integer.toString(conf.getMppDataExchangeCorePoolSize()))));
- conf.setMppDataExchangeMaxPoolSize(
+ Integer.toString(CONF.getMppDataExchangeCorePoolSize()))));
+ CONF.setMppDataExchangeMaxPoolSize(
Integer.parseInt(
properties.getProperty(
"mpp_data_exchange_max_pool_size",
- Integer.toString(conf.getMppDataExchangeMaxPoolSize()))));
- conf.setMppDataExchangeKeepAliveTimeInMs(
+ Integer.toString(CONF.getMppDataExchangeMaxPoolSize()))));
+ CONF.setMppDataExchangeKeepAliveTimeInMs(
Integer.parseInt(
properties.getProperty(
"mpp_data_exchange_keep_alive_time_in_ms",
- Integer.toString(conf.getMppDataExchangeKeepAliveTimeInMs()))));
-
- conf.setPartitionCacheSize(
- Integer.parseInt(
- properties.getProperty(
- "partition_cache_size", Integer.toString(conf.getPartitionCacheSize()))));
+ Integer.toString(CONF.getMppDataExchangeKeepAliveTimeInMs()))));
- conf.setDriverTaskExecutionTimeSliceInMs(
+ CONF.setDriverTaskExecutionTimeSliceInMs(
Integer.parseInt(
properties.getProperty(
"driver_task_execution_time_slice_in_ms",
- Integer.toString(conf.getDriverTaskExecutionTimeSliceInMs()))));
+ Integer.toString(CONF.getDriverTaskExecutionTimeSliceInMs()))));
}
/** Get default encode algorithm by data type */
public TSEncoding getDefaultEncodingByType(TSDataType dataType) {
switch (dataType) {
case BOOLEAN:
- return conf.getDefaultBooleanEncoding();
+ return CONF.getDefaultBooleanEncoding();
case INT32:
- return conf.getDefaultInt32Encoding();
+ return CONF.getDefaultInt32Encoding();
case INT64:
- return conf.getDefaultInt64Encoding();
+ return CONF.getDefaultInt64Encoding();
case FLOAT:
- return conf.getDefaultFloatEncoding();
+ return CONF.getDefaultFloatEncoding();
case DOUBLE:
- return conf.getDefaultDoubleEncoding();
+ return CONF.getDefaultDoubleEncoding();
default:
- return conf.getDefaultTextEncoding();
+ return CONF.getDefaultTextEncoding();
}
}
// These configurations are received from config node when registering
public void loadGlobalConfig(TGlobalConfig globalConfig) {
- conf.setSeriesPartitionExecutorClass(globalConfig.getSeriesPartitionExecutorClass());
- conf.setSeriesPartitionSlotNum(globalConfig.getSeriesPartitionSlotNum());
- conf.setTimePartitionInterval(
+ CONF.setSeriesPartitionExecutorClass(globalConfig.getSeriesPartitionExecutorClass());
+ CONF.setSeriesPartitionSlotNum(globalConfig.getSeriesPartitionSlotNum());
+ CONF.setTimePartitionInterval(
DateTimeUtils.convertMilliTimeWithPrecision(
- globalConfig.timePartitionInterval, conf.getTimestampPrecision()));
- conf.setReadConsistencyLevel(globalConfig.getReadConsistencyLevel());
+ globalConfig.timePartitionInterval, CONF.getTimestampPrecision()));
+ CONF.setReadConsistencyLevel(globalConfig.getReadConsistencyLevel());
}
public void loadRatisConfig(TRatisConfig ratisConfig) {
- conf.setDataRatisConsensusLogAppenderBufferSizeMax(ratisConfig.getDataAppenderBufferSize());
- conf.setSchemaRatisConsensusLogAppenderBufferSizeMax(ratisConfig.getSchemaAppenderBufferSize());
+ CONF.setDataRatisConsensusLogAppenderBufferSizeMax(ratisConfig.getDataAppenderBufferSize());
+ CONF.setSchemaRatisConsensusLogAppenderBufferSizeMax(ratisConfig.getSchemaAppenderBufferSize());
- conf.setDataRatisConsensusSnapshotTriggerThreshold(
+ CONF.setDataRatisConsensusSnapshotTriggerThreshold(
ratisConfig.getDataSnapshotTriggerThreshold());
- conf.setSchemaRatisConsensusSnapshotTriggerThreshold(
+ CONF.setSchemaRatisConsensusSnapshotTriggerThreshold(
ratisConfig.getSchemaSnapshotTriggerThreshold());
- conf.setDataRatisConsensusLogUnsafeFlushEnable(ratisConfig.isDataLogUnsafeFlushEnable());
- conf.setSchemaRatisConsensusLogUnsafeFlushEnable(ratisConfig.isSchemaLogUnsafeFlushEnable());
+ CONF.setDataRatisConsensusLogUnsafeFlushEnable(ratisConfig.isDataLogUnsafeFlushEnable());
+ CONF.setSchemaRatisConsensusLogUnsafeFlushEnable(ratisConfig.isSchemaLogUnsafeFlushEnable());
- conf.setDataRatisConsensusLogSegmentSizeMax(ratisConfig.getDataLogSegmentSizeMax());
- conf.setSchemaRatisConsensusLogSegmentSizeMax(ratisConfig.getSchemaLogSegmentSizeMax());
+ CONF.setDataRatisConsensusLogSegmentSizeMax(ratisConfig.getDataLogSegmentSizeMax());
+ CONF.setSchemaRatisConsensusLogSegmentSizeMax(ratisConfig.getSchemaLogSegmentSizeMax());
- conf.setDataRatisConsensusGrpcFlowControlWindow(ratisConfig.getDataGrpcFlowControlWindow());
- conf.setSchemaRatisConsensusGrpcFlowControlWindow(ratisConfig.getSchemaGrpcFlowControlWindow());
+ CONF.setDataRatisConsensusGrpcFlowControlWindow(ratisConfig.getDataGrpcFlowControlWindow());
+ CONF.setSchemaRatisConsensusGrpcFlowControlWindow(ratisConfig.getSchemaGrpcFlowControlWindow());
- conf.setDataRatisConsensusLeaderElectionTimeoutMinMs(
+ CONF.setDataRatisConsensusLeaderElectionTimeoutMinMs(
ratisConfig.getDataLeaderElectionTimeoutMin());
- conf.setSchemaRatisConsensusLeaderElectionTimeoutMinMs(
+ CONF.setSchemaRatisConsensusLeaderElectionTimeoutMinMs(
ratisConfig.getSchemaLeaderElectionTimeoutMin());
- conf.setDataRatisConsensusLeaderElectionTimeoutMaxMs(
+ CONF.setDataRatisConsensusLeaderElectionTimeoutMaxMs(
ratisConfig.getDataLeaderElectionTimeoutMax());
- conf.setSchemaRatisConsensusLeaderElectionTimeoutMaxMs(
+ CONF.setSchemaRatisConsensusLeaderElectionTimeoutMaxMs(
ratisConfig.getSchemaLeaderElectionTimeoutMax());
- conf.setDataRatisConsensusRequestTimeoutMs(ratisConfig.getDataRequestTimeout());
- conf.setSchemaRatisConsensusRequestTimeoutMs(ratisConfig.getSchemaRequestTimeout());
+ CONF.setDataRatisConsensusRequestTimeoutMs(ratisConfig.getDataRequestTimeout());
+ CONF.setSchemaRatisConsensusRequestTimeoutMs(ratisConfig.getSchemaRequestTimeout());
- conf.setDataRatisConsensusMaxRetryAttempts(ratisConfig.getDataMaxRetryAttempts());
- conf.setDataRatisConsensusInitialSleepTimeMs(ratisConfig.getDataInitialSleepTime());
- conf.setDataRatisConsensusMaxSleepTimeMs(ratisConfig.getDataMaxSleepTime());
+ CONF.setDataRatisConsensusMaxRetryAttempts(ratisConfig.getDataMaxRetryAttempts());
+ CONF.setDataRatisConsensusInitialSleepTimeMs(ratisConfig.getDataInitialSleepTime());
+ CONF.setDataRatisConsensusMaxSleepTimeMs(ratisConfig.getDataMaxSleepTime());
- conf.setSchemaRatisConsensusMaxRetryAttempts(ratisConfig.getSchemaMaxRetryAttempts());
- conf.setSchemaRatisConsensusInitialSleepTimeMs(ratisConfig.getSchemaInitialSleepTime());
- conf.setSchemaRatisConsensusMaxSleepTimeMs(ratisConfig.getSchemaMaxSleepTime());
+ CONF.setSchemaRatisConsensusMaxRetryAttempts(ratisConfig.getSchemaMaxRetryAttempts());
+ CONF.setSchemaRatisConsensusInitialSleepTimeMs(ratisConfig.getSchemaInitialSleepTime());
+ CONF.setSchemaRatisConsensusMaxSleepTimeMs(ratisConfig.getSchemaMaxSleepTime());
- conf.setDataRatisConsensusPreserveWhenPurge(ratisConfig.getDataPreserveWhenPurge());
- conf.setSchemaRatisConsensusPreserveWhenPurge(ratisConfig.getSchemaPreserveWhenPurge());
+ CONF.setDataRatisConsensusPreserveWhenPurge(ratisConfig.getDataPreserveWhenPurge());
+ CONF.setSchemaRatisConsensusPreserveWhenPurge(ratisConfig.getSchemaPreserveWhenPurge());
- conf.setRatisFirstElectionTimeoutMinMs(ratisConfig.getFirstElectionTimeoutMin());
- conf.setRatisFirstElectionTimeoutMaxMs(ratisConfig.getFirstElectionTimeoutMax());
+ CONF.setRatisFirstElectionTimeoutMinMs(ratisConfig.getFirstElectionTimeoutMin());
+ CONF.setRatisFirstElectionTimeoutMaxMs(ratisConfig.getFirstElectionTimeoutMax());
- conf.setSchemaRatisLogMax(ratisConfig.getSchemaRegionRatisLogMax());
- conf.setDataRatisLogMax(ratisConfig.getDataRegionRatisLogMax());
+ CONF.setSchemaRatisLogMax(ratisConfig.getSchemaRegionRatisLogMax());
+ CONF.setDataRatisLogMax(ratisConfig.getDataRegionRatisLogMax());
}
public void loadCQConfig(TCQConfig cqConfig) {
- conf.setCqMinEveryIntervalInMs(cqConfig.getCqMinEveryIntervalInMs());
+ CONF.setCqMinEveryIntervalInMs(cqConfig.getCqMinEveryIntervalInMs());
}
public void reclaimConsensusMemory() {
- conf.setAllocateMemoryForStorageEngine(
- conf.getAllocateMemoryForStorageEngine() + conf.getAllocateMemoryForConsensus());
+ CONF.setAllocateMemoryForStorageEngine(
+ CONF.getAllocateMemoryForStorageEngine() + CONF.getAllocateMemoryForConsensus());
SystemInfo.getInstance().allocateWriteMemory();
}
public void initClusterSchemaMemoryAllocate() {
- if (!conf.isDefaultSchemaMemoryConfig()) {
+ if (!CONF.isDefaultSchemaMemoryConfig()) {
// the config has already been updated as user config in properties file
return;
}
// process the default schema memory allocate
- long schemaMemoryTotal = conf.getAllocateMemoryForSchema();
+ long schemaMemoryTotal = CONF.getAllocateMemoryForSchema();
int proportionSum = 10;
int schemaRegionProportion = 5;
@@ -1975,22 +1751,22 @@ public class IoTDBDescriptor {
int partitionCacheProportion = 1;
int lastCacheProportion = 1;
- conf.setAllocateMemoryForSchemaRegion(
+ CONF.setAllocateMemoryForSchemaRegion(
schemaMemoryTotal * schemaRegionProportion / proportionSum);
logger.info(
- "Cluster allocateMemoryForSchemaRegion = {}", conf.getAllocateMemoryForSchemaRegion());
+ "Cluster allocateMemoryForSchemaRegion = {}", CONF.getAllocateMemoryForSchemaRegion());
- conf.setAllocateMemoryForSchemaCache(schemaMemoryTotal * schemaCacheProportion / proportionSum);
+ CONF.setAllocateMemoryForSchemaCache(schemaMemoryTotal * schemaCacheProportion / proportionSum);
logger.info(
- "Cluster allocateMemoryForSchemaCache = {}", conf.getAllocateMemoryForSchemaCache());
+ "Cluster allocateMemoryForSchemaCache = {}", CONF.getAllocateMemoryForSchemaCache());
- conf.setAllocateMemoryForPartitionCache(
+ CONF.setAllocateMemoryForPartitionCache(
schemaMemoryTotal * partitionCacheProportion / proportionSum);
logger.info(
- "Cluster allocateMemoryForPartitionCache = {}", conf.getAllocateMemoryForPartitionCache());
+ "Cluster allocateMemoryForPartitionCache = {}", CONF.getAllocateMemoryForPartitionCache());
- conf.setAllocateMemoryForLastCache(schemaMemoryTotal * lastCacheProportion / proportionSum);
- logger.info("Cluster allocateMemoryForLastCache = {}", conf.getAllocateMemoryForLastCache());
+ CONF.setAllocateMemoryForLastCache(schemaMemoryTotal * lastCacheProportion / proportionSum);
+ logger.info("Cluster allocateMemoryForLastCache = {}", CONF.getAllocateMemoryForLastCache());
}
private static class IoTDBDescriptorHolder {
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBStartCheck.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBStartCheck.java
index 48b4e30f6f..e523ab8936 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBStartCheck.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBStartCheck.java
@@ -120,16 +120,17 @@ public class IoTDBStartCheck {
static {
variableParamValueTable.put(
- INTERNAL_ADDRESS, () -> String.valueOf(config.getInternalAddress()));
- variableParamValueTable.put(INTERNAL_PORT, () -> String.valueOf(config.getInternalPort()));
- variableParamValueTable.put(RPC_ADDRESS, () -> String.valueOf(config.getRpcAddress()));
- variableParamValueTable.put(RPC_PORT, () -> String.valueOf(config.getRpcPort()));
+ INTERNAL_ADDRESS, () -> String.valueOf(config.getDnInternalAddress()));
+ variableParamValueTable.put(INTERNAL_PORT, () -> String.valueOf(config.getDnInternalPort()));
+ variableParamValueTable.put(RPC_ADDRESS, () -> String.valueOf(config.getDnRpcAddress()));
+ variableParamValueTable.put(RPC_PORT, () -> String.valueOf(config.getDnRpcPort()));
variableParamValueTable.put(
- MPP_DATA_EXCHANGE_PORT, () -> String.valueOf(config.getMppDataExchangePort()));
+ MPP_DATA_EXCHANGE_PORT, () -> String.valueOf(config.getDnMppDataExchangePort()));
variableParamValueTable.put(
- SCHEMA_REGION_CONSENSUS_PORT, () -> String.valueOf(config.getSchemaRegionConsensusPort()));
+ SCHEMA_REGION_CONSENSUS_PORT,
+ () -> String.valueOf(config.getDnSchemaRegionConsensusPort()));
variableParamValueTable.put(
- DATA_REGION_CONSENSUS_PORT, () -> String.valueOf(config.getDataRegionConsensusPort()));
+ DATA_REGION_CONSENSUS_PORT, () -> String.valueOf(config.getDnDataRegionConsensusPort()));
}
// endregion
// region params don't need checking, determined by the system
@@ -254,18 +255,18 @@ public class IoTDBStartCheck {
*/
public void checkDirectory() throws ConfigurationException, IOException {
// check data dirs
- for (String dataDir : config.getDataDirs()) {
+ for (String dataDir : config.getDnDataDirs()) {
DirectoryChecker.getInstance().registerDirectory(new File(dataDir));
}
if (config.isClusterMode()
&& config.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.RATIS_CONSENSUS)) {
- if (DirectoryChecker.getInstance().isCrossDisk(config.getDataDirs())) {
+ if (DirectoryChecker.getInstance().isCrossDisk(config.getDnDataDirs())) {
throw new ConfigurationException(
"Configuring the data directories as cross-disk directories is not supported under RatisConsensus(it will be supported in a later version).");
}
}
// check system dir
- DirectoryChecker.getInstance().registerDirectory(new File(config.getSystemDir()));
+ DirectoryChecker.getInstance().registerDirectory(new File(config.getDnSystemDir()));
// check WAL dir
if (!(config.isClusterMode()
&& config
@@ -278,7 +279,7 @@ public class IoTDBStartCheck {
}
// in cluster mode, check consensus dir
if (config.isClusterMode()) {
- DirectoryChecker.getInstance().registerDirectory(new File(config.getConsensusDir()));
+ DirectoryChecker.getInstance().registerDirectory(new File(config.getDnConsensusDir()));
}
}
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/adapter/CompressionRatio.java b/server/src/main/java/org/apache/iotdb/db/conf/adapter/CompressionRatio.java
index 4800b87927..871d57c730 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/adapter/CompressionRatio.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/adapter/CompressionRatio.java
@@ -71,7 +71,7 @@ public class CompressionRatio {
private CompressionRatio() {
directory =
SystemFileFactory.INSTANCE.getFile(
- FilePathUtils.regularizePath(CONFIG.getSystemDir()) + COMPRESSION_RATIO_DIR);
+ FilePathUtils.regularizePath(CONFIG.getDnSystemDir()) + COMPRESSION_RATIO_DIR);
restore();
}
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/directories/DirectoryManager.java b/server/src/main/java/org/apache/iotdb/db/conf/directories/DirectoryManager.java
index 4b0d1471a7..e345059c8c 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/directories/DirectoryManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/directories/DirectoryManager.java
@@ -48,7 +48,7 @@ public class DirectoryManager {
private DirectoryManager() {
sequenceFileFolders =
- new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDataDirs()));
+ new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()));
for (int i = 0; i < sequenceFileFolders.size(); i++) {
sequenceFileFolders.set(
i, sequenceFileFolders.get(i) + File.separator + IoTDBConstant.SEQUENCE_FLODER_NAME);
@@ -56,7 +56,7 @@ public class DirectoryManager {
mkDataDirs(sequenceFileFolders);
unsequenceFileFolders =
- new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDataDirs()));
+ new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()));
for (int i = 0; i < unsequenceFileFolders.size(); i++) {
unsequenceFileFolders.set(
i, unsequenceFileFolders.get(i) + File.separator + IoTDBConstant.UNSEQUENCE_FLODER_NAME);
@@ -65,7 +65,7 @@ public class DirectoryManager {
String strategyName = "";
try {
- strategyName = IoTDBDescriptor.getInstance().getConfig().getMultiDirStrategyClassName();
+ strategyName = IoTDBDescriptor.getInstance().getConfig().getDnMultiDirStrategyClassName();
Class<?> clazz = Class.forName(strategyName);
sequenceStrategy = (DirectoryStrategy) clazz.newInstance();
sequenceStrategy.setFolders(sequenceFileFolders);
@@ -81,7 +81,7 @@ public class DirectoryManager {
public void updateFileFolders() throws LoadConfigurationException {
try {
List<String> sequenceFileFolders =
- new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDataDirs()));
+ new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()));
for (int i = 0; i < sequenceFileFolders.size(); i++) {
sequenceFileFolders.set(
i, sequenceFileFolders.get(i) + File.separator + IoTDBConstant.SEQUENCE_FLODER_NAME);
@@ -89,7 +89,7 @@ public class DirectoryManager {
mkDataDirs(sequenceFileFolders);
List<String> unsequenceFileFolders =
- new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDataDirs()));
+ new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()));
for (int i = 0; i < unsequenceFileFolders.size(); i++) {
unsequenceFileFolders.set(
i,
@@ -111,7 +111,7 @@ public class DirectoryManager {
public void updateDirectoryStrategy() throws LoadConfigurationException {
String strategyName = "";
try {
- strategyName = IoTDBDescriptor.getInstance().getConfig().getMultiDirStrategyClassName();
+ strategyName = IoTDBDescriptor.getInstance().getConfig().getDnMultiDirStrategyClassName();
Class<?> clazz = Class.forName(strategyName);
sequenceStrategy = (DirectoryStrategy) clazz.newInstance();
sequenceStrategy.setFolders(sequenceFileFolders);
@@ -180,13 +180,13 @@ public class DirectoryManager {
@TestOnly
public void resetFolders() {
sequenceFileFolders =
- new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDataDirs()));
+ new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()));
for (int i = 0; i < sequenceFileFolders.size(); i++) {
sequenceFileFolders.set(
i, sequenceFileFolders.get(i) + File.separator + IoTDBConstant.SEQUENCE_FLODER_NAME);
}
unsequenceFileFolders =
- new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDataDirs()));
+ new ArrayList<>(Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()));
for (int i = 0; i < unsequenceFileFolders.size(); i++) {
unsequenceFileFolders.set(
i, unsequenceFileFolders.get(i) + File.separator + IoTDBConstant.UNSEQUENCE_FLODER_NAME);
diff --git a/server/src/main/java/org/apache/iotdb/db/consensus/DataRegionConsensusImpl.java b/server/src/main/java/org/apache/iotdb/db/consensus/DataRegionConsensusImpl.java
index 8ff6585f55..535ffc1960 100644
--- a/server/src/main/java/org/apache/iotdb/db/consensus/DataRegionConsensusImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/consensus/DataRegionConsensusImpl.java
@@ -64,7 +64,7 @@ public class DataRegionConsensusImpl {
.setThisNodeId(conf.getDataNodeId())
.setThisNode(
new TEndPoint(
- conf.getInternalAddress(), conf.getDataRegionConsensusPort()))
+ conf.getDnInternalAddress(), conf.getDnDataRegionConsensusPort()))
.setStorageDir(conf.getDataRegionConsensusDir())
.setIoTConsensusConfig(
IoTConsensusConfig.newBuilder()
diff --git a/server/src/main/java/org/apache/iotdb/db/consensus/SchemaRegionConsensusImpl.java b/server/src/main/java/org/apache/iotdb/db/consensus/SchemaRegionConsensusImpl.java
index eec582234d..f57dd5330b 100644
--- a/server/src/main/java/org/apache/iotdb/db/consensus/SchemaRegionConsensusImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/consensus/SchemaRegionConsensusImpl.java
@@ -61,7 +61,7 @@ public class SchemaRegionConsensusImpl {
.setThisNodeId(conf.getDataNodeId())
.setThisNode(
new TEndPoint(
- conf.getInternalAddress(), conf.getSchemaRegionConsensusPort()))
+ conf.getDnInternalAddress(), conf.getDnSchemaRegionConsensusPort()))
.setRatisConfig(
RatisConfig.newBuilder()
.setSnapshot(
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
index 2ff2f66463..e165ba2d01 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
@@ -107,7 +107,7 @@ public class StorageEngine implements IService {
* subfolder under the systemDir.
*/
private final String systemDir =
- FilePathUtils.regularizePath(config.getSystemDir()) + "databases";
+ FilePathUtils.regularizePath(config.getDnSystemDir()) + "databases";
/** DataRegionId -> DataRegion */
private final ConcurrentHashMap<DataRegionId, DataRegion> dataRegionMap =
@@ -659,7 +659,7 @@ public class StorageEngine implements IService {
.deleteWALNode(
region.getDatabaseName() + FILE_NAME_SEPARATOR + region.getDataRegionId());
// delete snapshot
- for (String dataDir : config.getDataDirs()) {
+ for (String dataDir : config.getDnDataDirs()) {
File regionSnapshotDir =
new File(
dataDir + File.separator + IoTDBConstant.SNAPSHOT_FOLDER_NAME,
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/recover/CompactionRecoverTask.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/recover/CompactionRecoverTask.java
index ebd5ac5177..7d1a81a388 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/recover/CompactionRecoverTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/recover/CompactionRecoverTask.java
@@ -275,7 +275,7 @@ public class CompactionRecoverTask {
* the file is not found, it will return null.
*/
private File getFileFromDataDirs(String filePath) {
- String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
+ String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
for (String dataDir : dataDirs) {
File f = new File(dataDir, filePath);
if (f.exists()) {
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/utils/log/TsFileIdentifier.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/utils/log/TsFileIdentifier.java
index 8897a811fc..c710adcd7f 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/utils/log/TsFileIdentifier.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/utils/log/TsFileIdentifier.java
@@ -180,7 +180,7 @@ public class TsFileIdentifier {
* the file is not found, it will return null.
*/
public File getFileFromDataDirs() {
- String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
+ String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
String partialFileString =
(sequence ? IoTDBConstant.SEQUENCE_FLODER_NAME : IoTDBConstant.UNSEQUENCE_FLODER_NAME)
+ File.separator
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/settle/SettleLog.java b/server/src/main/java/org/apache/iotdb/db/engine/settle/SettleLog.java
index 8eb102a4ae..be29a3a0b7 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/settle/SettleLog.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/settle/SettleLog.java
@@ -42,7 +42,7 @@ public class SettleLog {
private static BufferedWriter settleLogWriter;
private static File settleLogPath = // the path of upgrade log is "data/system/settle/settle.txt"
SystemFileFactory.INSTANCE.getFile(
- SystemFileFactory.INSTANCE.getFile(config.getSystemDir(), SETTLE_DIR), SETTLE_LOG_NAME);
+ SystemFileFactory.INSTANCE.getFile(config.getDnSystemDir(), SETTLE_DIR), SETTLE_LOG_NAME);
private static final ReadWriteLock settleLogFileLock = new ReentrantReadWriteLock();
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/snapshot/SnapshotLoader.java b/server/src/main/java/org/apache/iotdb/db/engine/snapshot/SnapshotLoader.java
index a5922082d3..b95d92c4fb 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/snapshot/SnapshotLoader.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/snapshot/SnapshotLoader.java
@@ -60,7 +60,7 @@ public class SnapshotLoader {
private DataRegion loadSnapshot() {
try {
return new DataRegion(
- IoTDBDescriptor.getInstance().getConfig().getSystemDir()
+ IoTDBDescriptor.getInstance().getConfig().getDnSystemDir()
+ File.separator
+ "databases"
+ File.separator
@@ -171,7 +171,7 @@ public class SnapshotLoader {
}
private void deleteAllFilesInDataDirs() throws IOException {
- String[] dataDirPaths = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
+ String[] dataDirPaths = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
// delete
List<File> timePartitions = new ArrayList<>();
@@ -250,7 +250,7 @@ public class SnapshotLoader {
}
FolderManager folderManager =
new FolderManager(
- Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDataDirs()),
+ Arrays.asList(IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()),
DirectoryStrategyType.SEQUENCE_STRATEGY);
File[] timePartitionFolders = seqFileDir.listFiles();
if (timePartitionFolders != null) {
@@ -318,7 +318,7 @@ public class SnapshotLoader {
String snapshotId = logAnalyzer.getSnapshotId();
int loggedFileNum = logAnalyzer.getTotalFileCountInSnapshot();
Set<String> fileInfoSet = logAnalyzer.getFileInfoSet();
- String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
+ String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
int fileCnt = 0;
for (String dataDir : dataDirs) {
String snapshotDir =
@@ -454,7 +454,7 @@ public class SnapshotLoader {
SnapshotLogAnalyzer analyzer = new SnapshotLogAnalyzer(logFile);
try {
String snapshotId = analyzer.getSnapshotId();
- String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
+ String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
List<File> fileList = new LinkedList<>();
for (String dataDir : dataDirs) {
String snapshotDir =
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/snapshot/SnapshotTaker.java b/server/src/main/java/org/apache/iotdb/db/engine/snapshot/SnapshotTaker.java
index c801e40ddd..78a81803a1 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/snapshot/SnapshotTaker.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/snapshot/SnapshotTaker.java
@@ -249,7 +249,7 @@ public class SnapshotTaker {
private void cleanUpWhenFail(String snapshotId) {
LOGGER.info("Cleaning up snapshot dir for {}", snapshotId);
- for (String dataDir : IoTDBDescriptor.getInstance().getConfig().getDataDirs()) {
+ for (String dataDir : IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()) {
File dataDirForThisSnapshot =
new File(
dataDir
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/upgrade/UpgradeLog.java b/server/src/main/java/org/apache/iotdb/db/engine/upgrade/UpgradeLog.java
index 1dfb9da2be..1c4159a239 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/upgrade/UpgradeLog.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/upgrade/UpgradeLog.java
@@ -41,7 +41,8 @@ public class UpgradeLog {
private static BufferedWriter upgradeLogWriter;
private static File upgradeLogPath =
SystemFileFactory.INSTANCE.getFile(
- SystemFileFactory.INSTANCE.getFile(config.getSystemDir(), UPGRADE_DIR), UPGRADE_LOG_NAME);
+ SystemFileFactory.INSTANCE.getFile(config.getDnSystemDir(), UPGRADE_DIR),
+ UPGRADE_LOG_NAME);
public static boolean createUpgradeLog() {
try {
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableManager.java
index 41e92f425c..f904bd4e3a 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableManager.java
@@ -44,7 +44,7 @@ public class IDTableManager {
/** system dir */
private final String systemDir =
- FilePathUtils.regularizePath(IoTDBDescriptor.getInstance().getConfig().getSystemDir())
+ FilePathUtils.regularizePath(IoTDBDescriptor.getInstance().getConfig().getDnSystemDir())
+ "databases";
// region IDManager Singleton
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/common/DataNodeEndPoints.java b/server/src/main/java/org/apache/iotdb/db/mpp/common/DataNodeEndPoints.java
index c01fe15946..8cf8055ce9 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/common/DataNodeEndPoints.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/common/DataNodeEndPoints.java
@@ -30,13 +30,13 @@ public class DataNodeEndPoints {
public static final TEndPoint LOCAL_HOST_DATA_BLOCK_ENDPOINT =
new TEndPoint(
- IoTDBDescriptor.getInstance().getConfig().getInternalAddress(),
- IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ IoTDBDescriptor.getInstance().getConfig().getDnInternalAddress(),
+ IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
public static final TEndPoint LOCAL_HOST_INTERNAL_ENDPOINT =
new TEndPoint(
- IoTDBDescriptor.getInstance().getConfig().getInternalAddress(),
- IoTDBDescriptor.getInstance().getConfig().getInternalPort());
+ IoTDBDescriptor.getInstance().getConfig().getDnInternalAddress(),
+ IoTDBDescriptor.getInstance().getConfig().getDnInternalPort());
public static boolean isSameNode(TEndPoint endPoint) {
return endPoint.equals(LOCAL_HOST_DATA_BLOCK_ENDPOINT);
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/MPPDataExchangeService.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/MPPDataExchangeService.java
index b28e8f256f..d35a145004 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/MPPDataExchangeService.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/MPPDataExchangeService.java
@@ -109,12 +109,12 @@ public class MPPDataExchangeService extends ThriftService implements MPPDataExch
@Override
public String getBindIP() {
- return IoTDBDescriptor.getInstance().getConfig().getInternalAddress();
+ return IoTDBDescriptor.getInstance().getConfig().getDnInternalAddress();
}
@Override
public int getBindPort() {
- return IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort();
+ return IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort();
}
@Override
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/load/LoadSingleTsFileNode.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/load/LoadSingleTsFileNode.java
index 1c965e5e69..974b1d63b4 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/load/LoadSingleTsFileNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/load/LoadSingleTsFileNode.java
@@ -114,8 +114,8 @@ public class LoadSingleTsFileNode extends WritePlanNode {
}
private boolean isDispatchedToLocal(TEndPoint endPoint) {
- return IoTDBDescriptor.getInstance().getConfig().getInternalAddress().equals(endPoint.getIp())
- && IoTDBDescriptor.getInstance().getConfig().getInternalPort() == endPoint.port;
+ return IoTDBDescriptor.getInstance().getConfig().getDnInternalAddress().equals(endPoint.getIp())
+ && IoTDBDescriptor.getInstance().getConfig().getDnInternalPort() == endPoint.port;
}
public boolean needDecodeTsFile() {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java
index 92d289ee60..5763b96942 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java
@@ -61,8 +61,8 @@ public abstract class AbstractFragInsStateTracker implements IFragInstanceStateT
this.scheduledExecutor = scheduledExecutor;
this.instances = instances;
this.internalServiceClientManager = internalServiceClientManager;
- this.localhostIpAddr = IoTDBDescriptor.getInstance().getConfig().getInternalAddress();
- this.localhostInternalPort = IoTDBDescriptor.getInstance().getConfig().getInternalPort();
+ this.localhostIpAddr = IoTDBDescriptor.getInstance().getConfig().getDnInternalAddress();
+ this.localhostInternalPort = IoTDBDescriptor.getInstance().getConfig().getDnInternalPort();
}
public abstract void start();
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
index cedfdbb684..f896427090 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
@@ -82,8 +82,8 @@ public class FragmentInstanceDispatcherImpl implements IFragInstanceDispatcher {
this.executor = executor;
this.writeOperationExecutor = writeOperationExecutor;
this.internalServiceClientManager = internalServiceClientManager;
- this.localhostIpAddr = IoTDBDescriptor.getInstance().getConfig().getInternalAddress();
- this.localhostInternalPort = IoTDBDescriptor.getInstance().getConfig().getInternalPort();
+ this.localhostIpAddr = IoTDBDescriptor.getInstance().getConfig().getDnInternalAddress();
+ this.localhostInternalPort = IoTDBDescriptor.getInstance().getConfig().getDnInternalPort();
}
@Override
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/load/LoadTsFileDispatcherImpl.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/load/LoadTsFileDispatcherImpl.java
index 418bd8aa99..c7a47d71c7 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/load/LoadTsFileDispatcherImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/load/LoadTsFileDispatcherImpl.java
@@ -72,8 +72,8 @@ public class LoadTsFileDispatcherImpl implements IFragInstanceDispatcher {
public LoadTsFileDispatcherImpl(
IClientManager<TEndPoint, SyncDataNodeInternalServiceClient> internalServiceClientManager) {
this.internalServiceClientManager = internalServiceClientManager;
- this.localhostIpAddr = IoTDBDescriptor.getInstance().getConfig().getInternalAddress();
- this.localhostInternalPort = IoTDBDescriptor.getInstance().getConfig().getInternalPort();
+ this.localhostIpAddr = IoTDBDescriptor.getInstance().getConfig().getDnInternalAddress();
+ this.localhostInternalPort = IoTDBDescriptor.getInstance().getConfig().getDnInternalPort();
this.executor =
IoTDBThreadPoolFactory.newCachedThreadPool(LoadTsFileDispatcherImpl.class.getName());
}
diff --git a/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java b/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java
index de450341cb..afa9e8f839 100644
--- a/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java
@@ -18,9 +18,9 @@
*/
package org.apache.iotdb.db.rescon;
+import org.apache.iotdb.commons.utils.datastructure.TVListSortAlgorithm;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.db.utils.datastructure.TVListSortAlgorithm;
import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.tsfile.utils.Binary;
diff --git a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
index e3f50f7639..706a8a389e 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -115,7 +115,7 @@ public class DataNode implements DataNodeMBean {
*/
private static final int DEFAULT_RETRY = 10;
- private static final long DEFAULT_RETRY_INTERVAL_IN_MS = config.getJoinClusterRetryIntervalMs();
+ private static final long DEFAULT_RETRY_INTERVAL_IN_MS = config.getDnJoinClusterRetryIntervalMs();
private final TEndPoint thisNode = new TEndPoint();
@@ -148,7 +148,7 @@ public class DataNode implements DataNodeMBean {
isFirstStart = prepareDataNode();
// Set target ConfigNodeList from iotdb-datanode.properties file
- ConfigNodeInfo.getInstance().updateConfigNodeList(config.getTargetConfigNodeList());
+ ConfigNodeInfo.getInstance().updateConfigNodeList(config.getDnTargetConfigNodeList());
// Pull and check system configurations from ConfigNode-leader
pullAndCheckSystemConfigurations();
@@ -193,7 +193,7 @@ public class DataNode implements DataNodeMBean {
boolean isFirstStart = IoTDBStartCheck.getInstance().checkIsFirstStart();
// Check target ConfigNodes
- for (TEndPoint endPoint : config.getTargetConfigNodeList()) {
+ for (TEndPoint endPoint : config.getDnTargetConfigNodeList()) {
if (endPoint.getIp().equals("0.0.0.0")) {
throw new StartupException(
"The ip address of any target_config_node_list couldn't be 0.0.0.0");
@@ -201,8 +201,8 @@ public class DataNode implements DataNodeMBean {
}
// Set this node
- thisNode.setIp(config.getInternalAddress());
- thisNode.setPort(config.getInternalPort());
+ thisNode.setIp(config.getDnInternalAddress());
+ thisNode.setPort(config.getDnInternalPort());
// Startup checks
StartupChecks checks = new StartupChecks(IoTDBConstant.DN_ROLE).withDefaultTest();
@@ -561,15 +561,15 @@ public class DataNode implements DataNodeMBean {
private TDataNodeLocation generateDataNodeLocation() {
TDataNodeLocation location = new TDataNodeLocation();
location.setDataNodeId(config.getDataNodeId());
- location.setClientRpcEndPoint(new TEndPoint(config.getRpcAddress(), config.getRpcPort()));
+ location.setClientRpcEndPoint(new TEndPoint(config.getDnRpcAddress(), config.getDnRpcPort()));
location.setInternalEndPoint(
- new TEndPoint(config.getInternalAddress(), config.getInternalPort()));
+ new TEndPoint(config.getDnInternalAddress(), config.getDnInternalPort()));
location.setMPPDataExchangeEndPoint(
- new TEndPoint(config.getInternalAddress(), config.getMppDataExchangePort()));
+ new TEndPoint(config.getDnInternalAddress(), config.getDnMppDataExchangePort()));
location.setDataRegionConsensusEndPoint(
- new TEndPoint(config.getInternalAddress(), config.getDataRegionConsensusPort()));
+ new TEndPoint(config.getDnInternalAddress(), config.getDnDataRegionConsensusPort()));
location.setSchemaRegionConsensusEndPoint(
- new TEndPoint(config.getInternalAddress(), config.getSchemaRegionConsensusPort()));
+ new TEndPoint(config.getDnInternalAddress(), config.getDnSchemaRegionConsensusPort()));
return location;
}
diff --git a/server/src/main/java/org/apache/iotdb/db/service/DataNodeInternalRPCService.java b/server/src/main/java/org/apache/iotdb/db/service/DataNodeInternalRPCService.java
index b3ba29c387..4f722becea 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/DataNodeInternalRPCService.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/DataNodeInternalRPCService.java
@@ -78,12 +78,12 @@ public class DataNodeInternalRPCService extends ThriftService
@Override
public String getBindIP() {
- return IoTDBDescriptor.getInstance().getConfig().getInternalAddress();
+ return IoTDBDescriptor.getInstance().getConfig().getDnInternalAddress();
}
@Override
public int getBindPort() {
- return IoTDBDescriptor.getInstance().getConfig().getInternalPort();
+ return IoTDBDescriptor.getInstance().getConfig().getDnInternalPort();
}
private static class DataNodeInternalRPCServiceHolder {
diff --git a/server/src/main/java/org/apache/iotdb/db/service/InfluxDBRPCService.java b/server/src/main/java/org/apache/iotdb/db/service/InfluxDBRPCService.java
index bbd0c0f1ea..dd0e4d513b 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/InfluxDBRPCService.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/InfluxDBRPCService.java
@@ -68,7 +68,7 @@ public class InfluxDBRPCService extends ThriftService implements InfluxDBRPCServ
processor,
getID().getName(),
ThreadName.INFLUXDB_RPC_PROCESSOR.getName(),
- config.getRpcAddress(),
+ config.getDnRpcAddress(),
config.getInfluxDBRpcPort(),
config.getDnRpcMaxConcurrentClientNum(),
config.getThriftServerAwaitTimeForStopService(),
@@ -82,7 +82,7 @@ public class InfluxDBRPCService extends ThriftService implements InfluxDBRPCServ
@Override
public String getBindIP() {
- return IoTDBDescriptor.getInstance().getConfig().getRpcAddress();
+ return IoTDBDescriptor.getInstance().getConfig().getDnRpcAddress();
}
@Override
diff --git a/server/src/main/java/org/apache/iotdb/db/service/RPCService.java b/server/src/main/java/org/apache/iotdb/db/service/RPCService.java
index 55e72401b4..5fcf98801a 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/RPCService.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/RPCService.java
@@ -63,8 +63,8 @@ public class RPCService extends ThriftService implements RPCServiceMBean {
processor,
getID().getName(),
ThreadName.CLIENT_RPC_PROCESSOR.getName(),
- config.getRpcAddress(),
- config.getRpcPort(),
+ config.getDnRpcAddress(),
+ config.getDnRpcPort(),
config.getDnRpcMaxConcurrentClientNum(),
config.getThriftServerAwaitTimeForStopService(),
new RPCServiceThriftHandler(impl),
@@ -78,12 +78,12 @@ public class RPCService extends ThriftService implements RPCServiceMBean {
@Override
public String getBindIP() {
- return IoTDBDescriptor.getInstance().getConfig().getRpcAddress();
+ return IoTDBDescriptor.getInstance().getConfig().getDnRpcAddress();
}
@Override
public int getBindPort() {
- return IoTDBDescriptor.getInstance().getConfig().getRpcPort();
+ return IoTDBDescriptor.getInstance().getConfig().getDnRpcPort();
}
@Override
diff --git a/server/src/main/java/org/apache/iotdb/db/service/TemporaryQueryDataFileService.java b/server/src/main/java/org/apache/iotdb/db/service/TemporaryQueryDataFileService.java
index 4cd00dde1a..0f42a0720f 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TemporaryQueryDataFileService.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TemporaryQueryDataFileService.java
@@ -43,7 +43,7 @@ public class TemporaryQueryDataFileService implements IService {
private static final Logger logger = LoggerFactory.getLogger(TemporaryQueryDataFileService.class);
private static final String TEMPORARY_FILE_DIR =
- IoTDBDescriptor.getInstance().getConfig().getSystemDir()
+ IoTDBDescriptor.getInstance().getConfig().getDnSystemDir()
+ File.separator
+ "udf"
+ File.separator
diff --git a/server/src/main/java/org/apache/iotdb/db/service/metrics/SystemMetrics.java b/server/src/main/java/org/apache/iotdb/db/service/metrics/SystemMetrics.java
index 7d14b5d9b3..1d77059475 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/metrics/SystemMetrics.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/metrics/SystemMetrics.java
@@ -186,7 +186,7 @@ public class SystemMetrics implements IMetricSet {
}
private void collectSystemDiskInfo(AbstractMetricService metricService) {
- String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
+ String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
for (String dataDir : dataDirs) {
Path path = Paths.get(dataDir);
FileStore fileStore = null;
diff --git a/server/src/main/java/org/apache/iotdb/db/utils/OpenFileNumUtil.java b/server/src/main/java/org/apache/iotdb/db/utils/OpenFileNumUtil.java
index d4fd49b76f..0f3e89d607 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/OpenFileNumUtil.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/OpenFileNumUtil.java
@@ -269,7 +269,7 @@ public class OpenFileNumUtil {
SEQUENCE_FILE_OPEN_NUM(directoryManager.getAllSequenceFileFolders()),
UNSEQUENCE_FILE_OPEN_NUM(directoryManager.getAllUnSequenceFileFolders()),
WAL_OPEN_FILE_NUM(Arrays.asList(commonConfig.getWalDirs())),
- DIGEST_OPEN_FILE_NUM(Collections.singletonList(config.getSystemDir())),
+ DIGEST_OPEN_FILE_NUM(Collections.singletonList(config.getDnSystemDir())),
SOCKET_OPEN_FILE_NUM(null);
// path is a list of directory corresponding to the OpenFileNumStatistics enum element,
diff --git a/server/src/test/java/org/apache/iotdb/db/conf/adapter/CompressionRatioTest.java b/server/src/test/java/org/apache/iotdb/db/conf/adapter/CompressionRatioTest.java
index 8ae261e7e5..2d2ac9fe46 100644
--- a/server/src/test/java/org/apache/iotdb/db/conf/adapter/CompressionRatioTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/conf/adapter/CompressionRatioTest.java
@@ -42,7 +42,8 @@ public class CompressionRatioTest {
private CompressionRatio compressionRatio = CompressionRatio.getInstance();
private static final String directory =
- FilePathUtils.regularizePath(CONFIG.getSystemDir()) + CompressionRatio.COMPRESSION_RATIO_DIR;
+ FilePathUtils.regularizePath(CONFIG.getDnSystemDir())
+ + CompressionRatio.COMPRESSION_RATIO_DIR;
@Before
public void setUp() throws Exception {
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/TsFileIdentifierUT.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/TsFileIdentifierUT.java
index b05c34d0d2..ecee4c5f04 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/TsFileIdentifierUT.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/TsFileIdentifierUT.java
@@ -134,7 +134,7 @@ public class TsFileIdentifierUT {
+ "0"
+ File.separator
+ "100-10-5-1.tsfile";
- String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
+ String[] dataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
File file = new File(dataDirs[0], firstPath);
if (file.exists()) {
@@ -157,7 +157,7 @@ public class TsFileIdentifierUT {
@Test
public void testGetInfoFromFileFromMultiDirs() throws Exception {
IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
- String[] originDataDirs = config.getDataDirs();
+ String[] originDataDirs = config.getDnDataDirs();
Class configClass = config.getClass();
Field dataDirField = configClass.getDeclaredField("dataDirs");
dataDirField.setAccessible(true);
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/recover/SizeTieredCompactionRecoverTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/recover/SizeTieredCompactionRecoverTest.java
index d65c9eed31..8f53ed95dd 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/recover/SizeTieredCompactionRecoverTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/recover/SizeTieredCompactionRecoverTest.java
@@ -126,7 +126,7 @@ public class SizeTieredCompactionRecoverTest {
@Before
public void setUp() throws Exception {
CompactionTaskManager.getInstance().start();
- originDataDirs = config.getDataDirs();
+ originDataDirs = config.getDnDataDirs();
setDataDirs(testDataDirs);
if (!new File(SEQ_FILE_DIR).exists()) {
Assert.assertTrue(new File(SEQ_FILE_DIR).mkdirs());
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/snapshot/IoTDBSnapshotTest.java b/server/src/test/java/org/apache/iotdb/db/engine/snapshot/IoTDBSnapshotTest.java
index 8c9f5f8ff0..d9f8fcfda5 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/snapshot/IoTDBSnapshotTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/snapshot/IoTDBSnapshotTest.java
@@ -94,8 +94,8 @@ public class IoTDBSnapshotTest {
@Test
public void testCreateSnapshot()
throws IOException, WriteProcessException, DataRegionException, DirectoryNotLegalException {
- String[] originDataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
- IoTDBDescriptor.getInstance().getConfig().setDataDirs(testDataDirs);
+ String[] originDataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
+ IoTDBDescriptor.getInstance().getConfig().setDnDataDirs(testDataDirs);
DirectoryManager.getInstance().resetFolders();
try {
List<TsFileResource> resources = writeTsFiles();
@@ -120,7 +120,7 @@ public class IoTDBSnapshotTest {
FileUtils.recursiveDeleteFolder(snapshotDir.getAbsolutePath());
}
} finally {
- IoTDBDescriptor.getInstance().getConfig().setDataDirs(originDataDirs);
+ IoTDBDescriptor.getInstance().getConfig().setDnDataDirs(originDataDirs);
DirectoryManager.getInstance().resetFolders();
}
}
@@ -128,8 +128,8 @@ public class IoTDBSnapshotTest {
@Test
public void testCreateSnapshotWithUnclosedTsFile()
throws IOException, WriteProcessException, DirectoryNotLegalException {
- String[] originDataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
- IoTDBDescriptor.getInstance().getConfig().setDataDirs(testDataDirs);
+ String[] originDataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
+ IoTDBDescriptor.getInstance().getConfig().setDnDataDirs(testDataDirs);
DirectoryManager.getInstance().resetFolders();
try {
List<TsFileResource> resources = writeTsFiles();
@@ -156,7 +156,7 @@ public class IoTDBSnapshotTest {
FileUtils.recursiveDeleteFolder(snapshotDir.getAbsolutePath());
}
} finally {
- IoTDBDescriptor.getInstance().getConfig().setDataDirs(originDataDirs);
+ IoTDBDescriptor.getInstance().getConfig().setDnDataDirs(originDataDirs);
DirectoryManager.getInstance().resetFolders();
}
}
@@ -164,8 +164,8 @@ public class IoTDBSnapshotTest {
@Test
public void testLoadSnapshot()
throws IOException, WriteProcessException, DataRegionException, DirectoryNotLegalException {
- String[] originDataDirs = IoTDBDescriptor.getInstance().getConfig().getDataDirs();
- IoTDBDescriptor.getInstance().getConfig().setDataDirs(testDataDirs);
+ String[] originDataDirs = IoTDBDescriptor.getInstance().getConfig().getDnDataDirs();
+ IoTDBDescriptor.getInstance().getConfig().setDnDataDirs(testDataDirs);
DirectoryManager.getInstance().resetFolders();
try {
List<TsFileResource> resources = writeTsFiles();
@@ -186,7 +186,7 @@ public class IoTDBSnapshotTest {
FileUtils.recursiveDeleteFolder(snapshotDir.getAbsolutePath());
}
} finally {
- IoTDBDescriptor.getInstance().getConfig().setDataDirs(originDataDirs);
+ IoTDBDescriptor.getInstance().getConfig().setDnDataDirs(originDataDirs);
DirectoryManager.getInstance().resetFolders();
}
}
@@ -195,7 +195,7 @@ public class IoTDBSnapshotTest {
public void testGetSnapshotFile() throws IOException {
File tsFile =
new File(
- IoTDBDescriptor.getInstance().getConfig().getDataDirs()[0]
+ IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()[0]
+ File.separator
+ "sequence"
+ File.separator
@@ -213,7 +213,7 @@ public class IoTDBSnapshotTest {
new SnapshotTaker(region).getSnapshotFilePathForTsFile(tsFile, "test-snapshotId");
Assert.assertEquals(
new File(
- IoTDBDescriptor.getInstance().getConfig().getDataDirs()[0]
+ IoTDBDescriptor.getInstance().getConfig().getDnDataDirs()[0]
+ File.separator
+ "snapshot"
+ File.separator
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/TTLTest.java b/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/TTLTest.java
index e3efd99450..aa679b1c70 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/TTLTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/TTLTest.java
@@ -87,7 +87,7 @@ public class TTLTest {
EnvironmentUtils.envSetUp();
dataRegion =
new DataRegion(
- IoTDBDescriptor.getInstance().getConfig().getSystemDir(),
+ IoTDBDescriptor.getInstance().getConfig().getDnSystemDir(),
String.valueOf(dataRegionId1.getId()),
new DirectFlushPolicy(),
sg1);
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandleTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandleTest.java
index 0c8ebf9f73..cf63ced024 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandleTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandleTest.java
@@ -52,7 +52,8 @@ public class SinkHandleTest {
final long mockTsBlockSize = 128 * 1024L;
final int numOfMockTsBlock = 1;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
final String remotePlanNodeId = "exchange_0";
final String localPlanNodeId = "fragmentSink_0";
@@ -190,7 +191,8 @@ public class SinkHandleTest {
final long mockTsBlockSize = 128 * 1024L;
final int numOfMockTsBlock = 1;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
final String remotePlanNodeId = "exchange_0";
final String localPlanNodeId = "fragmentSink_0";
@@ -390,7 +392,8 @@ public class SinkHandleTest {
final long mockTsBlockSize = 1024L * 1024L;
final int numOfMockTsBlock = 1;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
final String remotePlanNodeId = "exchange_0";
final String localPlanNodeId = "fragmentSink_0";
@@ -502,7 +505,8 @@ public class SinkHandleTest {
final long mockTsBlockSize = 1024L * 1024L;
final int numOfMockTsBlock = 1;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
final String remotePlanNodeId = "exchange_0";
final String localPlanNodeId = "fragmentSink_0";
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SourceHandleTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SourceHandleTest.java
index 1a5ad7560f..04a9dc8d16 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SourceHandleTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SourceHandleTest.java
@@ -69,7 +69,8 @@ public class SourceHandleTest {
final String queryId = "q0";
final int numOfMockTsBlock = 10;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -183,7 +184,8 @@ public class SourceHandleTest {
final String queryId = "q0";
final int numOfMockTsBlock = 10;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -339,7 +341,8 @@ public class SourceHandleTest {
final long MOCK_TSBLOCK_SIZE = 1024L * 1024L;
final int numOfMockTsBlock = 10;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -519,7 +522,8 @@ public class SourceHandleTest {
final long MOCK_TSBLOCK_SIZE = 1024L * 1024L;
final int numOfMockTsBlock = 10;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -598,7 +602,8 @@ public class SourceHandleTest {
final String queryId = "q0";
final long MOCK_TSBLOCK_SIZE = 1024L * 1024L;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint(
+ "remote", IoTDBDescriptor.getInstance().getConfig().getDnMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
diff --git a/server/src/test/java/org/apache/iotdb/db/service/DataNodeInternalRPCServiceImplTest.java b/server/src/test/java/org/apache/iotdb/db/service/DataNodeInternalRPCServiceImplTest.java
index c06fcf6007..4173f6818a 100644
--- a/server/src/test/java/org/apache/iotdb/db/service/DataNodeInternalRPCServiceImplTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/service/DataNodeInternalRPCServiceImplTest.java
@@ -99,7 +99,7 @@ public class DataNodeInternalRPCServiceImplTest {
SchemaRegionConsensusImpl.getInstance()
.deletePeer(
ConsensusGroupId.Factory.createFromTConsensusGroupId(regionReplicaSet.getRegionId()));
- FileUtils.deleteFully(new File(conf.getConsensusDir()));
+ FileUtils.deleteFully(new File(conf.getDnConsensusDir()));
}
@AfterClass
@@ -324,14 +324,15 @@ public class DataNodeInternalRPCServiceImplTest {
List<TDataNodeLocation> dataNodeList = new ArrayList<>();
dataNodeList.add(
new TDataNodeLocation()
- .setClientRpcEndPoint(new TEndPoint(conf.getRpcAddress(), conf.getRpcPort()))
- .setInternalEndPoint(new TEndPoint(conf.getInternalAddress(), conf.getInternalPort()))
+ .setClientRpcEndPoint(new TEndPoint(conf.getDnRpcAddress(), conf.getDnRpcPort()))
+ .setInternalEndPoint(
+ new TEndPoint(conf.getDnInternalAddress(), conf.getDnInternalPort()))
.setMPPDataExchangeEndPoint(
- new TEndPoint(conf.getInternalAddress(), conf.getMppDataExchangePort()))
+ new TEndPoint(conf.getDnInternalAddress(), conf.getDnMppDataExchangePort()))
.setDataRegionConsensusEndPoint(
- new TEndPoint(conf.getInternalAddress(), conf.getDataRegionConsensusPort()))
+ new TEndPoint(conf.getDnInternalAddress(), conf.getDnDataRegionConsensusPort()))
.setSchemaRegionConsensusEndPoint(
- new TEndPoint(conf.getInternalAddress(), conf.getSchemaRegionConsensusPort())));
+ new TEndPoint(conf.getDnInternalAddress(), conf.getDnSchemaRegionConsensusPort())));
// construct fragmentInstance
return new TRegionReplicaSet(
diff --git a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
index d334e495be..ad8b4efe4d 100644
--- a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
+++ b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
@@ -238,11 +238,11 @@ public class EnvironmentUtils {
cleanDir(path);
}
// delete system info
- cleanDir(config.getSystemDir());
+ cleanDir(config.getDnSystemDir());
// delete query
cleanDir(config.getQueryDir());
// delete tracing
- cleanDir(config.getTracingDir());
+ cleanDir(config.getDnTracingDir());
// delete ulog
cleanDir(config.getUdfDir());
// delete tlog
@@ -260,7 +260,7 @@ public class EnvironmentUtils {
// delete sync dir
cleanDir(commonConfig.getSyncDir());
// delete data files
- for (String dataDir : config.getDataDirs()) {
+ for (String dataDir : config.getDnDataDirs()) {
cleanDir(dataDir);
}
}
@@ -328,9 +328,9 @@ public class EnvironmentUtils {
createDir(path);
}
// create database
- createDir(config.getSystemDir());
+ createDir(config.getDnSystemDir());
// create sg dir
- String sgDir = FilePathUtils.regularizePath(config.getSystemDir()) + "databases";
+ String sgDir = FilePathUtils.regularizePath(config.getDnSystemDir()) + "databases";
createDir(sgDir);
// create sync
createDir(commonConfig.getSyncDir());
@@ -342,7 +342,7 @@ public class EnvironmentUtils {
createDir(walDir);
}
// create data
- for (String dataDir : config.getDataDirs()) {
+ for (String dataDir : config.getDnDataDirs()) {
createDir(dataDir);
}
// create user and roles folder
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
index a1a5b22f88..7534344401 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
@@ -151,12 +151,6 @@ public class TSFileConfig implements Serializable {
/** The amount of data iterate each time */
private int batchSize = 1000;
- /** Maximum capacity of a TsBlock, allow up to two pages. */
- private int maxTsBlockSizeInBytes = 128 * 1024;
-
- /** Maximum number of lines in a single TsBlock */
- private int maxTsBlockLineNumber = 1000;
-
private int patternMatchingThreshold = 1000000;
/** customizedProperties, this should be empty by default. */