mirror of https://github.com/tikv/client-java.git
parent
0af438476a
commit
ca8a622ea1
18
pom.xml
18
pom.xml
|
@ -57,14 +57,14 @@
|
|||
<protobuf.version>3.18.0</protobuf.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<slf4j.version>1.7.16</slf4j.version>
|
||||
<grpc.version>1.48.0</grpc.version>
|
||||
<grpc.version>1.60.0</grpc.version>
|
||||
<netty.tcnative.version>2.0.34.Final</netty.tcnative.version>
|
||||
<gson.version>2.8.9</gson.version>
|
||||
<powermock.version>1.6.6</powermock.version>
|
||||
<jackson-annotations.version>2.13.2</jackson-annotations.version>
|
||||
<jackson.version>2.13.4.2</jackson.version>
|
||||
<trove4j.version>3.0.1</trove4j.version>
|
||||
<jetcd.version>0.4.1</jetcd.version>
|
||||
<jetcd.version>0.7.7</jetcd.version>
|
||||
<joda-time.version>2.9.9</joda-time.version>
|
||||
<joda-convert.version>1.9.2</joda-convert.version>
|
||||
<proto.folder>${basedir}/proto</proto.folder>
|
||||
|
@ -188,20 +188,6 @@
|
|||
<dependency>
|
||||
<groupId>io.etcd</groupId>
|
||||
<artifactId>jetcd-core</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.etcd</groupId>
|
||||
<artifactId>jetcd-resolver</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>io.etcd</groupId>
|
||||
<artifactId>jetcd-common</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-grpclb</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<version>${jetcd.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -841,8 +841,11 @@ public class PDClient extends AbstractGRPCClient<PDBlockingStub, PDFutureStub>
|
|||
Metadata header = new Metadata();
|
||||
header.put(TiConfiguration.PD_FORWARD_META_DATA_KEY, addrToUri(leaderInfo).toString());
|
||||
this.blockingStub =
|
||||
MetadataUtils.attachHeaders(PDGrpc.newBlockingStub(clientChannel), header);
|
||||
this.asyncStub = MetadataUtils.attachHeaders(PDGrpc.newFutureStub(clientChannel), header);
|
||||
PDGrpc.newBlockingStub(clientChannel)
|
||||
.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
|
||||
this.asyncStub =
|
||||
PDGrpc.newFutureStub(clientChannel)
|
||||
.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
|
||||
} else {
|
||||
this.blockingStub = PDGrpc.newBlockingStub(clientChannel);
|
||||
this.asyncStub = PDGrpc.newFutureStub(clientChannel);
|
||||
|
|
|
@ -209,8 +209,9 @@ public abstract class AbstractRegionStoreClient
|
|||
if (store.getProxyStore() != null) {
|
||||
Metadata header = new Metadata();
|
||||
header.put(TiConfiguration.FORWARD_META_DATA_KEY, store.getStore().getAddress());
|
||||
blockingStub = MetadataUtils.attachHeaders(blockingStub, header);
|
||||
asyncStub = MetadataUtils.attachHeaders(asyncStub, header);
|
||||
blockingStub =
|
||||
blockingStub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
|
||||
asyncStub = asyncStub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -371,7 +372,8 @@ public abstract class AbstractRegionStoreClient
|
|||
.setKey(codec.encodeKey(key))
|
||||
.build();
|
||||
ListenableFuture<Kvrpcpb.RawGetResponse> task =
|
||||
MetadataUtils.attachHeaders(stub, header).rawGet(rawGetRequest);
|
||||
stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header))
|
||||
.rawGet(rawGetRequest);
|
||||
responses.add(new ForwardCheckTask(task, peerStore.getStore()));
|
||||
} catch (Exception e) {
|
||||
logger.warn(
|
||||
|
|
|
@ -1395,8 +1395,12 @@ public class RegionStoreClient extends AbstractRegionStoreClient {
|
|||
channelFactory.getChannel(addressStr, regionManager.getPDClient().getHostMapping());
|
||||
Metadata header = new Metadata();
|
||||
header.put(TiConfiguration.FORWARD_META_DATA_KEY, store.getStore().getAddress());
|
||||
blockingStub = MetadataUtils.attachHeaders(TikvGrpc.newBlockingStub(channel), header);
|
||||
asyncStub = MetadataUtils.attachHeaders(TikvGrpc.newFutureStub(channel), header);
|
||||
blockingStub =
|
||||
TikvGrpc.newBlockingStub(channel)
|
||||
.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
|
||||
asyncStub =
|
||||
TikvGrpc.newFutureStub(channel)
|
||||
.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
|
||||
} else {
|
||||
channel = channelFactory.getChannel(addressStr, pdClient.getHostMapping());
|
||||
blockingStub = TikvGrpc.newBlockingStub(channel);
|
||||
|
|
Loading…
Reference in New Issue