jerqi commented on code in PR #9827:
URL: https://github.com/apache/gravitino/pull/9827#discussion_r2759456147


##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/provider/DynamicIcebergConfigProvider.java:
##########
@@ -110,15 +103,44 @@ public Optional<IcebergConfig> 
getIcebergCatalogConfig(String catalogName) {
     return 
Optional.of(getIcebergConfigFromCatalogProperties(catalog.properties()));
   }
 
-  @VisibleForTesting
-  void setClient(GravitinoClient client) {
-    this.client = client;
+  /**
+   * Lazily creates the CatalogFetcher based on whether authorization is 
enabled. Uses internal
+   * interface when authorization is enabled, otherwise uses HTTP interface.
+   */
+  private CatalogFetcher getCatalogFetcher() {
+    if (catalogFetcher != null) {
+      return catalogFetcher;
+    }
+    synchronized (this) {
+      if (catalogFetcher == null) {
+        IcebergRESTServerContext serverContext = 
IcebergRESTServerContext.getInstance();
+        if (serverContext.isAuthorizationEnabled()) {

Review Comment:
   According to the communication with u, we don't have way to judge whether it 
is in aux mode. So we don't have better solution now.



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