yihua commented on code in PR #13103:
URL: https://github.com/apache/hudi/pull/13103#discussion_r2034152069


##########
hudi-io/src/main/java/org/apache/hudi/storage/StorageSchemes.java:
##########
@@ -143,4 +154,12 @@ public static boolean isListStatusFriendly(String scheme) {
 
     return LIST_STATUS_FRIENDLY_SCHEMES.contains(scheme);
   }
-}
+
+  public static boolean isConditionalWriteSupported(String scheme) {
+    if (!isSchemeSupported(scheme)) {
+      throw new IllegalArgumentException("Unsupported scheme :" + scheme);
+    }
+    return Arrays.stream(StorageSchemes.values())
+        .anyMatch(s -> s.isConditionalWriteSupported() && 
s.scheme.equals(scheme));
+  }
+}

Review Comment:
   nit: new line



##########
hudi-hadoop-common/src/test/java/org/apache/hudi/common/fs/TestStorageSchemes.java:
##########
@@ -39,6 +39,10 @@ public void testStorageSchemes() {
     assertTrue(StorageSchemes.isSchemeSupported("afs"));
     assertFalse(StorageSchemes.isSchemeSupported("s2"));
 
+    assertTrue(StorageSchemes.isConditionalWriteSupported("s3"));
+    assertTrue(StorageSchemes.isConditionalWriteSupported("s3a"));
+    assertTrue(StorageSchemes.isConditionalWriteSupported("gs"));
+

Review Comment:
   Add a `assertFalse` on one of the file storage scheme that does not support 
conditional writes?



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