szehon-ho commented on code in PR #11437:
URL: https://github.com/apache/iceberg/pull/11437#discussion_r1824969871


##########
core/src/main/java/org/apache/iceberg/util/PropertyUtil.java:
##########
@@ -100,6 +102,30 @@ public static String propertyAsString(
     return defaultValue;
   }
 
+  /**
+   * Validate the table commit related properties to have non-negative integer 
on table creation to
+   * prevent commit failure
+   *
+   * @param properties input map

Review Comment:
   nit: more descriptive param doc , like key-value map of properties, or just 
remove this ?



##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -486,6 +489,10 @@ public int propertyAsInt(String property, int 
defaultValue) {
     return PropertyUtil.propertyAsInt(properties, property, defaultValue);
   }
 
+  public int propertyTryAsInt(String property, int defaultValue) {
+    return NumberUtils.toInt(property, defaultValue);

Review Comment:
   Looks like we do not want unnecessary dependencies, and commons.lang3 was 
explicitly removed once:  https://github.com/apache/iceberg/issues/2100.  so 
let's just manually code it here



##########
core/src/main/java/org/apache/iceberg/util/PropertyUtil.java:
##########
@@ -100,6 +102,30 @@ public static String propertyAsString(
     return defaultValue;
   }
 
+  /**
+   * Validate the table commit related properties to have non-negative integer 
on table creation to
+   * prevent commit failure
+   *
+   * @param properties input map
+   */
+  public static void validateCommitProperties(Map<String, String> properties) {
+    for (String commitProperty : TableProperties.COMMIT_PROPERTIES) {

Review Comment:
   entirely stylistic, will stream, filter be cleaner?



##########
core/src/main/java/org/apache/iceberg/TableProperties.java:
##########
@@ -95,6 +95,13 @@ private TableProperties() {}
   public static final String COMMIT_TOTAL_RETRY_TIME_MS = 
"commit.retry.total-timeout-ms";
   public static final int COMMIT_TOTAL_RETRY_TIME_MS_DEFAULT = 30 * 60 * 1000; 
// 30 minutes
 
+  public static final Set<String> COMMIT_PROPERTIES =

Review Comment:
   No need for public?



-- 
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: issues-unsubscr...@iceberg.apache.org

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


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

Reply via email to