bharos commented on code in PR #10116:
URL: https://github.com/apache/gravitino/pull/10116#discussion_r2871802391


##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergTableEventDispatcher.java:
##########
@@ -77,10 +78,10 @@ public class IcebergTableEventDispatcher implements 
IcebergTableOperationDispatc
   public IcebergTableEventDispatcher(
       IcebergTableOperationDispatcher icebergTableOperationDispatcher,
       EventBus eventBus,
-      String metalakeName) {
+      Optional<String> metalakeName) {
     this.icebergTableOperationDispatcher = icebergTableOperationDispatcher;
     this.eventBus = eventBus;
-    this.metalakeName = metalakeName;
+    this.metalakeName = 
metalakeName.orElse(IcebergConstants.ICEBERG_REST_DEFAULT_METALAKE);

Review Comment:
   I think this will  now become null for static-config-provider.
   In that case, should we use ICEBERG_REST_DEFAULT_METALAKE
   
   Otherwise, I am not sure if it causes backward incompatibility



##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergNamespaceOperations.java:
##########
@@ -115,7 +115,8 @@ public Response listNamespaces(
             IcebergRESTServerContext authContext = 
IcebergRESTServerContext.getInstance();
             if (authContext.isAuthorizationEnabled()) {
               response =
-                  filterListNamespacesResponse(response, 
authContext.metalakeName(), catalogName);
+                  filterListNamespacesResponse(
+                      response, authContext.metalakeName().orElse(null), 
catalogName);

Review Comment:
   Here also, if it is null, it can fail during NameIdentifier creation like 
here:
   
https://github.com/apache/gravitino/blob/7baafec434ebd5ddb4d54331a540321fd9cff85a/api/src/main/java/org/apache/gravitino/NameIdentifier.java#L49



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