[ 
https://issues.apache.org/jira/browse/PHOENIX-6523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Istvan Toth updated PHOENIX-6523:
---------------------------------
    Release Note: 
Add support for MasterRegistry and RPCConnectionRegistry to Phoenix.

Intorduces the new URL protocol variants:
* jdbc:phoenix+zk: Uses Zookeeper. This is the original registry supported 
since the inception of HBase and Phoenix.
* jdbc:phoenix+rpc: Uses RPC to connecto to the specified HBase RS/Master nodes.
* jdbc:phoenix+master: Uses RPC to connect to the specified HBase Master nodes

The syntax:
"jdbc:phoenix" : uses the default registry and and connection from 
hbase-site.xml

"jdbc:phoenix:param1:param2...": Protocol/Registry is determined from Hbase 
version and hbase-site.xml configuration, and parameters are interpreted 
accoring to the registry.

"jdbc:phoenix+zk:hosts:ports:zknode:principal:keytab;options..." : Behaves the 
same as  jdbc:phoenix... URL previously. Any missing parameters use defaults 
fom hbase-site.xml or the environment.

"jdbc:phoenix+rpc:hosts:ports::principal:keytab;options..." : Uses 
RPCConnectionRegistry. If more than two options are specified, then the third 
one (he unused zkNode paramater) must always be blank.

"jdbc:phoenix+master:hosts:ports::principal:keytab;options..." : Uses 
RPCMasterRegistry. If more than two options are specified, then the third one 
(he unused zkNode paramater) must always be blank.

Phoenix now also supports heterogenous ports defined in HBASE-12706 for every 
registry. When specifying the ports for each host separately the colon ":" 
character must be escaped with a backslash, i.e. 
"jdbc:phoenix+zk:host1\:123,host2\:345:/hbase:principal:keytab", or 
"jdbc:phoenix+rpc:host1\:123,host2\:345" You may need to add extra escapes to 
preserve the backslashes if defined in java code, etc.

Note that while the phoenix+zk URL handling code has heuristics that tries to 
handle some omitted parameters, the Master and ConnectionRPC registry code 
strictly maps the URL parameters to by their ordering.

Note that Phoenix now internally normalizes the URL. Whether you specify an 
explicit connection, or use the default "jdbc:phoenix" URL, Phoenix will 
internally normalize the connection, and set the  properties for the internal 
HBase Connection objects appropriately.  

Also note that for most non-HA use cases an explicit connection URL should NOT 
be used. The preferred way to specify the connection is to have an up-to-date 
hbase-site.xml with both Hbase and Phoenix client properties set correctly 
(with other Hadoop conficguration files as needed)  on the Phoenix application 
classpath , and using the default "jdbc:phoenix" URL.


  was:
Add support for MasterRegistry and RPCConnectionRegistry to Phoenix.

Intorduces the new URL protocol variants:
* jdbc:phoenix+zk: Uses Zookeeper. This is the original registry supported 
since the inception of HBase and Phoenix.
* jdbc:phoenix+rpc: Uses RPC to connecto to the specified HBase RS/Master nodes.
* jdbc:phoenix+master: Uses RPC to connect to the specified HBase Master nodes

The syntax:
"jdbc:phoenix" : uses the default registry and and connection from 
hbase-site.xml

"jdbc:phoenix:param1:param2...": Protocol/Registry is determined from Hbase 
version and hbase-site.xml configuration, and parameters are interpreted 
accoring to the registry.

"jdbc:phoenix+zk:hosts:ports:zknode:principal:keytab;options..." : Behaves the 
same as  jdbc:phoenix... URL previously. Any missing parameters use defaults 
fom hbase-site.xml or the environment.

"jdbc:phoenix+rpc:hosts:ports::principal:keytab;options..." : Uses 
RPCConnectionRegistry. If more than two options are specified, then the third 
one (he unused zkNode paramater) must always be blank.

"jdbc:phoenix+master:hosts:ports::principal:keytab;options..." : Uses 
RPCMasterRegistry. If more than two options are specified, then the third one 
(he unused zkNode paramater) must always be blank.

Phoenix now also supports heterogenous ports defined in HBASE-12706 for every 
registry. When specifying the ports for each host separately the colon ":" 
character must be escaped with a backslash, i.e. 
"jdbc:phoenix+zk:host1\:123,host2\:345:/hbase:principal:keytab", or 
"jdbc:phoenix+rpc:host1\:123,host2\:345" You may need to add extra escapes to 
preserve the backslashes if defined in java code, etc.

Note that Phoenix now internally normalizes the URL. Whether you specify an 
explicit connection, or use the default "jdbc:phoenix" URL, Phoenix will 
internally normalize the connection, and set the  properties for the internal 
HBase Connection objects appropriately.  

Also note that for most non-HA use cases an explicit connection URL should NOT 
be used. The preferred way to specify the connection is to have an up-to-date 
hbase-site.xml with both Hbase and Phoenix client properties set correctly 
(with other Hadoop conficguration files as needed)  on the Phoenix application 
classpath , and using the default "jdbc:phoenix" URL.



> Support for HBase Registry Implementations through Phoenix connection URL
> -------------------------------------------------------------------------
>
>                 Key: PHOENIX-6523
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6523
>             Project: Phoenix
>          Issue Type: Improvement
>          Components: core
>            Reporter: Ramie Raufdeen
>            Assignee: Istvan Toth
>            Priority: Major
>
> https://issues.apache.org/jira/browse/HBASE-23305
> https://issues.apache.org/jira/browse/HBASE-18095
>  
> HBase now supports a zookeeper-less connection strategy using a Master 
> Registry implementation. 
>  
> For this to work, the client simply needs to set a list of <host:port>s of 
> the HMaster quorum
>  
> {code:java}
> <property>
>    <name>hbase.masters</name>
>    <value>master1:16000,master2:16001,master3:16000</value>
> </property>
> {code}
>  
> To support opting into this from a Phoenix connection URL, we can introduce a 
> "connector type". We'll leverage the *+* char of [JDBC URL 
> grammar|https://docs.oracle.com/cd/E17952_01/connector-j-8.0-en/connector-j-reference-jdbc-url-format.html]
>  to specify the connection type. Connections will start to look something 
> like this:
> {code:java}
> jdbc:phoenix+zk:hostname1,2,3...:<properties> 
> jdbc:phoenix+hrpc:hostname1,2,3...:<properties>
> jdbc:phoenix+bigtable:hostname1,2,3...:<properties>{code}
> Above are examples of opting into hrpc/zk/bigtable registry implementations 
> of HBase.
>  
> If no connector is specified, the driver will default to a Zookeeper based 
> connection.
>  
>  
>  



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

Reply via email to