deniskuzZ commented on code in PR #5606:
URL: https://github.com/apache/hive/pull/5606#discussion_r1976665296


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java:
##########
@@ -730,11 +768,44 @@ public static void startMetaStore(int port, 
HadoopThriftAuthBridge bridge,
         throw e;
       }
     }
-    // optionally create and start the property server and servlet
-    propertyServer = PropertyServlet.startServer(conf);
-
+    // optionally create and start the property and Iceberg REST server
+    ServletServerBuilder builder = new ServletServerBuilder(conf);
+    ServletServerBuilder.Descriptor properties = 
PropertyServlet.createServlet(conf);
+    builder.addServlet(properties);
+    ServletServerBuilder.Descriptor catalog = createIcebergServlet(conf);
+    builder.addServlet(catalog);
+    servletServer = builder.start(LOG);
+    if (servletServer != null) {
+      if (properties != null) {
+          propertyServletPort = properties.getPort();
+      }
+      if (catalog != null) {
+        catalogServletPort = catalog.getPort();
+      }
+    }
+    // main server
     thriftServer.start();
   }
+  
+  /**
+   * Creates the Iceberg REST catalog servlet descriptor.
+   * @param configuration the configuration
+   * @return the servlet descriptor (can be null)
+   */
+  static ServletServerBuilder.Descriptor createIcebergServlet(Configuration 
configuration) {
+    try {
+      String className = MetastoreConf.getVar(configuration, 
ConfVars.ICEBERG_CATALOG_SERVLET_FACTORY);
+      Class<?> iceClazz = Class.forName(className);
+      Method iceStart = iceClazz.getMethod("createServlet", 
Configuration.class);
+      return (ServletServerBuilder.Descriptor) iceStart.invoke(null, 
configuration);
+    } catch (ClassNotFoundException xnf) {
+      LOG.warn("unable to start Iceberg REST Catalog server, missing jar?", 
xnf);

Review Comment:
   please start warn message with a capital latter



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java:
##########
@@ -730,11 +768,44 @@ public static void startMetaStore(int port, 
HadoopThriftAuthBridge bridge,
         throw e;
       }
     }
-    // optionally create and start the property server and servlet
-    propertyServer = PropertyServlet.startServer(conf);
-
+    // optionally create and start the property and Iceberg REST server
+    ServletServerBuilder builder = new ServletServerBuilder(conf);
+    ServletServerBuilder.Descriptor properties = 
PropertyServlet.createServlet(conf);
+    builder.addServlet(properties);
+    ServletServerBuilder.Descriptor catalog = createIcebergServlet(conf);
+    builder.addServlet(catalog);
+    servletServer = builder.start(LOG);
+    if (servletServer != null) {
+      if (properties != null) {
+          propertyServletPort = properties.getPort();
+      }
+      if (catalog != null) {
+        catalogServletPort = catalog.getPort();
+      }
+    }
+    // main server
     thriftServer.start();
   }
+  
+  /**
+   * Creates the Iceberg REST catalog servlet descriptor.
+   * @param configuration the configuration
+   * @return the servlet descriptor (can be null)
+   */
+  static ServletServerBuilder.Descriptor createIcebergServlet(Configuration 
configuration) {
+    try {
+      String className = MetastoreConf.getVar(configuration, 
ConfVars.ICEBERG_CATALOG_SERVLET_FACTORY);
+      Class<?> iceClazz = Class.forName(className);
+      Method iceStart = iceClazz.getMethod("createServlet", 
Configuration.class);
+      return (ServletServerBuilder.Descriptor) iceStart.invoke(null, 
configuration);
+    } catch (ClassNotFoundException xnf) {
+      LOG.warn("unable to start Iceberg REST Catalog server, missing jar?", 
xnf);

Review Comment:
   please start warn message with a capital letter



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to