Skip to content

Commit 789a28a

Browse files
authored
Merge branch 'master' into obkv-table-client-1.3.0.1-shaded
2 parents b310171 + b3f35e5 commit 789a28a

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.oceanbase</groupId>
66
<artifactId>obkv-table-client</artifactId>
7-
<version>1.3.0.1</version>
7+
<version>1.3.0.1-SNAPSHOT</version>
88

99
<name>${project.groupId}:${project.artifactId}</name>
1010
<description>OceanBase JavaClient for TableApi</description>
@@ -27,7 +27,7 @@
2727

2828
<scm>
2929
<connection>scm:git:https://github.com/oceanbase/obkv-table-client-java.git</connection>
30-
<tag>obkv-table-client-1.3.0</tag>
30+
<tag>HEAD</tag>
3131
<url>https://github.com/oceanbase/obkv-table-client-java</url>
3232
</scm>
3333

@@ -380,7 +380,7 @@
380380
</goals>
381381
<configuration>
382382
<rules>
383-
<DependencyConvergence></DependencyConvergence>
383+
<DependencyConvergence />
384384
</rules>
385385
</configuration>
386386
</execution>

src/main/java/com/alipay/oceanbase/rpc/bolt/transport/ObConnectionFactory.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
import com.alipay.remoting.codec.Codec;
2323
import com.alipay.remoting.config.ConfigManager;
2424
import com.alipay.remoting.config.ConfigurableInstance;
25-
import com.alipay.remoting.connection.AbstractConnectionFactory;
2625
import com.alipay.remoting.connection.ConnectionFactory;
27-
import com.alipay.remoting.log.BoltLoggerFactory;
2826
import com.alipay.remoting.rpc.RpcHandler;
2927
import com.alipay.remoting.rpc.protocol.UserProcessor;
3028
import com.alipay.remoting.util.NettyEventLoopUtil;
@@ -35,14 +33,14 @@
3533
import io.netty.channel.*;
3634
import io.netty.channel.socket.SocketChannel;
3735
import org.slf4j.Logger;
36+
import org.slf4j.LoggerFactory;
3837

3938
import java.net.InetSocketAddress;
4039
import java.util.concurrent.ConcurrentHashMap;
4140

4241
public class ObConnectionFactory implements ConnectionFactory {
4342

44-
private static final Logger logger = BoltLoggerFactory
45-
.getLogger(AbstractConnectionFactory.class);
43+
private static final Logger logger = LoggerFactory.getLogger(ObConnectionFactory.class);
4644

4745
private static final EventLoopGroup workerGroup = NettyEventLoopUtil.newEventLoopGroup(Runtime
4846
.getRuntime().availableProcessors() + 1,

src/main/java/com/alipay/oceanbase/rpc/bolt/transport/ObTableConnection.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,12 @@ private void login() throws Exception {
173173
credential = result.getCredential();
174174
tenantId = result.getTenantId();
175175
// Set version if missing
176-
if (ObGlobal.obVsnMajor() == 0 && !result.getServerVersion().isEmpty()) {
176+
if (ObGlobal.obVsnMajor() == 0) {
177177
// version should be set before login when direct mode
178+
if (result.getServerVersion().isEmpty()) {
179+
throw new RuntimeException(
180+
"Failed to get server version from login result");
181+
}
178182
LocationUtil.parseObVerionFromLogin(result.getServerVersion());
179183
LOGGER.info("The OB_VERSION parsed from login result is: {}",
180184
ObGlobal.OB_VERSION);

src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/query/AbstractQueryStreamResult.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,11 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger,
231231
}
232232
} else if (e instanceof ObTableException) {
233233
if ((((ObTableException) e).getErrorCode() == ResultCodes.OB_TABLE_NOT_EXIST.errorCode || ((ObTableException) e)
234-
.getErrorCode() == ResultCodes.OB_NOT_SUPPORTED.errorCode)
235-
&& ((request instanceof ObTableQueryAsyncRequest && ((ObTableQueryAsyncRequest) request).getObTableQueryRequest().getTableQuery().isHbaseQuery())
236-
|| (request instanceof ObTableQueryRequest && ((ObTableQueryRequest) request).getTableQuery().isHbaseQuery()))
237-
&& client.getTableGroupInverted().get(indexTableName) != null) {
234+
.getErrorCode() == ResultCodes.OB_NOT_SUPPORTED.errorCode)
235+
&& ((request instanceof ObTableQueryAsyncRequest && ((ObTableQueryAsyncRequest) request)
236+
.getObTableQueryRequest().getTableQuery().isHbaseQuery()) || (request instanceof ObTableQueryRequest && ((ObTableQueryRequest) request)
237+
.getTableQuery().isHbaseQuery()))
238+
&& client.getTableGroupInverted().get(indexTableName) != null) {
238239
// table not exists && hbase mode && table group exists , three condition both
239240
client.eraseTableGroupFromCache(tableName);
240241
}
@@ -254,7 +255,7 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger,
254255
((ObTableException) e).getErrorCode(), tryTimes, e);
255256
// tablet not exists, refresh table entry
256257
if (e instanceof ObTableNeedFetchAllException) {
257-
client.getOrRefreshTableEntry(tableName, true, true, true);
258+
client.getOrRefreshTableEntry(indexTableName, true, true, true);
258259
throw e;
259260
}
260261
} else {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ public Map<Long, ObPair<Long, ObTableParam>> initPartitions(ObTableQuery tableQu
241241

242242
if (!this.obTableClient.isOdpMode()) {
243243
indexTableName = obTableClient.getIndexTableName(tableName, indexName, tableQuery.getScanRangeColumns(), false);
244+
this.indexTableName = indexTableName;
244245
}
245246

246247
for (ObNewRange range : tableQuery.getKeyRanges()) {
@@ -262,6 +263,7 @@ public Map<Long, ObPair<Long, ObTableParam>> initPartitions(ObTableQuery tableQu
262263
}
263264
if (this.entityType == ObTableEntityType.HKV && obTableClient.isTableGroupName(tableName)) {
264265
indexTableName = obTableClient.tryGetTableNameFromTableGroupCache(tableName, false);
266+
this.indexTableName = indexTableName;
265267
}
266268
ObBorderFlag borderFlag = range.getBorderFlag();
267269
List<ObPair<Long, ObTableParam>> pairs = this.obTableClient.getTables(indexTableName,

0 commit comments

Comments
 (0)