JingsongLi commented on code in PR #4884:
URL: https://github.com/apache/paimon/pull/4884#discussion_r1950146933


##########
paimon-common/src/main/java/org/apache/paimon/CoreOptions.java:
##########
@@ -2241,6 +2271,61 @@ public boolean writeOnly() {
         return options.get(WRITE_ONLY);
     }
 
+    public Set<WriteAction> writeActions() {
+        if (writeOnly()) {
+            return new HashSet<>(0);
+        }
+        return writeActions(options.get(WRITE_ACTIONS));
+    }
+
+    public static Set<WriteAction> writeActions(String str) {
+        if (StringUtils.isNullOrWhitespaceOnly(str)) {
+            return new HashSet<>(0);
+        }
+        return Arrays.stream(str.split(","))
+                .map(action -> 
WriteAction.valueOf(action.toUpperCase().replace('-', '_')))
+                .collect(Collectors.toCollection(HashSet::new));
+    }
+
+    public boolean doPartitionExpireAction(Set<WriteAction> doWriteActions) {
+        return doAllWriteActions(doWriteActions)
+                || doWriteActions.contains(WriteAction.PARTITION_EXPIRE);
+    }
+
+    public boolean doSnapshotExpireAction(Set<WriteAction> doWriteActions) {

Review Comment:
   All these methods can be in `WriteAction`, they are just static methods.



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