SLIDER-388 allow default zookeeper port in ZookeeperUtils
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/b525287d Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/b525287d Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/b525287d Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry Commit: b525287dd05a29af6308890aef44d524a6341296 Parents: 0ac2536 Author: Billie Rinaldi <billie.rina...@gmail.com> Authored: Tue Sep 2 12:39:06 2014 -0700 Committer: Billie Rinaldi <billie.rina...@gmail.com> Committed: Tue Sep 2 12:39:06 2014 -0700 ---------------------------------------------------------------------- .../src/main/java/org/apache/slider/core/zk/ZookeeperUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b525287d/slider-core/src/main/java/org/apache/slider/core/zk/ZookeeperUtils.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/core/zk/ZookeeperUtils.java b/slider-core/src/main/java/org/apache/slider/core/zk/ZookeeperUtils.java index 61b1ff0..cc1b2c9 100644 --- a/slider-core/src/main/java/org/apache/slider/core/zk/ZookeeperUtils.java +++ b/slider-core/src/main/java/org/apache/slider/core/zk/ZookeeperUtils.java @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.List; public class ZookeeperUtils { + public static final int DEFAULT_PORT = 2181; public static String buildConnectionString(String zkHosts, int port) { String zkPort = Integer.toString(port); @@ -73,7 +74,7 @@ public class ZookeeperUtils { List<HostAndPort> list = new ArrayList<HostAndPort>(len); if (strings != null) { for (String s : strings) { - list.add(HostAndPort.fromString(s.trim())); + list.add(HostAndPort.fromString(s.trim()).withDefaultPort(DEFAULT_PORT)); } } return list;