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


##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/IcebergConfig.java:
##########
@@ -205,7 +205,7 @@ public class IcebergConfig extends Config implements 
OverwriteDefaultConfig {
   public static final ConfigEntry<String> ICEBERG_REST_CATALOG_CONFIG_PROVIDER 
=
       new ConfigBuilder(IcebergConstants.ICEBERG_REST_CATALOG_CONFIG_PROVIDER)
           .doc(
-              "Catalog provider class name, you can develop a class that 
implements `IcebergCatalogConfigProvider` and add the corresponding jar file to 
the Iceberg REST service classpath directory.")
+              "Catalog provider class name, you can develop a class that 
implements `IcebergConfigProvider` and add the corresponding jar file to the 
Iceberg REST service classpath directory.")

Review Comment:
   updated



##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/RESTService.java:
##########
@@ -70,14 +77,25 @@ private void initServer(IcebergConfig icebergConfig) {
         new 
HttpServerMetricsSource(MetricsSource.ICEBERG_REST_SERVER_METRIC_NAME, config, 
server);
     metricsSystem.register(httpServerMetricsSource);
 
-    icebergCatalogWrapperManager = new 
IcebergCatalogWrapperManager(icebergConfig.getAllConfig());
-    icebergMetricsManager = new IcebergMetricsManager(icebergConfig);
+    Map<String, String> configProperties = icebergConfig.getAllConfig();
+    EventBus eventBus = GravitinoEnv.getInstance().eventBus();
+    this.configProvider = 
IcebergConfigProviderFactory.create(configProperties);
+    configProvider.initialize(configProperties);
+    String metalakeName = configProvider.getMetalakeName();
+    this.icebergCatalogWrapperManager =
+        new IcebergCatalogWrapperManager(configProperties, configProvider);
+    this.icebergMetricsManager = new IcebergMetricsManager(icebergConfig);
+    IcebergTableOperationExecutor icebergTableOperationExecutor =
+        new IcebergTableOperationExecutor(icebergCatalogWrapperManager);
+    IcebergTableEventDispatcher icebergTableEventDispatcher =
+        new IcebergTableEventDispatcher(icebergTableOperationExecutor, 
eventBus, metalakeName);

Review Comment:
   updated



##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/provider/IcebergConfigProviderFactory.java:
##########
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.iceberg.service.provider;
+
+import com.google.common.collect.ImmutableMap;
+import java.util.Map;
+import org.apache.gravitino.catalog.lakehouse.iceberg.IcebergConstants;
+import org.apache.gravitino.iceberg.common.IcebergConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergConfigProviderFactory {
+  public static final Logger LOG = 
LoggerFactory.getLogger(IcebergConfigProviderFactory.class);
+  private static final ImmutableMap<String, String> 
ICEBERG_CATALOG_CONFIG_PROVIDER_NAMES =

Review Comment:
   updated



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