Skip to content

Commit 1a5c654

Browse files
authored
add NPE check when tryGetTableNameFromTableGroupCache (#364)
1 parent 4f57553 commit 1a5c654

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ public static boolean isDistributedExecSupport() {
113113
return OB_VERSION >= OB_VERSION_4_3_5_2;
114114
}
115115

116+
public static boolean isHBaseAdminSupport() {
117+
return OB_VERSION >= OB_VERSION_4_3_5_3;
118+
}
119+
116120
public static boolean isCellTTLSupport() {
117121
return OB_VERSION >= OB_VERSION_4_3_5_1;
118122
}
@@ -131,5 +135,7 @@ public static boolean isCellTTLSupport() {
131135

132136
public static final long OB_VERSION_4_3_5_2 = calcVersion(4, (short) 3, (byte) 5, (byte) 2);
133137

138+
public static final long OB_VERSION_4_3_5_3 = calcVersion(4, (short) 3, (byte) 5, (byte) 3);
139+
134140
public static long OB_VERSION = calcVersion(0, (short) 0, (byte) 0, (byte) 0);
135141
}

src/main/java/com/alipay/oceanbase/rpc/location/model/TableRoute.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,9 @@ private List<ObTableParam> getOdpTablesInternal(String tableName, List<String> s
13141314
*/
13151315
public String tryGetTableNameFromTableGroupCache(final String tableGroupName,
13161316
final boolean refresh) throws Exception {
1317+
if (tableGroupCache == null && tableClient.isOdpMode()) {
1318+
throw new FeatureNotSupportedException("not supported yet in odp mode");
1319+
}
13171320
return tableGroupCache.tryGetTableNameFromTableGroupCache(tableGroupName, refresh,
13181321
serverRoster, sysUA);
13191322
}

0 commit comments

Comments
 (0)