Skip to content

Commit 9445027

Browse files
committed
adapt master after rebase
1 parent cc37f37 commit 9445027

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import static com.alipay.oceanbase.rpc.location.model.TableEntry.HBASE_ROW_KEY_ELEMENT;
6363
import static com.alipay.oceanbase.rpc.location.model.partition.ObPartIdCalculator.*;
6464
import static com.alipay.oceanbase.rpc.property.Property.*;
65-
import static com.alipay.oceanbase.rpc.protocol.payload.ResultCodes.OB_ERR_KV_ROUTE_ENTRY_EXPIRE;
6665
import static com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObTableOperationType.*;
6766
import static com.alipay.oceanbase.rpc.util.TableClientLoggerFactory.*;
6867
import static java.lang.String.format;
@@ -2315,8 +2314,9 @@ private List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuer
23152314
ObTableParam param = new ObTableParam(obTable);
23162315
param.setPartId(partId);
23172316
partId = getTabletIdByPartId(tableEntry, partId);
2318-
param.setLsId(tableEntry.getPartitionEntry().getPartitionInfo(partId).getTabletLsId());
2319-
2317+
if (ObGlobal.obVsnMajor() >= 4 && tableEntry != null) {
2318+
param.setLsId(tableEntry.getPartitionEntry().getPartitionInfo(partId).getTabletLsId());
2319+
}
23202320
param.setTableId(tableEntry.getTableId());
23212321
// real partition(tablet) id
23222322
param.setPartitionId(partId);

src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientQueryImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ private AbstractQueryStreamResult commonExecute(InitQueryResultCallback<Abstract
171171
}
172172
}
173173
if (getPartId() != null && tableQuery.getIndexName() == null) {
174+
String realTableName = tableName;
174175
try {
175-
String realTableName = tableName;
176176
if (this.entityType == ObTableEntityType.HKV
177177
&& obTableClient.isTableGroupName(tableName)) {
178178
indexTableName = obTableClient.tryGetTableNameFromTableGroupCache(tableName,
@@ -190,7 +190,7 @@ private AbstractQueryStreamResult commonExecute(InitQueryResultCallback<Abstract
190190
} else if (((ObTableException) e).getErrorCode() == ResultCodes.OB_ERR_KV_ROUTE_ENTRY_EXPIRE.errorCode) {
191191
// retry one time with force-renew flag
192192
ObPair<Long, ObTableParam> odpTable = obTableClient.getODPTableWithPartId(
193-
tableName, getPartId(), true);
193+
realTableName, getPartId(), true);
194194
partitionObTables.put(odpTable.getLeft(), odpTable);
195195
} else {
196196
throw e;
@@ -199,7 +199,7 @@ private AbstractQueryStreamResult commonExecute(InitQueryResultCallback<Abstract
199199
throw e;
200200
}
201201
}
202-
} else {
202+
} else {
203203
partitionObTables.put(0L, new ObPair<Long, ObTableParam>(0L, new ObTableParam(
204204
obTableClient.getOdpTable())));
205205
}

src/test/java/com/alipay/oceanbase/rpc/ObGetPartitionTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,13 @@
1717

1818
package com.alipay.oceanbase.rpc;
1919

20-
import com.alipay.oceanbase.rpc.exception.ObTableException;
2120
import com.alipay.oceanbase.rpc.location.model.partition.Partition;
2221
import com.alipay.oceanbase.rpc.mutation.*;
2322
import com.alipay.oceanbase.rpc.mutation.result.BatchOperationResult;
2423
import com.alipay.oceanbase.rpc.mutation.result.MutationResult;
25-
import com.alipay.oceanbase.rpc.property.Property;
26-
import com.alipay.oceanbase.rpc.protocol.payload.impl.ObObj;
2724
import com.alipay.oceanbase.rpc.stream.QueryResultSet;
2825
import com.alipay.oceanbase.rpc.table.api.TableBatchOps;
29-
import com.alipay.oceanbase.rpc.table.api.TableQuery;
30-
import com.alipay.oceanbase.rpc.threadlocal.ThreadLocalMap;
3126
import com.alipay.oceanbase.rpc.util.ObTableClientTestUtil;
32-
import net.bytebuddy.implementation.auxiliary.MethodCallProxy;
33-
import org.junit.After;
3427
import org.junit.Assert;
3528
import org.junit.Before;
3629
import org.junit.Test;
@@ -44,9 +37,6 @@
4437
import static com.alipay.oceanbase.rpc.mutation.MutationFactory.*;
4538
import static com.alipay.oceanbase.rpc.util.ObTableClientTestUtil.cleanTable;
4639
import static com.alipay.oceanbase.rpc.util.ObTableClientTestUtil.generateRandomStringByUUID;
47-
import static org.junit.Assert.assertEquals;
48-
import static org.junit.Assert.assertNotNull;
49-
5040
public class ObGetPartitionTest {
5141

5242
public ObTableClient client;

0 commit comments

Comments
 (0)