merlimat commented on a change in pull request #10803:
URL: https://github.com/apache/pulsar/pull/10803#discussion_r644817992
##########
File path:
pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperStarter.java
##########
@@ -18,49 +18,11 @@
*/
package org.apache.pulsar.zookeeper;
-import java.net.InetSocketAddress;
-
import org.apache.zookeeper.server.quorum.QuorumPeerMain;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import io.prometheus.client.exporter.MetricsServlet;
-import io.prometheus.client.hotspot.DefaultExports;
public class ZooKeeperStarter {
public static void main(String[] args) throws Exception {
- start(args, "8000");
- }
-
- protected static void start(String[] args, String defaultStatsPort) throws
Exception {
- // Register basic JVM metrics
- DefaultExports.initialize();
-
- // Start Jetty to serve stats
- int port =
Integer.parseInt(System.getProperties().getProperty("stats_server_port",
defaultStatsPort));
-
- log.info("Starting ZK stats HTTP server at port {}", port);
- InetSocketAddress httpEndpoint =
InetSocketAddress.createUnresolved("0.0.0.0", port);
-
- Server server = new Server(httpEndpoint);
- ServletContextHandler context = new ServletContextHandler();
- context.setContextPath("/");
- server.setHandler(context);
- context.addServlet(new ServletHolder(new MetricsServlet()),
"/metrics");
- try {
- server.start();
- } catch (Exception e) {
- log.error("Failed to start HTTP server at port {}. Use
\"-Dstats_server_port=1234\" to change port number",
- port, e);
- throw e;
- }
-
// Start the regular ZooKeeper server
QuorumPeerMain.main(args);
Review comment:
Since there is nothing left in this class, we can remove it and just
call QuorumMain from the CLI scripts
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]