roryqi commented on code in PR #10671:
URL: https://github.com/apache/gravitino/pull/10671#discussion_r3295837240


##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/ops/IcebergCatalogWrapper.java:
##########
@@ -451,6 +471,61 @@ public IcebergTableChange(TableIdentifier tableIdentifier, 
Transaction transacti
     }
   }
 
+  private int parsePageToken(@Nullable String pageToken) {
+    if (pageToken == null || pageToken.isEmpty()) {
+      return 0;
+    }
+    try {
+      int offset = Integer.parseInt(pageToken);
+      Preconditions.checkArgument(offset >= 0, "pageToken must be 
non-negative, got: %s", offset);
+      return offset;
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException("Invalid pageToken: " + pageToken, e);
+    }
+  }
+
+  private ListNamespacesResponse paginateNamespaces(

Review Comment:
   Could we extract some common logic for `paginateNamespaces` and 
`paginateTables`?



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