Skip to content

Commit

Permalink
HBase Connection Registry usage with Phoenix JDBC url
Browse files Browse the repository at this point in the history
  • Loading branch information
virajjasani committed Feb 6, 2025
1 parent 60cc9df commit 6ef2dcd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
25 changes: 24 additions & 1 deletion docs/src/main/sphinx/connector/phoenix.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,34 @@ The following Phoenix-specific configuration properties are available:

| Property name | Required | Description |
|------------------------------------| -------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `phoenix.connection-url` | Yes | `jdbc:phoenix[:zk_quorum][:zk_port][:zk_hbase_path]`. The `zk_quorum` is a comma separated list of ZooKeeper servers. The `zk_port` is the ZooKeeper port. The `zk_hbase_path` is the HBase root znode path, that is configurable using `hbase-site.xml`. By default the location is `/hbase` |
| `phoenix.connection-url` | Yes | See [](phoenix-connection-url). |
| `phoenix.config.resources` | No | Comma-separated list of configuration files (e.g. `hbase-site.xml`) to use for connection properties. These files must exist on the machines running Trino. |
| `phoenix.max-scans-per-split` | No | Maximum number of HBase scans that will be performed in a single split. Default is 20. Lower values will lead to more splits in Trino. Can also be set via session propery `max_scans_per_split`. For details see: [https://phoenix.apache.org/update_statistics.html](https://phoenix.apache.org/update_statistics.html). (This setting has no effect when guideposts are disabled in Phoenix.) |
| `phoenix.server-scan-page-timeout` | No | The time limit on the amount of work single RPC request can do before it times out. Type: [](prop-type-duration). |

(phoenix-connection-url)=
### Connection URL:

The connection URL for Phoenix set with `phoenix.connection-url` supports multiple formats:
* `jdbc:phoenix[:zk_quorum][:zk_port][:zk_hbase_path][:principal][:keytab][;options]`:
Connection uses the HBase Zookeeper Registry. `zk_quorum` is a comma-separated
list of ZooKeeper servers. `zk_port` is the ZooKeeper port.
`zk_hbase_path` is the HBase root znode path, that is configurable using
`hbase-site.xml`. By default the location is `/hbase`. Principal, Keytab and
Options are optional.
* `jdbc:phoenix+zk[:host1\:port1][,:host2\:port2]...[,:hostN\:portN][:zk_hbase_path][:principal][:keytab][;options]`:
Uses the same connection as the preceding example with `host:port` pairs as a comma-separated list.
* `jdbc:phoenix+rpc[:host1\:port1][,:host2\:port2]...[,:hostN\:portN][::principal][:keytab][;options]`:
Connection uses the HBase RPC Registry. Recommended for HBase 3+
versions. `host:port` pairs are comma-separated.
Host names refer to HMaster server names, port refers to HMaster ports.
Principal, Keytab and Options are optional.
* `jdbc:phoenix+master[:host1\:port1][,:host2\:port2]...[,:hostN\:portN][::principal][:keytab][;options]`:
Connection uses the HBase Master Registry. `host:port` pairs are comma-separated.
Host names refers to HMaster server names, port refers to HMaster ports.
Principal, Keytab and Options are optional.


```{include} jdbc-common-configurations.fragment
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void close()

public String getJdbcUrl()
{
return format("jdbc:phoenix:localhost:%d:/hbase;phoenix.schema.isNamespaceMappingEnabled=true", port);
// Alternative: "jdbc:phoenix+rpc:localhost\\:%d;phoenix.schema.isNamespaceMappingEnabled=true" where %d = master's port
return format("jdbc:phoenix+zk:localhost\\:%d:/hbase;phoenix.schema.isNamespaceMappingEnabled=true", port);
}
}

0 comments on commit 6ef2dcd

Please sign in to comment.