Skip to content

Commit d0d38c5

Browse files
stuBirdFlymiyuan-ljrJackShi148shenyunlongmaochongxin
authored
hbase merge branch 1.3 (#126)
* range relevant filter (#80) * Range relevant filter (#79) * range relevant filter * review * Namespace mapping to database in observer in one HBase client; set RPC connect timeout to Table Client (#78) * finish connection function * hbase 1.x compatibility: filter relevant (#51) * filter * add scan tests * add scan lease test (#53) * support allowPatialResult (#56) * [Chore] use obkv-table-client 1.2.13-SNAPSHOT for testing (#57) * init bufferedMutator * finish validateFamily and asyncExecute * correct log in OHBufferedMutatorImpl * pass self-test * format code * get bugfix * add retry when batch fails * remove test print * format code * make interface more generalized * test (#59) * random row filter (#62) * format BufferedMutator test case * remove redundancy, add some comments * fix (#66) * fix type of a bufferedMutator. Optimize by review * OHBufferedMutator in OBKV Hbase 1_x_comp (#64) * init bufferedMutator * finish validateFamily and asyncExecute * correct log in OHBufferedMutatorImpl * pass self-test * format code * add retry when batch fails * remove test print * format code * make interface more generalized * format BufferedMutator test case * remove redundancy, add some comments * fix type of a bufferedMutator. Optimize by review * hbase_multi_column_family_dev (#67) * hbase_multi_column_family_dev * fix * fix revierw * OHBufferedMutator set and use runtimeBatchExecutor in ObTableClient * OHBufferedMutator set and add runtimeBatchExecutor in ObTableClient (#68) * init bufferedMutator * finish validateFamily and asyncExecute * correct log in OHBufferedMutatorImpl * pass self-test * format code * add retry when batch fails * remove test print * format code * make interface more generalized * format BufferedMutator test case * remove redundancy, add some comments * fix type of a bufferedMutator. Optimize by review * OHBufferedMutator set and use runtimeBatchExecutor in ObTableClient * Bugfix/sql and conflict fixes (#69) * add sql for multi-cf test; fix conflict error * fix buffered mutation family_violation check * Remove multi-family checks for buffered mutations * fix check family empty * [Chore] refresh code from master branch and upgrade table client version (#71) * [Fix] checkAndMutate and get/Scan with filter return -5006 when include special character (#58) * [Fix] checkAndMutate and get/Scan with filter return -5006 when include special character * [Chore] fix review * [Fix] fix review * [Fix] fix test * [Fix] fix test testScanSessionClean * multi-namespace in one HBase client * format code * set rpcConnectTimeout to tableClient * multi-namespace in ocp mode and odp mode * revert self-defined pom xml * use the test as initial testing case * format code * use 'default' database when param_url misses the database parameter * add new test case testing multi-namespace, remove some comments --------- Co-authored-by: stuBirdFly <1065492934@qq.com> Co-authored-by: stuBirdFly <84010733+stuBirdFly@users.noreply.github.com> Co-authored-by: miyuan-ljr <miyuan.ljr@antgroup.com> Co-authored-by: Shen Yunlong <44497386+shenyunlong@users.noreply.github.com> Co-authored-by: DingZhen <maochongxin@gmail.com> * fuzzy (#81) * DependentColumnFilter, singleColumnValueExcludeFilter and single cf setColumnFamilyTimeRange development (#82) * add DepentdentFilter and SingleColumnValueExcludeFilter * add singleColumnValueExcludeFilter and DependentColumnFilter; add test cases and optimize bufferedMutator test cases * add single cf timerange setting in Get * single cf setColumnFamilyTimeRange in Get and Scan * optimize code * report error when setColumnFamilyTimeRange for a column family that is not queryed * correct name * hbase support batch (#84) * Add DeleteFamilyVersion function and corresponding test cases (#85) * add DepentdentFilter and SingleColumnValueExcludeFilter * add singleColumnValueExcludeFilter and DependentColumnFilter; add test cases and optimize bufferedMutator test cases * add single cf timerange setting in Get * single cf setColumnFamilyTimeRange in Get and Scan * optimize code * add DeleteFamilyVersion and test cases * add DeleteFamilyVersion; optimize test cases * add DeleteFamilyVersion test case and pass * format code * delete useless self-defined table * hbase support batchCallBack (#86) * add native hbase test (#90) * BufferedMutator 1.3 batch (#88) * add DepentdentFilter and SingleColumnValueExcludeFilter * add singleColumnValueExcludeFilter and DependentColumnFilter; add test cases and optimize bufferedMutator test cases * remove DeleteFamilyVersion file and move all cases to MultiColumnFamilyTest * adjust bufferdMutatorImpl 1.x to new batch * bufferedMutator do not retry, batch retry in table client * add rpcTimeout and operationTimetout setting in bufferedMutator * clean execBuffer if all commits have succeed * format code * change connectionConfig to local variable; add deprecated interfaces in 1.x * add check null * Correct test case for the multi-cf bug (#100) * add DepentdentFilter and SingleColumnValueExcludeFilter * add singleColumnValueExcludeFilter and DependentColumnFilter; add test cases and optimize bufferedMutator test cases * merge obkv branch-1.3 and correct test case for the mulfi-cf bug * Optimize test case and add sql script for multi-namespace test (#101) * add DepentdentFilter and SingleColumnValueExcludeFilter * add singleColumnValueExcludeFilter and DependentColumnFilter; add test cases and optimize bufferedMutator test cases * merge obkv branch-1.3 and correct test case for the mulfi-cf bug * optimize test case and add sql to create self-defined database * batch compat old server (#106) * refine (#115) * family filter (#83) * fix encode (#111) * fix: Change single column family get operation to sync query (#96) * fix: Change single column family get operation to sync query * fix: resolve Maven build failure * [Fix] dependency conflict (#116) * [Chore] remove the use of sofa common log * add version control (#108) * add test case (#125) --------- Co-authored-by: miyuan-ljr <miyuan.ljr@antgroup.com> Co-authored-by: Ziyu Shi <57038180+JackShi148@users.noreply.github.com> Co-authored-by: Shen Yunlong <44497386+shenyunlong@users.noreply.github.com> Co-authored-by: DingZhen <maochongxin@gmail.com> Co-authored-by: shenyunlong.syl <shenyunlong.syl@oceanbase.com>
1 parent 2e00687 commit d0d38c5

31 files changed

+5047
-1555
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding>
5555
<project.encoding>UTF-8</project.encoding>
5656
<slf4j.version>1.7.21</slf4j.version>
57-
<table.client.version>1.2.14.1-SNAPSHOT</table.client.version>
57+
<table.client.version>1.2.14.4-SNAPSHOT</table.client.version>
5858
</properties>
5959

6060
<dependencyManagement>

src/main/java/com/alipay/oceanbase/hbase/OHTable.java

Lines changed: 466 additions & 220 deletions
Large diffs are not rendered by default.

src/main/java/com/alipay/oceanbase/hbase/OHTablePool.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
public class OHTablePool implements Closeable {
5151

52+
private String originTabelName = null;
5253
private final PoolMap<String, HTableInterface> tables;
5354
private final int maxSize;
5455
private final PoolMap.PoolType poolType;
@@ -314,6 +315,9 @@ int getCurrentPoolSize(String tableName) {
314315
* @param paramUrl the table root server http url
315316
*/
316317
public void setParamUrl(final String tableName, String paramUrl) {
318+
if (originTabelName == null) {
319+
originTabelName = tableName;
320+
}
317321
setTableAttribute(tableName, HBASE_OCEANBASE_PARAM_URL, Bytes.toBytes(paramUrl));
318322
}
319323

@@ -334,6 +338,9 @@ public String getParamUrl(final String tableName) {
334338
* @param fullUserName the table login username
335339
*/
336340
public void setFullUserName(final String tableName, final String fullUserName) {
341+
if (originTabelName == null) {
342+
originTabelName = tableName;
343+
}
337344
setTableAttribute(tableName, HBASE_OCEANBASE_FULL_USER_NAME, Bytes.toBytes(fullUserName));
338345
}
339346

@@ -354,6 +361,9 @@ public String getFullUserName(final String tableName) {
354361
* @param password the table login password
355362
*/
356363
public void setPassword(final String tableName, final String password) {
364+
if (originTabelName == null) {
365+
originTabelName = tableName;
366+
}
357367
setTableAttribute(tableName, HBASE_OCEANBASE_PASSWORD, Bytes.toBytes(password));
358368
}
359369

@@ -374,6 +384,9 @@ public String getPassword(final String tableName) {
374384
* @param sysUserName the sys username
375385
*/
376386
public void setSysUserName(final String tableName, final String sysUserName) {
387+
if (originTabelName == null) {
388+
originTabelName = tableName;
389+
}
377390
setTableAttribute(tableName, HBASE_OCEANBASE_SYS_USER_NAME, Bytes.toBytes(sysUserName));
378391
}
379392

@@ -394,6 +407,9 @@ public String getSysUserName(final String tableName) {
394407
* @param sysPassword the sys user password
395408
*/
396409
public void setSysPassword(final String tableName, final String sysPassword) {
410+
if (originTabelName == null) {
411+
originTabelName = tableName;
412+
}
397413
setTableAttribute(tableName, HBASE_OCEANBASE_SYS_PASSWORD, Bytes.toBytes(sysPassword));
398414
}
399415

@@ -481,6 +497,10 @@ public long getWriteBufferSize(String tableName) {
481497
.toLong(attr);
482498
}
483499

500+
public String getOriginTableName() {
501+
return this.originTabelName;
502+
}
503+
484504
/**
485505
* Sets the operation timeout for the specified tables in this pool.
486506
*
@@ -520,6 +540,9 @@ public int getOperationTimeout(String tableName) {
520540
* @param odpAddr ODP address
521541
*/
522542
public void setOdpAddr(final String tableName, String odpAddr) {
543+
if (originTabelName == null) {
544+
originTabelName = tableName;
545+
}
523546
setTableAttribute(tableName, HBASE_OCEANBASE_ODP_ADDR, Bytes.toBytes(odpAddr));
524547
}
525548

@@ -545,6 +568,9 @@ public String getOdpAddr(String tableName) {
545568
* @param odpPort ODP port
546569
*/
547570
public void setOdpPort(final String tableName, int odpPort) {
571+
if (originTabelName == null) {
572+
originTabelName = tableName;
573+
}
548574
setTableAttribute(tableName, HBASE_OCEANBASE_ODP_PORT, Bytes.toBytes(odpPort));
549575
}
550576

@@ -564,6 +590,9 @@ public int getOdpPort(String tableName) {
564590
* @param odpMode ODP mode
565591
*/
566592
public void setOdpMode(final String tableName, boolean odpMode) {
593+
if (originTabelName == null) {
594+
originTabelName = tableName;
595+
}
567596
setTableAttribute(tableName, HBASE_OCEANBASE_ODP_MODE, Bytes.toBytes(odpMode));
568597
}
569598

@@ -583,6 +612,9 @@ public boolean getOdpMode(String tableName) {
583612
* @param database ODP database name
584613
*/
585614
public void setDatabase(final String tableName, String database) {
615+
if (originTabelName == null) {
616+
originTabelName = tableName;
617+
}
586618
setTableAttribute(tableName, HBASE_OCEANBASE_DATABASE, Bytes.toBytes(database));
587619
}
588620

@@ -653,6 +685,9 @@ public Object getTableExtendAttribute(String tableName, String attributeName) {
653685
}
654686

655687
public void setRuntimeBatchExecutor(String tableName, ExecutorService runtimeBatchExecutor) {
688+
if (originTabelName == null) {
689+
originTabelName = tableName;
690+
}
656691
setTableExtendAttribute(tableName, HBASE_OCEANBASE_BATCH_EXECUTOR, runtimeBatchExecutor);
657692
}
658693

src/main/java/com/alipay/oceanbase/hbase/constants/OHConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,8 @@ public final class OHConstants {
159159

160160
public static final int MAX_KEYVALUE_SIZE_DEFAULT = -1;
161161

162+
public static final String SOCKET_TIMEOUT = "ipc.socket.timeout";
163+
164+
public static final int DEFAULT_SOCKET_TIMEOUT = 20000; // 20 seconds
165+
162166
}

0 commit comments

Comments
 (0)