You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2021/01/06 06:29:53 UTC

[iotdb] branch rel/0.11 updated: expose enablePartition parameter into iotdb-engines.properpties (#2434)

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

hxd pushed a commit to branch rel/0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.11 by this push:
     new b734139  expose enablePartition parameter into iotdb-engines.properpties (#2434)
b734139 is described below

commit b73413997229e9bbbe833fa24d668a8847c51649
Author: Boris <ge...@apache.org>
AuthorDate: Wed Jan 6 14:29:15 2021 +0800

    expose enablePartition parameter into iotdb-engines.properpties (#2434)
    
    expose enablePartition parameter into iotdb-engines.properpties
---
 docs/UserGuide/Server/Config Manual.md                 | 18 ++++++++++++++++++
 docs/zh/UserGuide/Server/Config Manual.md              | 17 +++++++++++++++++
 .../assembly/resources/conf/iotdb-engine.properties    |  8 +++++++-
 .../java/org/apache/iotdb/db/conf/IoTDBDescriptor.java |  4 ++++
 4 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/docs/UserGuide/Server/Config Manual.md b/docs/UserGuide/Server/Config Manual.md
index 4915ae2..d9f9c95 100644
--- a/docs/UserGuide/Server/Config Manual.md	
+++ b/docs/UserGuide/Server/Config Manual.md	
@@ -647,6 +647,24 @@ The permission definitions are in ${IOTDB\_CONF}/conf/jmx.access.
 |Default|FLOAT |
 |Effective|After restart system|
 
+* enable\_partition
+
+|Name| enable\_partition |
+|:---:|:---|
+|Description| whether enable data partition. If disabled, all data belongs to partition 0|
+|Type| BOOLEAN |
+|Default|false |
+|Effective|After restart system|
+
+* partition\_interval
+
+|Name| partition\_interval |
+|:---:|:---|
+|Description| time range for partitioning data inside each storage group, the unit is second|
+|Type| LONG |
+|Default| 604800 |
+|Effective|After restart system|
+
 ## Enable GC log
 GC log is off by default.
 For performance tuning, you may want to collect the GC info. 
diff --git a/docs/zh/UserGuide/Server/Config Manual.md b/docs/zh/UserGuide/Server/Config Manual.md
index c192658..21e85e0 100644
--- a/docs/zh/UserGuide/Server/Config Manual.md	
+++ b/docs/zh/UserGuide/Server/Config Manual.md	
@@ -603,6 +603,23 @@
 |默认值|FLOAT |
 |改后生效方式|重启服务器生效|
 
+* enable\_partition
+
+|名字| enable\_partition |
+|:---:|:---|
+|描述| 是否启用数据分区。如果禁用,则所有数据都属于分区0 |
+|取值| BOOLEAN |
+|默认值| false |
+|改后生效方式|重启服务器生效|
+
+* partition\_interval
+
+|名字| partition\_interval |
+|:---:|:---|
+|描述| 对每个存储组内的数据进行分区的时间范围,单位为秒|
+|取值| LONG |
+|默认值|604800 |
+|改后生效方式|重启服务器生效|
 
 ## 开启GC日志
 GC日志默认是关闭的。为了性能调优,用户可能会需要收集GC信息。
diff --git a/server/src/assembly/resources/conf/iotdb-engine.properties b/server/src/assembly/resources/conf/iotdb-engine.properties
index 931ee25..a436b42 100644
--- a/server/src/assembly/resources/conf/iotdb-engine.properties
+++ b/server/src/assembly/resources/conf/iotdb-engine.properties
@@ -590,4 +590,10 @@ authorizer_provider_class=org.apache.iotdb.db.auth.authorizer.LocalFileAuthorize
 
 #If OpenIdAuthorizer is enabled, then openID_url must be set.
 
-#openID_url=
\ No newline at end of file
+#openID_url=
+
+# whether enable data partition. If disabled, all data belongs to partition 0
+enable_partition=false
+
+# time range for partitioning data inside each storage group, the unit is second
+partition_interval=604800
\ No newline at end of file
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 41d3af1..0aa0c19 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
@@ -551,6 +551,10 @@ public class IoTDBDescriptor {
       //if using org.apache.iotdb.db.auth.authorizer.OpenIdAuthorizer, openID_url is needed.
       conf.setOpenIdProviderUrl(properties.getProperty("openID_url", ""));
 
+      conf.setEnablePartition(Boolean.parseBoolean(properties.getProperty("enable_partition", conf.isEnablePartition() + "")));
+
+      conf.setPartitionInterval(Long.parseLong(properties.getProperty("partition_interval", conf.getPartitionInterval() + "")));
+
       // At the same time, set TSFileConfig
       TSFileDescriptor.getInstance().getConfig()
           .setTSFileStorageFs(FSType.valueOf(