[ 
https://issues.apache.org/jira/browse/PHOENIX-7537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17935585#comment-17935585
 ] 

Jacob Isaac commented on PHOENIX-7537:
--------------------------------------

So wanted to elaborate on scenarios where it might be inconvenient for the 
application layer.

In our cases we store the urls in config files and other stores in HA env. 
So these urls when passed from the stored envs one will have to first inspect 
the URL in which format is it in (prior to 5.2 or not) before passing to 
PhoenixConnection
Also not clear why a url format that is acceptable to Zookeeper and HBase is 
not acceptable to Phoenix (ConnectionInfo)?

> Well formed URLs created by ZKConnectionInfo.create() throw Malformed 
> connection url exception.
> -----------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-7537
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7537
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Jacob Isaac
>            Priority: Major
>
> @Test
> public void testMalformedZKConnection() throws SQLException {
> Configuration config = 
> HBaseFactoryProvider.getConfigurationFactory().getConfiguration();
> String defaultQuorum = config.get(HConstants.ZOOKEEPER_QUORUM);
> for (String protocol : new String[] \{ "phoenix", "phoenix+zk" }) {
> String[] urls = new String[] {
> "v1,v2,v3:2181:/hbase",
> "jdbc:" + protocol + ":localhost",
> "jdbc:" + protocol + ":localhost:2181,localhost:12181:/hbase",
> "jdbc:" + protocol + ":v1,v2,v3:2181:/hbase",
> };
> for (String url : urls) {
> try {
> ZKConnectionInfo
> info =
> (ZKConnectionInfo) ConnectionInfo.create(url, null, null);
> System.out.println("1.Successfully connected to " + url + " , " + 
> info.getZkHosts());
> {color:#FF0000}*// Passing the normalized url (info.getZkHosts()) from above 
> again into Connection.create fails*{color}
> {color:#FF0000}*// for some formats.*{color}
> ZKConnectionInfo
> info2 =
> (ZKConnectionInfo) ConnectionInfo.create(info.getZkHosts(), null, null);
> System.out.println("2.Successfully connected to " + url + " , " + 
> info.getZkHosts());
> } catch (SQLException sqle) {
> System.out.println(sqle.getMessage());
> }
> }
> }
> }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to