FANNG1 commented on code in PR #7444:
URL: https://github.com/apache/gravitino/pull/7444#discussion_r2157884020
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergConfigOperations.java:
##########
@@ -40,13 +45,30 @@ public class IcebergConfigOperations {
@SuppressWarnings("UnusedVariable")
@Context
private HttpServletRequest httpRequest;
+ private final IcebergCatalogWrapperManager catalogWrapperManager;
+
+ @Inject
+ public IcebergConfigOperations(IcebergCatalogWrapperManager
catalogWrapperManager) {
+ this.catalogWrapperManager = catalogWrapperManager;
+ }
@GET
@Produces(MediaType.APPLICATION_JSON)
@Timed(name = "config." + MetricNames.HTTP_PROCESS_DURATION, absolute = true)
@ResponseMetered(name = "config", absolute = true)
- public Response getConfig() {
- ConfigResponse response = ConfigResponse.builder().build();
+ public Response getConfig(@DefaultValue("") @QueryParam("warehouse") String
warehouse) {
+ if (warehouse == null || warehouse.isEmpty()) {
+ ConfigResponse response = ConfigResponse.builder().build();
+ return IcebergRestUtils.ok(response);
+ }
+
+ // Get the catalog wrapper which contains the configuration
+ CatalogWrapperForREST catalogWrapper =
catalogWrapperManager.getCatalogWrapper(warehouse);
Review Comment:
What's the behavior of the Spark client if the `warehouse` is not the
catalog name?
--
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]