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


##########
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:
   We could support it, like adding a flag to indicate whether it's aux mode?
   ```
   public interface GravitinoAuxiliaryService {
     void serviceInit(Map<String, String> config, bool auxMode);
   }
   ```



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