Skip to content

Commit 26c5b61

Browse files
committed
[Chore] add ODP mode parameters in hbase simple demo
1 parent 40040d7 commit 26c5b61

File tree

3 files changed

+62
-46
lines changed

3 files changed

+62
-46
lines changed

README.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class SimpleHBaseClientDemo {
7171
}
7272
```
7373

74-
The Hbase Configuration in hbase-site.xml:
74+
The Hbase Configuration in hbase-site.xml for direct-connect mode:
7575
```xml
7676
<configuration>
7777
<property>
@@ -101,15 +101,52 @@ The Hbase Configuration in hbase-site.xml:
101101
</configuration>
102102
```
103103

104+
The Hbase Configuration in hbase-site.xml for ODP mode:
105+
```xml
106+
<configuration>
107+
<property>
108+
<name>hbase.client.connection.impl</name>
109+
<value>com.alipay.oceanbase.hbase.util.OHConnectionImpl</value>
110+
</property>
111+
<property>
112+
<name>hbase.oceanbase.odpMode</name>
113+
<value>true</value>
114+
</property>
115+
<property>
116+
<name>hbase.oceanbase.fullUserName</name>
117+
<value></value>
118+
</property>
119+
<property>
120+
<name>hbase.oceanbase.password</name>
121+
<value></value>
122+
</property>
123+
<property>
124+
<name>hbase.oceanbase.odpAddr</name>
125+
<value></value>
126+
</property>
127+
<property>
128+
<name>hbase.oceanbase.odpPort</name>
129+
<value>3307</value>
130+
</property>
131+
<property>
132+
<name>hbase.oceanbase.database</name>
133+
<value></value>
134+
</property>
135+
</configuration>
136+
```
137+
104138
**NOTE:**
105139
* `hbase.client.connection.impl`: the implementation of hbase connenction, which must be set to `com.alipay.oceanbase.hbase.util.OHConnectionImpl`
140+
* `hbase.oceanbase.odpMode`: true indicate is in ODP mode, false(in default) indicate is in direct-connect mode
106141
* `hbase.oceanbase.fullUserName`: the user for accessing obkv, which format is user_name@tenant_name#cluster_name
107142
* `hbase.oceanbase.password`: the password associated with the specified user
108143
* `hbase.oceanbase.paramURL`: which is generated by [ConfigServer](https://ask.oceanbase.com/t/topic/35601923)
109144
* `hbase.oceanbase.sysUserName`: root@sys or proxy@sys, which have privileges to access routing system view
110145
* `hbase.oceanbase.sysPassword`: the password associated with the specified sys user
111-
* the provided example is in direct-connect mode, if you want to write a demo in ODP mode, please refer to our documentation for further details.
112-
* More example [TODO]
146+
* `hbase.oceanbase.odpAddr`: the ODP's IP address
147+
* `hbase.oceanbase.odpPort`: the ODP's OBKV port
148+
* `hbase.oceanbase.database`: the target database to operate on
149+
113150
## Documentation
114151
- English [Coming soon]
115152
- [Simplified Chinese (简体中文)](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000002022354)

example/simple-hbase-demo/src/main/java/com/oceanbase/example/LoggerFactory.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

example/simple-hbase-demo/src/main/java/resource/hbase-site.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
<name>hbase.client.connection.impl</name>
44
<value>com.alipay.oceanbase.hbase.util.OHConnectionImpl</value>
55
</property>
6+
<property>
7+
<name>hbase.oceanbase.odpMode</name>
8+
<value>false</value>
9+
</property>
610
<property>
711
<name>hbase.oceanbase.fullUserName</name>
812
<value></value>
@@ -12,15 +16,33 @@
1216
<value></value>
1317
</property>
1418
<property>
19+
<!-- only for direct-connect mode-->
1520
<name>hbase.oceanbase.paramURL</name>
1621
<value></value>
1722
</property>
1823
<property>
24+
<!-- only for direct-connect mode-->
1925
<name>hbase.oceanbase.sysUserName</name>
2026
<value></value>
2127
</property>
2228
<property>
29+
<!-- only for direct-connect mode-->
2330
<name>hbase.oceanbase.sysPassword</name>
2431
<value></value>
2532
</property>
33+
<property>
34+
<!-- only for odp mode-->
35+
<name>hbase.oceanbase.odpAddr</name>
36+
<value></value>
37+
</property>
38+
<!-- only for odp mode-->
39+
<property>
40+
<name>hbase.oceanbase.odpPort</name>
41+
<value>3307</value>
42+
</property>
43+
<property>
44+
<!-- only for odp mode-->
45+
<name>hbase.oceanbase.database</name>
46+
<value></value>
47+
</property>
2648
</configuration>

0 commit comments

Comments
 (0)