From 590286ebda9363e096a4c5b7d29e7a5a4fe38b6d Mon Sep 17 00:00:00 2001 From: maochongxin Date: Wed, 31 Jul 2024 11:59:00 +0800 Subject: [PATCH] getTable for better user compatibility --- .../alipay/oceanbase/rpc/ObTableClient.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java b/src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java index f3a5d021..1ae77e7c 100644 --- a/src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java +++ b/src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java @@ -1433,6 +1433,21 @@ private ReplicaLocation getPartitionLocation(TableEntry tableEntry, long partId, } } + /** + * + * @param tableName table want to get for user compatible + * @param rowKey row key + * @param refresh whether to refresh + * @param waitForRefresh whether wait for refresh + * @param needFetchAll whether need fetch all + * @return ObPair of partId and table + * @throws Exception exception + */ + public ObPair getTable(String tableName, Object[] rowKey, + boolean refresh, boolean waitForRefresh, boolean needFetchAll) + throws Exception { + return getTableBySingleRowKey(tableName, rowKey, refresh, waitForRefresh, needFetchAll); + } /** * * @param tableName table want to get @@ -1450,6 +1465,27 @@ public ObPair getTableBySingleRowKey(String tableName, Objec return getTableBySingleRowKeyWithRoute(tableName, rowKey, refresh, waitForRefresh, needFetchAll, route); } + /** + * + * @param tableName table want to get for user compatible + * @param rowKey row key + * @param refresh whether to refresh + * @param waitForRefresh whether wait for refresh + * @param route ObServer route + * @return ObPair of partId and table + * @throws Exception exception + */ + public ObPair getTable(String tableName, + Object[] rowKey, + boolean refresh, + boolean waitForRefresh, + boolean needFetchAll, + ObServerRoute route) throws Exception { + + return getTableBySingleRowKeyWithRoute(tableName, rowKey, refresh, waitForRefresh, needFetchAll, route); + } + + /** * * @param tableName table want to get