Repository: phoenix Updated Branches: refs/heads/4.8-HBase-1.1 f2dde7f40 -> 52281fd96
CSVBulkLoadToolIT failing consistently because transaction service client init fails Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/52281fd9 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/52281fd9 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/52281fd9 Branch: refs/heads/4.8-HBase-1.1 Commit: 52281fd96c57ec7721d1eaac1224ef23e3b6d434 Parents: f2dde7f Author: Samarth <[email protected]> Authored: Wed Nov 16 08:21:12 2016 -0800 Committer: Samarth <[email protected]> Committed: Wed Nov 16 08:21:12 2016 -0800 ---------------------------------------------------------------------- .../java/org/apache/phoenix/util/QueryUtil.java | 36 +++----------------- 1 file changed, 5 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/52281fd9/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java index 6d8e00d..dc41352 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java @@ -346,38 +346,12 @@ public final class QueryUtil { } public static String getConnectionUrl(Properties props, Configuration conf, String principal) throws ClassNotFoundException, SQLException { - // TODO: props is ignored! // read the hbase properties from the configuration - String server = ZKConfig.getZKQuorumServersString(conf); - // could be a comma-separated list - String[] rawServers = server.split(","); - List<String> servers = new ArrayList<String>(rawServers.length); - int port = -1; - for (String serverPort : rawServers) { - try { - server = Addressing.parseHostname(serverPort); - int specifiedPort = Addressing.parsePort(serverPort); - // there was a previously specified port and it doesn't match this server - if (port > 0 && specifiedPort != port) { - throw new IllegalStateException("Phoenix/HBase only supports connecting to a " + - "single zookeeper client port. Specify servers only as host names in " + - "HBase configuration"); - } - // set the port to the specified port - port = specifiedPort; - servers.add(server); - } catch (IllegalArgumentException e) { - } - } - // port wasn't set, shouldn't ever happen from HBase, but just in case - if (port == -1) { - port = conf.getInt(QueryServices.ZOOKEEPER_PORT_ATTRIB, -1); - if (port == -1) { - // TODO: fall back to the default in HConstants#DEFAULT_ZOOKEPER_CLIENT_PORT - throw new RuntimeException("Client zk port was not set!"); - } - } - server = Joiner.on(',').join(servers); + int port = conf.getInt(HConstants.ZOOKEEPER_CLIENT_PORT, HConstants.DEFAULT_ZOOKEPER_CLIENT_PORT); + // Build the ZK quorum server string with "server:clientport" list, separated by ',' + final String[] servers = + conf.getStrings(HConstants.ZOOKEEPER_QUORUM, HConstants.LOCALHOST); + String server = Joiner.on(',').join(servers); String znodeParent = conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT, HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT); String url = getUrl(server, port, znodeParent, principal);
