jt2594838 commented on code in PR #399:
URL: https://github.com/apache/iotdb-docs/pull/399#discussion_r1830500549
##########
src/UserGuide/Master/stage/Delete-Data/TTL.md:
##########
@@ -21,29 +21,42 @@
# TTL
-IoTDB supports storage-level TTL settings, which means it is able to delete
old data automatically and periodically. The benefit of using TTL is that
hopefully you can control the total disk space usage and prevent the machine
from running out of disks. Moreover, the query performance may downgrade as the
total number of files goes up and the memory usage also increase as there are
more files. Timely removing such files helps to keep at a high query
performance level and reduce memory usage.
+IoTDB supports device-level TTL settings, which means it is able to delete old
data automatically and periodically. The benefit of using TTL is that hopefully
you can control the total disk space usage and prevent the machine from running
out of disks. Moreover, the query performance may downgrade as the total number
of files goes up and the memory usage also increase as there are more files.
Timely removing such files helps to keep at a high query performance level and
reduce memory usage.
Review Comment:
the memory usage also increase -> increases
##########
src/UserGuide/Master/Reference/Common-Config-Manual.md:
##########
@@ -636,6 +636,35 @@ Different configuration parameters take effect in the
following three ways:
|Default| 100000 |
|Effective|After restarting system|
+### TTL 配置
+* ttl\_check\_interval
+
+| Name | ttl\_check\_interval |
+|:-----------:|:-------------------------|
+| Description | The interval of TTL check task in each database. Default is 2
hours. |
+| Type | int |
+| Default | 7200000 |
+| Effective | After restarting system |
+
+* max\_expired\_time
+
+| Name | max\_expired\_time
|
+| :----------:
|:-------------------------------------------------------------------------|
+| Description | The maximum expiring time of device which has a ttl.
Default is 1 month. |
+| Type | int
|
+| Default | 2592000000
|
+| Effective | After restarting system
|
Review Comment:
Though it can be inferred, it is better to give the unit explicitly.
##########
src/UserGuide/Master/stage/Delete-Data/TTL.md:
##########
@@ -21,29 +21,42 @@
# TTL
-IoTDB supports storage-level TTL settings, which means it is able to delete
old data automatically and periodically. The benefit of using TTL is that
hopefully you can control the total disk space usage and prevent the machine
from running out of disks. Moreover, the query performance may downgrade as the
total number of files goes up and the memory usage also increase as there are
more files. Timely removing such files helps to keep at a high query
performance level and reduce memory usage.
+IoTDB supports device-level TTL settings, which means it is able to delete old
data automatically and periodically. The benefit of using TTL is that hopefully
you can control the total disk space usage and prevent the machine from running
out of disks. Moreover, the query performance may downgrade as the total number
of files goes up and the memory usage also increase as there are more files.
Timely removing such files helps to keep at a high query performance level and
reduce memory usage.
The default unit of TTL is milliseconds. If the time precision in the
configuration file changes to another, the TTL is still set to milliseconds.
-## Set TTL
-
-The SQL Statement for setting TTL is as follow:
-
-```
-IoTDB> set ttl to root.ln 3600000
-```
+When setting TTL, the system will look for all devices included in the set
path and set TTL time for these devices. The system will delete expired data at
the device granularity.
Review Comment:
set path -> path
TTL time -> TTL
##########
src/UserGuide/Master/stage/Delete-Data/TTL.md:
##########
@@ -21,29 +21,42 @@
# TTL
-IoTDB supports storage-level TTL settings, which means it is able to delete
old data automatically and periodically. The benefit of using TTL is that
hopefully you can control the total disk space usage and prevent the machine
from running out of disks. Moreover, the query performance may downgrade as the
total number of files goes up and the memory usage also increase as there are
more files. Timely removing such files helps to keep at a high query
performance level and reduce memory usage.
+IoTDB supports device-level TTL settings, which means it is able to delete old
data automatically and periodically. The benefit of using TTL is that hopefully
you can control the total disk space usage and prevent the machine from running
out of disks. Moreover, the query performance may downgrade as the total number
of files goes up and the memory usage also increase as there are more files.
Timely removing such files helps to keep at a high query performance level and
reduce memory usage.
The default unit of TTL is milliseconds. If the time precision in the
configuration file changes to another, the TTL is still set to milliseconds.
-## Set TTL
-
-The SQL Statement for setting TTL is as follow:
-
-```
-IoTDB> set ttl to root.ln 3600000
-```
+When setting TTL, the system will look for all devices included in the set
path and set TTL time for these devices. The system will delete expired data at
the device granularity.
+After the device data expires, it will not be queryable, but the data in the
disk file cannot be guaranteed to be deleted immediately (it will be deleted
within a certain time), but it can be guaranteed to be deleted eventually.
+Considering the operational cost, the system will not immediately physically
delete data exceeding TTL, but will delay physical deletion through merging.
Therefore, before the data is physically deleted, if the TTL is reduced or
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached,
some TTL rules need to be deleted before new rules can be set.
-This example means that for data in `root.ln`, only 3600000 ms, that is, the
latest 1 hour will remain, the older one is removed or made invisible.
-
-```
-IoTDB> set ttl to root.sgcc.** 3600000
+## TTL Path Rule
+The set path only supports prefix paths (i.e., the path cannot contain \* and
\*\*, and must end with \*\*).
Review Comment:
The word "set" has too many meanings, which is confusing.
"The path can only be prefix paths..." should be enough.
"cannot contain \* and \*\*" and "must end with \*\*)" conflict.
should be "cannot contain \* and \*\* except the last level"
##########
src/UserGuide/Master/stage/Delete-Data/TTL.md:
##########
@@ -21,29 +21,42 @@
# TTL
-IoTDB supports storage-level TTL settings, which means it is able to delete
old data automatically and periodically. The benefit of using TTL is that
hopefully you can control the total disk space usage and prevent the machine
from running out of disks. Moreover, the query performance may downgrade as the
total number of files goes up and the memory usage also increase as there are
more files. Timely removing such files helps to keep at a high query
performance level and reduce memory usage.
+IoTDB supports device-level TTL settings, which means it is able to delete old
data automatically and periodically. The benefit of using TTL is that hopefully
you can control the total disk space usage and prevent the machine from running
out of disks. Moreover, the query performance may downgrade as the total number
of files goes up and the memory usage also increase as there are more files.
Timely removing such files helps to keep at a high query performance level and
reduce memory usage.
The default unit of TTL is milliseconds. If the time precision in the
configuration file changes to another, the TTL is still set to milliseconds.
-## Set TTL
-
-The SQL Statement for setting TTL is as follow:
-
-```
-IoTDB> set ttl to root.ln 3600000
-```
+When setting TTL, the system will look for all devices included in the set
path and set TTL time for these devices. The system will delete expired data at
the device granularity.
+After the device data expires, it will not be queryable, but the data in the
disk file cannot be guaranteed to be deleted immediately (it will be deleted
within a certain time), but it can be guaranteed to be deleted eventually.
+Considering the operational cost, the system will not immediately physically
delete data exceeding TTL, but will delay physical deletion through merging.
Therefore, before the data is physically deleted, if the TTL is reduced or
lifted, it may cause data that was previously invisible due to TTL to reappear.
Review Comment:
This sentence says similar things to the previous sentence, may merge them.
Possible revision:
After the device data expires, it will not be queryable.
However, due to operational costs, the expired data will not be physically
deleted right after expiring.
The physical deletion is delayed until compaction.
Therefore...
##########
src/UserGuide/Master/stage/Delete-Data/TTL.md:
##########
@@ -21,29 +21,42 @@
# TTL
-IoTDB supports storage-level TTL settings, which means it is able to delete
old data automatically and periodically. The benefit of using TTL is that
hopefully you can control the total disk space usage and prevent the machine
from running out of disks. Moreover, the query performance may downgrade as the
total number of files goes up and the memory usage also increase as there are
more files. Timely removing such files helps to keep at a high query
performance level and reduce memory usage.
+IoTDB supports device-level TTL settings, which means it is able to delete old
data automatically and periodically. The benefit of using TTL is that hopefully
you can control the total disk space usage and prevent the machine from running
out of disks. Moreover, the query performance may downgrade as the total number
of files goes up and the memory usage also increase as there are more files.
Timely removing such files helps to keep at a high query performance level and
reduce memory usage.
The default unit of TTL is milliseconds. If the time precision in the
configuration file changes to another, the TTL is still set to milliseconds.
-## Set TTL
-
-The SQL Statement for setting TTL is as follow:
-
-```
-IoTDB> set ttl to root.ln 3600000
-```
+When setting TTL, the system will look for all devices included in the set
path and set TTL time for these devices. The system will delete expired data at
the device granularity.
+After the device data expires, it will not be queryable, but the data in the
disk file cannot be guaranteed to be deleted immediately (it will be deleted
within a certain time), but it can be guaranteed to be deleted eventually.
+Considering the operational cost, the system will not immediately physically
delete data exceeding TTL, but will delay physical deletion through merging.
Therefore, before the data is physically deleted, if the TTL is reduced or
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached,
some TTL rules need to be deleted before new rules can be set.
-This example means that for data in `root.ln`, only 3600000 ms, that is, the
latest 1 hour will remain, the older one is removed or made invisible.
-
-```
-IoTDB> set ttl to root.sgcc.** 3600000
+## TTL Path Rule
+The set path only supports prefix paths (i.e., the path cannot contain \* and
\*\*, and must end with \*\*).
+This path will match devices and also allows users to specify paths without
asterisks as specific databases or devices.
+When the path does not contain asterisks, it will check if it matches a
database; if it matches a database, both the path and path.\*\* will be set at
the same time. Note: Device TTL settings do not verify the existence of
metadata, i.e., it is allowed to set TTL for a non-existent device.
```
-It supports setting TTL for databases in a path. This example represents
setting TTL for all databases in the `root.sgcc` path.
+qualified path:
Review Comment:
path -> paths
##########
src/UserGuide/Master/stage/Delete-Data/TTL.md:
##########
@@ -21,29 +21,42 @@
# TTL
-IoTDB supports storage-level TTL settings, which means it is able to delete
old data automatically and periodically. The benefit of using TTL is that
hopefully you can control the total disk space usage and prevent the machine
from running out of disks. Moreover, the query performance may downgrade as the
total number of files goes up and the memory usage also increase as there are
more files. Timely removing such files helps to keep at a high query
performance level and reduce memory usage.
+IoTDB supports device-level TTL settings, which means it is able to delete old
data automatically and periodically. The benefit of using TTL is that hopefully
you can control the total disk space usage and prevent the machine from running
out of disks. Moreover, the query performance may downgrade as the total number
of files goes up and the memory usage also increase as there are more files.
Timely removing such files helps to keep at a high query performance level and
reduce memory usage.
The default unit of TTL is milliseconds. If the time precision in the
configuration file changes to another, the TTL is still set to milliseconds.
-## Set TTL
-
-The SQL Statement for setting TTL is as follow:
-
-```
-IoTDB> set ttl to root.ln 3600000
-```
+When setting TTL, the system will look for all devices included in the set
path and set TTL time for these devices. The system will delete expired data at
the device granularity.
+After the device data expires, it will not be queryable, but the data in the
disk file cannot be guaranteed to be deleted immediately (it will be deleted
within a certain time), but it can be guaranteed to be deleted eventually.
+Considering the operational cost, the system will not immediately physically
delete data exceeding TTL, but will delay physical deletion through merging.
Therefore, before the data is physically deleted, if the TTL is reduced or
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached,
some TTL rules need to be deleted before new rules can be set.
-This example means that for data in `root.ln`, only 3600000 ms, that is, the
latest 1 hour will remain, the older one is removed or made invisible.
-
-```
-IoTDB> set ttl to root.sgcc.** 3600000
+## TTL Path Rule
+The set path only supports prefix paths (i.e., the path cannot contain \* and
\*\*, and must end with \*\*).
+This path will match devices and also allows users to specify paths without
asterisks as specific databases or devices.
+When the path does not contain asterisks, it will check if it matches a
database; if it matches a database, both the path and path.\*\* will be set at
the same time. Note: Device TTL settings do not verify the existence of
metadata, i.e., it is allowed to set TTL for a non-existent device.
Review Comment:
"it will check if it matches a database" the two "it"s refer to different
things, which is confusing.
it will check -> the system will check
##########
src/UserGuide/Master/stage/Delete-Data/TTL.md:
##########
@@ -21,29 +21,42 @@
# TTL
-IoTDB supports storage-level TTL settings, which means it is able to delete
old data automatically and periodically. The benefit of using TTL is that
hopefully you can control the total disk space usage and prevent the machine
from running out of disks. Moreover, the query performance may downgrade as the
total number of files goes up and the memory usage also increase as there are
more files. Timely removing such files helps to keep at a high query
performance level and reduce memory usage.
+IoTDB supports device-level TTL settings, which means it is able to delete old
data automatically and periodically. The benefit of using TTL is that hopefully
you can control the total disk space usage and prevent the machine from running
out of disks. Moreover, the query performance may downgrade as the total number
of files goes up and the memory usage also increase as there are more files.
Timely removing such files helps to keep at a high query performance level and
reduce memory usage.
The default unit of TTL is milliseconds. If the time precision in the
configuration file changes to another, the TTL is still set to milliseconds.
-## Set TTL
-
-The SQL Statement for setting TTL is as follow:
-
-```
-IoTDB> set ttl to root.ln 3600000
-```
+When setting TTL, the system will look for all devices included in the set
path and set TTL time for these devices. The system will delete expired data at
the device granularity.
+After the device data expires, it will not be queryable, but the data in the
disk file cannot be guaranteed to be deleted immediately (it will be deleted
within a certain time), but it can be guaranteed to be deleted eventually.
Review Comment:
"(it will be deleted within a certain time)" seems confusing, may should
remove it.
"cannot be guaranteed to be deleted immediately, but it can be guaranteed to
be deleted eventually."
And, there are two "but"s in this sentence, break it into two sentences.
##########
src/UserGuide/Master/stage/Delete-Data/TTL.md:
##########
@@ -21,29 +21,42 @@
# TTL
-IoTDB supports storage-level TTL settings, which means it is able to delete
old data automatically and periodically. The benefit of using TTL is that
hopefully you can control the total disk space usage and prevent the machine
from running out of disks. Moreover, the query performance may downgrade as the
total number of files goes up and the memory usage also increase as there are
more files. Timely removing such files helps to keep at a high query
performance level and reduce memory usage.
+IoTDB supports device-level TTL settings, which means it is able to delete old
data automatically and periodically. The benefit of using TTL is that hopefully
you can control the total disk space usage and prevent the machine from running
out of disks. Moreover, the query performance may downgrade as the total number
of files goes up and the memory usage also increase as there are more files.
Timely removing such files helps to keep at a high query performance level and
reduce memory usage.
The default unit of TTL is milliseconds. If the time precision in the
configuration file changes to another, the TTL is still set to milliseconds.
-## Set TTL
-
-The SQL Statement for setting TTL is as follow:
-
-```
-IoTDB> set ttl to root.ln 3600000
-```
+When setting TTL, the system will look for all devices included in the set
path and set TTL time for these devices. The system will delete expired data at
the device granularity.
+After the device data expires, it will not be queryable, but the data in the
disk file cannot be guaranteed to be deleted immediately (it will be deleted
within a certain time), but it can be guaranteed to be deleted eventually.
+Considering the operational cost, the system will not immediately physically
delete data exceeding TTL, but will delay physical deletion through merging.
Therefore, before the data is physically deleted, if the TTL is reduced or
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached,
some TTL rules need to be deleted before new rules can be set.
-This example means that for data in `root.ln`, only 3600000 ms, that is, the
latest 1 hour will remain, the older one is removed or made invisible.
-
-```
-IoTDB> set ttl to root.sgcc.** 3600000
+## TTL Path Rule
+The set path only supports prefix paths (i.e., the path cannot contain \* and
\*\*, and must end with \*\*).
+This path will match devices and also allows users to specify paths without
asterisks as specific databases or devices.
+When the path does not contain asterisks, it will check if it matches a
database; if it matches a database, both the path and path.\*\* will be set at
the same time. Note: Device TTL settings do not verify the existence of
metadata, i.e., it is allowed to set TTL for a non-existent device.
```
-It supports setting TTL for databases in a path. This example represents
setting TTL for all databases in the `root.sgcc` path.
+qualified path:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+unqualified path:
+root.*.db
+root.**.db.*
+root.db.*
```
-IoTDB> set ttl to root.** 3600000
-```
-This example represents setting TTL for all databases.
-
+## TTL Applicable Rules
+When a device is subject to multiple TTL rules, the more precise and longer
rules are prioritized. For example, for the device
"root.bj.hd.dist001.turbine001", the rule "root.bj.hd.dist001.turbine001" takes
precedence over "root.bj.hd.dist001.\*\*", and the rule
"root.bj.hd.dist001.\*\*" takes precedence over "root.bj.hd.**".
+## Set TTL
+The set ttl operation can be understood as setting a TTL rule, for example,
setting ttl to root.sg.group1.** is equivalent to mounting ttl for all devices
that can match this path pattern.
+The unset ttl operation indicates unmounting TTL for the corresponding path
pattern; if there is no corresponding TTL, nothing will be done.
+If you want to set TTL to be infinitely large, you can use the INF keyword.
+The SQL Statement for setting TTL is as follow:
+Set the Time to Live (TTL) to a prefix path of 360,000 milliseconds; the
prefix path should not contain a wildcard (\*) and must end with a double
asterisk (\*\*). The prefix path is used to match corresponding devices.
Review Comment:
should not contain a wildcard in the middle
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]