jt2594838 commented on code in PR #12122:
URL: https://github.com/apache/iotdb/pull/12122#discussion_r1580436509
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java:
##########
@@ -516,6 +516,24 @@ public class IoTDBConfig {
/** The interval of compaction task schedulation in each virtual database.
The unit is ms. */
private long compactionScheduleIntervalInMs = 60_000L;
+ /** The interval of ttl check task in each database. The unit is ms. Default
is 2 hours. */
+ private long ttlCheckInterval = 7_200_000L;
+
+ /** The number of threads to be set up to check ttl. */
+ private int ttlCheckerNum = 1;
+
+ /**
+ * The max expired time of device set with ttl. If the expired time exceeds
this value, then
+ * expired data will be cleaned by compaction. The unit is ms. Default is 1
month.
+ */
+ private long maxExpiredTime = 2_592_000_000L;
+
+ /**
+ * The expired device rate. If the number of expired device in one tsfile
exceeds this value, then
+ * expired data of this tsfile will be cleaned by compaction.
+ */
+ private float expiredDataRate = 0.3f;
+
Review Comment:
Previous issues seem to reappear.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/schema/source/DeviceSchemaSource.java:
##########
@@ -98,6 +100,8 @@ public void transformToTsBlockColumns(
.getColumnBuilder(0)
.writeBinary(new Binary(device.getFullPath(),
TSFileConfig.STRING_CHARSET));
int templateId = device.getTemplateId();
+ long ttl = DataNodeTTLCache.getInstance().getTTL(device.getFullPath());
+ String ttlStr = ttl == Long.MAX_VALUE ? IoTDBConstant.TTL_INFINITE :
String.valueOf(ttl);
Review Comment:
Better to add a todo here, in case of forgetting.
--
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]