You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/03/19 02:40:41 UTC
[GitHub] [pulsar] murong00 commented on a change in pull request #3853:
[Issue 3851] [pulsar-broker] Support to start broker use the port
initialized in cluster metadata
murong00 commented on a change in pull request #3853: [Issue 3851] [pulsar-broker] Support to start broker use the port initialized in cluster metadata
URL: https://github.com/apache/pulsar/pull/3853#discussion_r266712376
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java
##########
@@ -110,6 +115,23 @@ private static boolean argsContains(String[] args, String arg) {
return Arrays.asList(args).contains(arg);
}
+ private static ClusterData retrieveClusterData(ServiceConfiguration config) throws Exception {
+ String configurationStoreServers = config.getConfigurationStoreServers();
+ Long zkSessionTimeoutMillis = config.getZooKeeperSessionTimeoutMillis();
+ String clusterName = config.getClusterName();
+ ZooKeeperClientFactory zkfactory = new ZookeeperClientFactoryImpl();
+ ZooKeeper configStoreZk = zkfactory.create(
+ configurationStoreServers, ZooKeeperClientFactory.SessionType.ReadWrite, zkSessionTimeoutMillis.intValue()).get();
+ byte[] metadata = configStoreZk.getData("/admin/clusters/" + clusterName, false, null);
+ ClusterData clusterData = ObjectMapperFactory.getThreadLocal().readValue(metadata, ClusterData.class);
+ return clusterData;
+ }
+
+ private static int retrievePort(String url) {
+ String[] uris = url.split(":");
+ return Integer.parseInt(uris[uris.length-1]);
Review comment:
thanks for the help.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services