public class ZookeeperUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
| Constructor and Description |
|---|
ZookeeperUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildConnectionString(String zkHosts,
int port) |
static String |
buildHostsOnlyList(List<com.google.common.net.HostAndPort> hostAndPorts)
Build up to a hosts only list
|
static String |
buildQuorum(List<com.google.common.net.HostAndPort> hostAndPorts,
int defaultPort)
Build a quorum list, injecting a ":defaultPort" ref if needed on
any entry without one
|
static String |
buildQuorumEntry(com.google.common.net.HostAndPort hostAndPort,
int defaultPort) |
static String |
convertToHostsOnlyList(String quorum) |
static int |
getFirstPort(String quorum,
int defVal) |
static List<com.google.common.net.HostAndPort> |
splitToHostsAndPorts(String hostPortQuorumList)
Split a quorum list into a list of hostnames and ports
|
static List<com.google.common.net.HostAndPort> |
splitToHostsAndPortsStrictly(String quorum) |
static List<String> |
splitToPairs(String hostPortQuorumList)
Take a quorum list and split it to (trimmed) pairs
|
public static final int DEFAULT_PORT
public static List<String> splitToPairs(String hostPortQuorumList)
hostPortQuorumList - list of form h1:port, h2:port2,...public static List<com.google.common.net.HostAndPort> splitToHostsAndPorts(String hostPortQuorumList)
hostPortQuorumList - split to a list of hosts and portspublic static String buildHostsOnlyList(List<com.google.common.net.HostAndPort> hostAndPorts)
hostAndPorts - public static String buildQuorumEntry(com.google.common.net.HostAndPort hostAndPort, int defaultPort)
public static String buildQuorum(List<com.google.common.net.HostAndPort> hostAndPorts, int defaultPort)
hostAndPorts - defaultPort - public static String convertToHostsOnlyList(String quorum) throws BadConfigException
BadConfigExceptionpublic static List<com.google.common.net.HostAndPort> splitToHostsAndPortsStrictly(String quorum) throws BadConfigException
BadConfigExceptionpublic static int getFirstPort(String quorum, int defVal) throws BadConfigException
BadConfigExceptionCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.