CRZbulabula commented on code in PR #14737:
URL: https://github.com/apache/iotdb/pull/14737#discussion_r1924821645


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java:
##########
@@ -1448,6 +1464,54 @@ public void stopRegionCleaner() {
     }
   }
 
+  /**
+   * The ConfigNode-leader will periodically invoke this interface to 
automatically clean expired
+   * partition table.
+   */
+  public void autoCleanDataPartitionTable() {
+    List<String> databases = getClusterSchemaManager().getDatabaseNames(null);
+    Map<String, Long> databaseTTLMap = 
getClusterSchemaManager().getTTLInfoForUpgrading();
+    for (String database : databases) {
+      long subTreeMaxTTL = getTTLManager().getDatabaseMaxTTL(database);
+      databaseTTLMap.put(
+          database, Math.max(subTreeMaxTTL, 
databaseTTLMap.getOrDefault(database, -1L)));

Review Comment:
   Thanks for pinpointing this logic enhancement. The judgement is available at 
PartitionTableAutoCleaner.



-- 
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]

Reply via email to