Repository: phoenix Updated Branches: refs/heads/4.8-HBase-0.98 e1254ea14 -> d80c15587
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/d80c1558 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d80c1558 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d80c1558 Branch: refs/heads/4.8-HBase-0.98 Commit: d80c15587bf7b581d2dab8499cb62280a9d4a912 Parents: e1254ea Author: Samarth <[email protected]> Authored: Wed Nov 16 08:10:29 2016 -0800 Committer: Samarth <[email protected]> Committed: Wed Nov 16 08:10:29 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/d80c1558/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 9f9dfc6..2046afb 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 @@ -347,38 +347,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);
