Skip to content

Commit ca8a622

Browse files
authored
[close #782] bump grpc to 1.60.0 (#783)
1 parent 0af4384 commit ca8a622

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

pom.xml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@
5757
<protobuf.version>3.18.0</protobuf.version>
5858
<log4j.version>1.2.17</log4j.version>
5959
<slf4j.version>1.7.16</slf4j.version>
60-
<grpc.version>1.48.0</grpc.version>
60+
<grpc.version>1.60.0</grpc.version>
6161
<netty.tcnative.version>2.0.34.Final</netty.tcnative.version>
6262
<gson.version>2.8.9</gson.version>
6363
<powermock.version>1.6.6</powermock.version>
6464
<jackson-annotations.version>2.13.2</jackson-annotations.version>
6565
<jackson.version>2.13.4.2</jackson.version>
6666
<trove4j.version>3.0.1</trove4j.version>
67-
<jetcd.version>0.4.1</jetcd.version>
67+
<jetcd.version>0.7.7</jetcd.version>
6868
<joda-time.version>2.9.9</joda-time.version>
6969
<joda-convert.version>1.9.2</joda-convert.version>
7070
<proto.folder>${basedir}/proto</proto.folder>
@@ -188,20 +188,6 @@
188188
<dependency>
189189
<groupId>io.etcd</groupId>
190190
<artifactId>jetcd-core</artifactId>
191-
<exclusions>
192-
<exclusion>
193-
<groupId>io.etcd</groupId>
194-
<artifactId>jetcd-resolver</artifactId>
195-
</exclusion>
196-
<exclusion>
197-
<groupId>io.etcd</groupId>
198-
<artifactId>jetcd-common</artifactId>
199-
</exclusion>
200-
<exclusion>
201-
<groupId>io.grpc</groupId>
202-
<artifactId>grpc-grpclb</artifactId>
203-
</exclusion>
204-
</exclusions>
205191
<version>${jetcd.version}</version>
206192
</dependency>
207193
<dependency>

src/main/java/org/tikv/common/PDClient.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,11 @@ static class PDClientWrapper {
841841
Metadata header = new Metadata();
842842
header.put(TiConfiguration.PD_FORWARD_META_DATA_KEY, addrToUri(leaderInfo).toString());
843843
this.blockingStub =
844-
MetadataUtils.attachHeaders(PDGrpc.newBlockingStub(clientChannel), header);
845-
this.asyncStub = MetadataUtils.attachHeaders(PDGrpc.newFutureStub(clientChannel), header);
844+
PDGrpc.newBlockingStub(clientChannel)
845+
.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
846+
this.asyncStub =
847+
PDGrpc.newFutureStub(clientChannel)
848+
.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
846849
} else {
847850
this.blockingStub = PDGrpc.newBlockingStub(clientChannel);
848851
this.asyncStub = PDGrpc.newFutureStub(clientChannel);

src/main/java/org/tikv/common/region/AbstractRegionStoreClient.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ private void updateClientStub() {
209209
if (store.getProxyStore() != null) {
210210
Metadata header = new Metadata();
211211
header.put(TiConfiguration.FORWARD_META_DATA_KEY, store.getStore().getAddress());
212-
blockingStub = MetadataUtils.attachHeaders(blockingStub, header);
213-
asyncStub = MetadataUtils.attachHeaders(asyncStub, header);
212+
blockingStub =
213+
blockingStub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
214+
asyncStub = asyncStub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
214215
}
215216
}
216217

@@ -371,7 +372,8 @@ private TiStore switchProxyStore(BackOffer backOffer) {
371372
.setKey(codec.encodeKey(key))
372373
.build();
373374
ListenableFuture<Kvrpcpb.RawGetResponse> task =
374-
MetadataUtils.attachHeaders(stub, header).rawGet(rawGetRequest);
375+
stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header))
376+
.rawGet(rawGetRequest);
375377
responses.add(new ForwardCheckTask(task, peerStore.getStore()));
376378
} catch (Exception e) {
377379
logger.warn(

src/main/java/org/tikv/common/region/RegionStoreClient.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,8 +1395,12 @@ public RegionStoreClient build(TiRegion region, TiStore store, TiStoreType store
13951395
channelFactory.getChannel(addressStr, regionManager.getPDClient().getHostMapping());
13961396
Metadata header = new Metadata();
13971397
header.put(TiConfiguration.FORWARD_META_DATA_KEY, store.getStore().getAddress());
1398-
blockingStub = MetadataUtils.attachHeaders(TikvGrpc.newBlockingStub(channel), header);
1399-
asyncStub = MetadataUtils.attachHeaders(TikvGrpc.newFutureStub(channel), header);
1398+
blockingStub =
1399+
TikvGrpc.newBlockingStub(channel)
1400+
.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
1401+
asyncStub =
1402+
TikvGrpc.newFutureStub(channel)
1403+
.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(header));
14001404
} else {
14011405
channel = channelFactory.getChannel(addressStr, pdClient.getHostMapping());
14021406
blockingStub = TikvGrpc.newBlockingStub(channel);

0 commit comments

Comments
 (0)