[ https://issues.apache.org/jira/browse/KNOX-3154?focusedWorklogId=977492&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-977492 ]
ASF GitHub Bot logged work on KNOX-3154: ---------------------------------------- Author: ASF GitHub Bot Created on: 04/Aug/25 10:34 Start Date: 04/Aug/25 10:34 Worklog Time Spent: 10m Work Description: bonampak commented on code in PR #1057: URL: https://github.com/apache/knox/pull/1057#discussion_r2251084707 ########## gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/hive/IcebergRestServiceModelGenerator.java: ########## @@ -0,0 +1,115 @@ +/* + * 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.knox.gateway.topology.discovery.cm.model.hive; + +import com.cloudera.api.swagger.client.ApiException; +import com.cloudera.api.swagger.model.ApiConfigList; +import com.cloudera.api.swagger.model.ApiRole; +import com.cloudera.api.swagger.model.ApiService; +import com.cloudera.api.swagger.model.ApiServiceConfig; +import org.apache.knox.gateway.topology.discovery.cm.ServiceModel; +import org.apache.knox.gateway.topology.discovery.cm.ServiceModelGeneratorHandleResponse; +import org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGenerator; + +import java.util.Locale; + +public class IcebergRestServiceModelGenerator extends AbstractServiceModelGenerator { + + public static final String SERVICE = "ICEBERG-REST"; + public static final String SERVICE_TYPE = "HIVE"; + public static final String ROLE_TYPE = "HIVEMETASTORE"; + + static final String HTTP_PORT = "hive_metastore_catalog_servlet_port"; + static final String HTTP_PATH = "hive_metastore_catalog_servlet_path"; + static final String REST_CATALOG_ENABLED = "hive_rest_catalog_enabled"; + + static final String DEFAULT_HTTP_PATH = "icecli"; + + @Override + public String getService() { + return SERVICE; + } + + @Override + public String getServiceType() { + return SERVICE_TYPE; + } + + @Override + public String getRoleType() { + return ROLE_TYPE; + } + + @Override + public ServiceModel.Type getModelType() { + return ServiceModel.Type.API; + } + + @Override + public ServiceModelGeneratorHandleResponse handles(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) { + final ServiceModelGeneratorHandleResponse response = super.handles(service, serviceConfig, role, roleConfig); + if (response.handled()) { + validateCatalogEnabled(serviceConfig, response); + } + return response; + } + + @Override + public ServiceModel generateService(ApiService service, + ApiServiceConfig serviceConfig, + ApiRole role, + ApiConfigList roleConfig, ApiServiceConfig coreSettingsConfig) throws ApiException { + String hostname = role.getHostRef().getHostname(); + String scheme = "http"; + String port = getHttpPort(serviceConfig); Review Comment: It only has http. Once they add https, we'll add a separate PR. Issue Time Tracking ------------------- Worklog Id: (was: 977492) Time Spent: 20m (was: 10m) > Implement CM discovery support for the Apache Iceberg REST Catalog Service > -------------------------------------------------------------------------- > > Key: KNOX-3154 > URL: https://issues.apache.org/jira/browse/KNOX-3154 > Project: Apache Knox > Issue Type: Task > Affects Versions: 2.2.0 > Reporter: Tamás Marcinkovics > Assignee: Tamás Marcinkovics > Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > Implement CM discovery support for the Apache Iceberg REST Catalog Service so > topology contents can be generated. -- This message was sent by Atlassian Jira (v8.20.10#820010)