Author: elserj
Date: Thu Jul 27 23:20:37 2017
New Revision: 1803239
URL: http://svn.apache.org/viewvc?rev=1803239&view=rev
Log:
PHOENIX-4046 Add FAQ for JDBC URLs for thick&thin
Modified:
phoenix/site/publish/faq.html
phoenix/site/publish/index.html
phoenix/site/publish/language/datatypes.html
phoenix/site/publish/language/functions.html
phoenix/site/publish/language/index.html
phoenix/site/publish/server.html
phoenix/site/source/src/site/markdown/faq.md
phoenix/site/source/src/site/markdown/index.md
phoenix/site/source/src/site/markdown/server.md
Modified: phoenix/site/publish/faq.html
URL:
http://svn.apache.org/viewvc/phoenix/site/publish/faq.html?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/publish/faq.html (original)
+++ phoenix/site/publish/faq.html Thu Jul 27 23:20:37 2017
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2017-07-24
+ Generated by Apache Maven Doxia at 2017-07-27
Rendered using Reflow Maven Skin 1.1.0
(http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
@@ -162,6 +162,7 @@
</div>
<ul>
<li><a href="#I_want_to_get_started_Is_there_a_Phoenix_Hello_World">I want to
get started. Is there a Phoenix Hello World?</a></li>
+ <li><a href="#What_is_the_Phoenix_JDBC_URL_syntax">What is the Phoenix JDBC
URL syntax?</a></li>
<li><a href="#Is_there_a_way_to_bulk_load_in_Phoenix">Is there a way to bulk
load in Phoenix?</a></li>
<li><a href="#How_I_map_Phoenix_table_to_an_existing_HBase_table">How I map
Phoenix table to an existing HBase table?</a></li>
<li><a href="#Are_there_any_tips_for_optimizing_Phoenix">Are there any tips
for optimizing Phoenix?</a></li>
@@ -245,6 +246,31 @@ public class test {
<p><tt>Hello</tt> <tt>World!</tt></p>
</div>
<div class="section">
+ <h3 id="What_is_the_Phoenix_JDBC_URL_syntax">What is the Phoenix JDBC URL
syntax?</h3>
+ <div class="section">
+ <h4 id="Thick_Driver">Thick Driver</h4>
+ <p>The Phoenix (Thick) Driver JDBC URL syntax is as follows (where elements
in square brackets are optional):</p>
+ <p><tt>jdbc:phoenix:[comma-separated ZooKeeper Quorum [:port [:hbase root
znode [:kerberos_principal [:path to kerberos keytab] ] ] ]</tt></p>
+ <p>The simplest URL is:</p>
+ <p><tt>jdbc:phoenix:localhost</tt></p>
+ <p>Whereas the most complicated URL is:</p>
+
<p><tt>jdbc:phoenix:zookeeper1.domain,zookeeper2.domain,zookeeper3.domain:2181:/hbase-1:[email protected]:/etc/security/keytabs/phoenix.keytab</tt></p>
+ <p>Please note that each optional element in the URL requires all previous
optional elements. For example, to specify the HBase root ZNode, the ZooKeeper
port <i>must</i> also be specified.</p>
+ <p>This information is initially covered on the <a href="/#connStr">index
page</a>.</p>
+ </div>
+ <div class="section">
+ <h4 id="Thin_Driver">Thin Driver</h4>
+ <p>The Phoenix Thin Driver (used with the Phoenix Query Server) JDBC URL
syntax is as follows:</p>
+ <p><tt>jdbc:phoenix:thin:[key=value[;key=value...]]</tt></p>
+ <p>There are a number of keys exposed for client-use. The most
commonly-used keys are: <tt>url</tt> and <tt>serialization</tt>. The
<tt>url</tt> key is required to interact with the Phoenix Query Server.</p>
+ <p>The simplest URL is:</p>
+ <p><tt>jdbc:phoenix:thin:url=http://localhost:8765</tt></p>
+ <p>Where as very complicated URL is:</p>
+
<p><tt>jdbc:phoenix:thin:url=http://queryserver.domain:8765;serialization=PROTOBUF;authentication=SPENGO;[email protected];keytab=/etc/security/keytabs/phoenix.keytab</tt></p>
+ <p>Please refer to the <a class="externalLink"
href="https://calcite.apache.org/avatica/docs/client_reference.html">Apache
Avatica documentation</a> for a full list of supported options in the Thin
client JDBC URL, or see the <a href="server.html">Query Server
documentation</a></p>
+ </div>
+ </div>
+ <div class="section">
<h3 id="Is_there_a_way_to_bulk_load_in_Phoenix">Is there a way to bulk load
in Phoenix?</h3>
<p><b>Map Reduce</b></p>
<p>See the example <a href="bulk_dataload.html">here</a></p>
Modified: phoenix/site/publish/index.html
URL:
http://svn.apache.org/viewvc/phoenix/site/publish/index.html?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/publish/index.html (original)
+++ phoenix/site/publish/index.html Thu Jul 27 23:20:37 2017
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2017-07-24
+ Generated by Apache Maven Doxia at 2017-07-27
Rendered using Reflow Maven Skin 1.1.0
(http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
@@ -233,7 +233,7 @@
</div>
<p>where <tt>props</tt> are optional properties which may include Phoenix
and HBase configuration properties, and the connection string which is composed
of: </p>
<div>
- <pre><tt>jdbc:phoenix</tt> [ <tt>:<zookeeper quorum></tt> [
<tt>:<port number></tt> ] [ <tt>:<root node></tt> ] [
<tt>:<principal></tt> ] [ <tt>:<keytab file></tt> ] ] </pre>
+ <pre><tt>jdbc:phoenix</tt> [ <tt>:<zookeeper quorum></tt> [
<tt>:<port number></tt> [ <tt>:<root node></tt> [
<tt>:<principal></tt> [ <tt>:<keytab file></tt> ] ] ] ] ] </pre>
</div>
<p>For any omitted parts, the relevant property value,
hbase.zookeeper.quorum, hbase.zookeeper.property.clientPort, and
zookeeper.znode.parent will be used from hbase-site.xml configuration file. The
optional <tt>principal</tt> and <tt>keytab file</tt> may be used to connect to
a Kerberos secured cluster. If only <tt>principal</tt> is specified, then this
defines the user name with each distinct user having their own dedicated HBase
connection (HConnection). This provides a means of having multiple, different
connections each with different configuration properties on the same JVM.</p>
<p>For example, the following connection string might be used for longer
running queries, where the <tt>longRunningProps</tt> specifies Phoenix and
HBase configuration properties with longer timeouts: </p>
@@ -243,6 +243,7 @@
<div>
<pre><tt>Connection conn =
DriverManager.getConnection("jdbc:phoenix:my_server:shortRunning",
shortRunningProps);</tt></pre>
</div>
+ <p>Please read the relevant <a
href="faq.html#What_is_the_Phoenix_JDBC_URL_syntax">FAQ entry</a> for example
URLs.</p>
</div>
</div>
<div class="section">
Modified: phoenix/site/publish/language/datatypes.html
URL:
http://svn.apache.org/viewvc/phoenix/site/publish/language/datatypes.html?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/publish/language/datatypes.html (original)
+++ phoenix/site/publish/language/datatypes.html Thu Jul 27 23:20:37 2017
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2017-07-24
+ Generated by Apache Maven Doxia at 2017-07-27
Rendered using Reflow Maven Skin 1.1.0
(http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
Modified: phoenix/site/publish/language/functions.html
URL:
http://svn.apache.org/viewvc/phoenix/site/publish/language/functions.html?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/publish/language/functions.html (original)
+++ phoenix/site/publish/language/functions.html Thu Jul 27 23:20:37 2017
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2017-07-24
+ Generated by Apache Maven Doxia at 2017-07-27
Rendered using Reflow Maven Skin 1.1.0
(http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
Modified: phoenix/site/publish/language/index.html
URL:
http://svn.apache.org/viewvc/phoenix/site/publish/language/index.html?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/publish/language/index.html (original)
+++ phoenix/site/publish/language/index.html Thu Jul 27 23:20:37 2017
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2017-07-24
+ Generated by Apache Maven Doxia at 2017-07-27
Rendered using Reflow Maven Skin 1.1.0
(http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
Modified: phoenix/site/publish/server.html
URL:
http://svn.apache.org/viewvc/phoenix/site/publish/server.html?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/publish/server.html (original)
+++ phoenix/site/publish/server.html Thu Jul 27 23:20:37 2017
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2017-07-24
+ Generated by Apache Maven Doxia at 2017-07-27
Rendered using Reflow Maven Skin 1.1.0
(http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
@@ -190,7 +190,7 @@
<p>Phoenix provides two mechanisms for interacting with the query server. A
JDBC driver is provided in the standalone
<tt>phoenix-<version>-thin-client.jar</tt>. The script
<tt>bin/sqlline-thin.py</tt> is available for the command line.</p>
<p>The JDBC connection string is composed as follows:</p>
<div class="source">
-
<pre>jdbc:phoenix:thin:url=<scheme>://<server-hostname>:<port>[...]
+
<pre>jdbc:phoenix:thin:url=<scheme>://<server-hostname>:<port>[;option=value...]
</pre>
</div>
<p><tt><scheme></tt> specifies the transport protocol used when
communicating with the server. The only supported transport at this time is
<tt>http</tt>.</p>
Modified: phoenix/site/source/src/site/markdown/faq.md
URL:
http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/faq.md?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/source/src/site/markdown/faq.md (original)
+++ phoenix/site/source/src/site/markdown/faq.md Thu Jul 27 23:20:37 2017
@@ -1,6 +1,7 @@
# F.A.Q.
* [I want to get started. Is there a Phoenix Hello
World?](#I_want_to_get_started_Is_there_a_Phoenix_Hello_World)
+* [What is the Phoenix JDBC URL syntax?](#What_is_the_Phoenix_JDBC_URL_syntax)
* [Is there a way to bulk load in
Phoenix?](#Is_there_a_way_to_bulk_load_in_Phoenix)
* [How I map Phoenix table to an existing HBase
table?](#How_I_map_Phoenix_table_to_an_existing_HBase_table)
* [Are there any tips for optimizing
Phoenix?](#Are_there_any_tips_for_optimizing_Phoenix)
@@ -91,7 +92,46 @@ You should get the following output
`Hello`
`World!`
+### What is the Phoenix JDBC URL syntax?
+#### Thick Driver
+
+The Phoenix (Thick) Driver JDBC URL syntax is as follows (where elements in
square brackets are optional):
+
+`jdbc:phoenix:[comma-separated ZooKeeper Quorum [:port [:hbase root znode
[:kerberos_principal [:path to kerberos keytab] ] ] ]`
+
+The simplest URL is:
+
+`jdbc:phoenix:localhost`
+
+Whereas the most complicated URL is:
+
+`jdbc:phoenix:zookeeper1.domain,zookeeper2.domain,zookeeper3.domain:2181:/hbase-1:[email protected]:/etc/security/keytabs/phoenix.keytab`
+
+Please note that each optional element in the URL requires all previous
optional elements. For example, to specify the
+HBase root ZNode, the ZooKeeper port *must* also be specified.
+
+This information is initially covered on the [index page](/#connStr).
+
+#### Thin Driver
+
+The Phoenix Thin Driver (used with the Phoenix Query Server) JDBC URL syntax
is as follows:
+
+`jdbc:phoenix:thin:[key=value[;key=value...]]`
+
+There are a number of keys exposed for client-use. The most commonly-used keys
are: `url` and `serialization`. The `url`
+key is required to interact with the Phoenix Query Server.
+
+The simplest URL is:
+
+`jdbc:phoenix:thin:url=http://localhost:8765`
+
+Where as very complicated URL is:
+
+`jdbc:phoenix:thin:url=http://queryserver.domain:8765;serialization=PROTOBUF;authentication=SPENGO;[email protected];keytab=/etc/security/keytabs/phoenix.keytab`
+
+Please refer to the [Apache Avatica
documentation](https://calcite.apache.org/avatica/docs/client_reference.html)
for a full list of supported options in the Thin client JDBC URL,
+or see the [Query Server documentation](server.html)
### Is there a way to bulk load in Phoenix?
@@ -307,4 +347,3 @@ The same issue comes up even if only one
all) records. A scan over Phoenix will include the empty column to
ensure that rows that only consist of the primary key (and have null
for all non-key columns) will be included in a scan result.
-
Modified: phoenix/site/source/src/site/markdown/index.md
URL:
http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/index.md?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/source/src/site/markdown/index.md (original)
+++ phoenix/site/source/src/site/markdown/index.md Thu Jul 27 23:20:37 2017
@@ -81,7 +81,7 @@ Use JDBC to get a connection to an HBase
<pre><code>Connection conn =
DriverManager.getConnection("jdbc:phoenix:server1,server2:3333",props);</code></pre>
where <code>props</code> are optional properties which may include Phoenix and
HBase configuration properties, and
the connection string which is composed of:
-<pre><code>jdbc:phoenix</code> [ <code>:<zookeeper quorum></code> [
<code>:<port number></code> ] [ <code>:<root node></code> ] [
<code>:<principal></code> ] [ <code>:<keytab file></code> ] ]
+<pre><code>jdbc:phoenix</code> [ <code>:<zookeeper quorum></code> [
<code>:<port number></code> [ <code>:<root node></code> [
<code>:<principal></code> [ <code>:<keytab file></code> ] ] ] ] ]
</pre>
For any omitted parts, the relevant property value, hbase.zookeeper.quorum,
hbase.zookeeper.property.clientPort, and zookeeper.znode.parent
@@ -96,6 +96,7 @@ while the following connection string mi
<pre><code>Connection conn =
DriverManager.getConnection("jdbc:phoenix:my_server:shortRunning",
shortRunningProps);</code></pre>
+Please read the relevant [FAQ
entry](faq.html#What_is_the_Phoenix_JDBC_URL_syntax) for example URLs.
##<a id="transactions"></a>Transactions
To enable full ACID transactions, a beta feature available in the 4.7.0
release, set the <code>phoenix.transactions.enabled</code> property to true. In
this case, you'll also need to run the transaction manager that's included in
the distribution. Once enabled, a table may optionally be declared as
transactional (see [here](transactions.html) for directions). Commits over
transactional tables will have an all-or-none behavior - either all data will
be committed (including any updates to secondary indexes) or none of it will
(and an exception will be thrown). Both cross table and cross row transactions
are supported. In addition, transactional tables will see their own uncommitted
data when querying. An optimistic concurrency model is used to detect row level
conflicts with first commit wins semantics. The later commit would produce an
exception indicating that a conflict was detected. A transaction is started
implicitly when a transactional table is referenced in a statement, at whi
ch point you will not see updates from other connections until either a commit
or rollback occurs.
Modified: phoenix/site/source/src/site/markdown/server.md
URL:
http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/server.md?rev=1803239&r1=1803238&r2=1803239&view=diff
==============================================================================
--- phoenix/site/source/src/site/markdown/server.md (original)
+++ phoenix/site/source/src/site/markdown/server.md Thu Jul 27 23:20:37 2017
@@ -59,7 +59,7 @@ driver is provided in the standalone
The JDBC connection string is composed as follows:
- jdbc:phoenix:thin:url=<scheme>://<server-hostname>:<port>[...]
+ jdbc:phoenix:thin:url=<scheme>://<server-hostname>:<port>[;option=value...]
`<scheme>` specifies the transport protocol used when communicating with the
server. The only supported transport at this time is `http`.