yangzhg commented on code in PR #10338:
URL: https://github.com/apache/doris/pull/10338#discussion_r903633395


##########
fe/fe-core/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java:
##########
@@ -339,6 +341,25 @@ private static void 
checkReservedHistoryPeriodValidate(String reservedHistoryPer
         }
     }
 
+    private static void checkRemoteStoragePolicy(String val) throws 
DdlException {
+        if (Strings.isNullOrEmpty(val)) {
+            LOG.info(DynamicPartitionProperty.REMOTE_STORAGE_POLICY + " is 
null, remove this key");
+            return;
+        }
+        if (val.isEmpty()) {
+            throw new 
DdlException(DynamicPartitionProperty.REMOTE_STORAGE_POLICY + " is empty.");
+        }
+        StoragePolicy checkedPolicyCondition = new 
StoragePolicy(PolicyTypeEnum.STORAGE, val);
+        if 
(!Catalog.getCurrentCatalog().getPolicyMgr().existPolicy(checkedPolicyCondition))
 {
+            throw new 
DdlException(DynamicPartitionProperty.REMOTE_STORAGE_POLICY + ": " + val + " 
doesn't exist.");
+        }
+        StoragePolicy storagePolicy = (StoragePolicy) 
Catalog.getCurrentCatalog()
+                .getPolicyMgr().getPolicy(checkedPolicyCondition);
+        if (Strings.isNullOrEmpty(storagePolicy.getCooldownTtl())) {
+            throw new 
DdlException(DynamicPartitionProperty.REMOTE_STORAGE_POLICY + ": " + val + " 
need to be ttl.");

Review Comment:
   what does to be ttl mean?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to