choubenson commented on code in PR #12709:
URL: https://github.com/apache/iotdb/pull/12709#discussion_r1642877277


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TTLInfo.java:
##########
@@ -118,12 +120,19 @@ public TSStatus unsetTTL(SetTTLPlan plan) {
     return RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
   }
 
-  public ShowTTLResp showAllTTL() {
+  public ShowTTLResp showTTL(ShowTTLPlan plan) {
     ShowTTLResp resp = new ShowTTLResp();
-    Map<String, Long> pathTTLMap;
+    Map<String, Long> pathTTLMap = new HashMap<>();
     lock.readLock().lock();
     try {
-      pathTTLMap = ttlCache.getAllPathTTL();
+      PartialPath pathPattern = new PartialPath(plan.getPathPattern());
+      for (Map.Entry<String[], Long> entry : ttlCache.getAllTTLs().entrySet()) 
{
+        if (pathPattern.matchFullPath(new PartialPath(entry.getKey()))) {
+          pathTTLMap.put(
+              String.join(String.valueOf(IoTDBConstant.PATH_SEPARATOR), 
entry.getKey()),
+              entry.getValue());
+        }

Review Comment:
   Resolved, `matchFullPath(String[])` has been added in PartialPath.



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