Skip to content

Commit a991be7

Browse files
committed
fix configuration creation and format code
1 parent 1d6cbe3 commit a991be7

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public OHTable(final byte[] tableName, final ObTableClient obTableClient,
304304
this.cleanupConnectionOnClose = false;
305305
this.executePool = executePool;
306306
this.obTableClient = obTableClient;
307-
this.configuration = new Configuration();
307+
this.configuration = HBaseConfiguration.create();
308308
finishSetUp();
309309
}
310310

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.google.protobuf.Service;
2727
import com.google.protobuf.ServiceException;
2828
import org.apache.hadoop.conf.Configuration;
29+
import org.apache.hadoop.hbase.HBaseConfiguration;
2930
import org.apache.hadoop.hbase.HTableDescriptor;
3031
import org.apache.hadoop.hbase.TableName;
3132
import org.apache.hadoop.hbase.client.*;
@@ -67,7 +68,7 @@ public class OHTablePool implements Closeable {
6768
* Default Constructor. Default HBaseConfiguration and no limit on pool size.
6869
*/
6970
public OHTablePool() {
70-
this(new Configuration(), Integer.MAX_VALUE);
71+
this(HBaseConfiguration.create(), Integer.MAX_VALUE);
7172
}
7273

7374
/**

src/main/java/com/alipay/oceanbase/hbase/util/BatchError.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*-
2+
* #%L
3+
* com.oceanbase:obkv-hbase-client
4+
* %%
5+
* Copyright (C) 2022 - 2025 OceanBase Group
6+
* %%
7+
* OBKV HBase Client Framework is licensed under Mulan PSL v2.
8+
* You can use this software according to the terms and conditions of the Mulan PSL v2.
9+
* You may obtain a copy of Mulan PSL v2 at:
10+
* http://license.coscl.org.cn/MulanPSL2
11+
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
12+
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
13+
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
14+
* See the Mulan PSL v2 for more details.
15+
* #L%
16+
*/
17+
118
package com.alipay.oceanbase.hbase.util;
219

320
import org.apache.hadoop.hbase.ServerName;

src/main/java/com/alipay/oceanbase/hbase/util/CompatibilityUtil.java

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

src/main/java/com/alipay/oceanbase/hbase/util/OHTableFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.alipay.oceanbase.hbase.OHTablePool;
2222
import org.apache.hadoop.classification.InterfaceAudience;
2323
import org.apache.hadoop.conf.Configuration;
24+
import org.apache.hadoop.hbase.HBaseConfiguration;
2425
import org.apache.hadoop.hbase.client.HTableFactory;
2526
import org.apache.hadoop.hbase.client.HTableInterface;
2627
import org.apache.hadoop.hbase.util.Bytes;
@@ -170,7 +171,7 @@ private Configuration adjustConfiguration(Configuration configuration, String ta
170171
}
171172

172173
private Configuration copyConfiguration(Configuration origin) {
173-
Configuration copy = new Configuration();
174+
Configuration copy = HBaseConfiguration.create();
174175

175176
for (Map.Entry<String, String> entry : origin) {
176177
copy.set(entry.getKey(), entry.getValue());

src/test/java/com/alipay/oceanbase/hbase/OHTablePoolTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.alipay.oceanbase.hbase.util.ObHTableTestUtil;
2121
import com.alipay.remoting.util.ConcurrentHashSet;
2222
import org.apache.hadoop.conf.Configuration;
23+
import org.apache.hadoop.hbase.HBaseConfiguration;
2324
import org.apache.hadoop.hbase.client.HTableInterface;
2425
import org.apache.hadoop.hbase.util.PoolMap;
2526
import org.junit.*;
@@ -37,7 +38,7 @@ public class OHTablePoolTest extends HTableTestBase {
3738
protected static OHTablePool ohTablePool;
3839

3940
private static OHTablePool newOHTablePool(final int maxSize, final PoolMap.PoolType poolType) {
40-
OHTablePool pool = new OHTablePool(new Configuration(), maxSize, poolType);
41+
OHTablePool pool = new OHTablePool(HBaseConfiguration.create(), maxSize, poolType);
4142
pool.setFullUserName("test", ObHTableTestUtil.FULL_USER_NAME);
4243
pool.setPassword("test", ObHTableTestUtil.PASSWORD);
4344
if (ObHTableTestUtil.ODP_MODE) {
@@ -55,7 +56,7 @@ private static OHTablePool newOHTablePool(final int maxSize, final PoolMap.PoolT
5556

5657
@BeforeClass
5758
public static void setup() throws Exception {
58-
Configuration c = new Configuration();
59+
Configuration c = HBaseConfiguration.create();
5960
ohTablePool = newOHTablePool(10, null);
6061
ohTablePool.setRuntimeBatchExecutor("test", Executors.newFixedThreadPool(3));
6162
hTable = ohTablePool.getTable("test");

0 commit comments

Comments
 (0)