private static ConnectionInfo defaultConnectionInfo(String url) throws SQLException { Configuration config = HBaseFactoryProvider.getConfigurationFactory().getConfiguration(); String quorum = config.get(HConstants.ZOOKEEPER_QUORUM); if (quorum == null || quorum.isEmpty()) { throw getMalFormedUrlException(url); } String clientPort = config.get(HConstants.ZOOKEEPER_CLIENT_PORT); Integer port = clientPort==null ? null : Integer.parseInt(clientPort); if (port == null || port < 0) { throw getMalFormedUrlException(url); } String znodeParent = config.get(HConstants.ZOOKEEPER_ZNODE_PARENT); LOG.debug("Getting default jdbc connection url " + quorum + ":" + port + ":" + znodeParent); return new ConnectionInfo(quorum, port, znodeParent); } }
throw getMalFormedUrlException(url); tokens[nTokens - 1] = prevToken + ":" + extraToken; if (tokenizer.hasMoreTokens() && !(token=tokenizer.nextToken()).equals(TERMINATOR)) { throw getMalFormedUrlException(url); throw getMalFormedUrlException(url); port = Integer.parseInt(tokens[tokenIndex]); if (port < 0) { throw getMalFormedUrlException(url); throw getMalFormedUrlException(url);
private static ConnectionInfo defaultConnectionInfo(String url) throws SQLException { Configuration config = HBaseFactoryProvider.getConfigurationFactory().getConfiguration(); String quorum = config.get(HConstants.ZOOKEEPER_QUORUM); if (quorum == null || quorum.isEmpty()) { throw getMalFormedUrlException(url); } String clientPort = config.get(HConstants.ZOOKEEPER_CLIENT_PORT); Integer port = clientPort==null ? null : Integer.parseInt(clientPort); if (port == null || port < 0) { throw getMalFormedUrlException(url); } String znodeParent = config.get(HConstants.ZOOKEEPER_ZNODE_PARENT); LOG.debug("Getting default jdbc connection url " + quorum + ":" + port + ":" + znodeParent); return new ConnectionInfo(quorum, port, znodeParent); } }
} else { if (!zkPort.equals(quorumInfo[1])) { throw getMalFormedUrlException(url); throw getMalFormedUrlException(url); tokens[nTokens - 1] = prevToken + ":" + extraToken; if (tokenizer.hasMoreTokens() && !(token=tokenizer.nextToken()).equals(TERMINATOR)) { throw getMalFormedUrlException(url); throw getMalFormedUrlException(url); port = Integer.parseInt(tokens[tokenIndex]); if (port < 0) { throw getMalFormedUrlException(url); throw getMalFormedUrlException(url);
throw getMalFormedUrlException(url); tokens[nTokens - 1] = prevToken + ":" + extraToken; if (tokenizer.hasMoreTokens() && !(token=tokenizer.nextToken()).equals(TERMINATOR)) { throw getMalFormedUrlException(url); throw getMalFormedUrlException(url); port = Integer.parseInt(tokens[tokenIndex]); if (port < 0) { throw getMalFormedUrlException(url); throw getMalFormedUrlException(url);
private static ConnectionInfo defaultConnectionInfo(String url) throws SQLException { Configuration config = HBaseFactoryProvider.getConfigurationFactory().getConfiguration(); String quorum = config.get(HConstants.ZOOKEEPER_QUORUM); if (quorum == null || quorum.isEmpty()) { throw getMalFormedUrlException(url); } String clientPort = config.get(HConstants.ZOOKEEPER_CLIENT_PORT); Integer port = clientPort==null ? null : Integer.parseInt(clientPort); if (port == null || port < 0) { throw getMalFormedUrlException(url); } String znodeParent = config.get(HConstants.ZOOKEEPER_ZNODE_PARENT); LOG.debug("Getting default jdbc connection url " + quorum + ":" + port + ":" + znodeParent); return new ConnectionInfo(quorum, port, znodeParent); } }