Skip to content

Commit 4c4fda3

Browse files
stub: remove static Method descriptors and stabilize method accessors
1 parent 8fd762f commit 4c4fda3

File tree

20 files changed

+310
-936
lines changed

20 files changed

+310
-936
lines changed

alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,11 @@ private HandshakerServiceGrpc() {}
2727
public static final String SERVICE_NAME = "grpc.gcp.HandshakerService";
2828

2929
// Static method descriptors that strictly reflect the proto.
30-
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
31-
@java.lang.Deprecated // Use {@link #getDoHandshakeMethod()} instead.
32-
public static final io.grpc.MethodDescriptor<io.grpc.alts.internal.Handshaker.HandshakerReq,
33-
io.grpc.alts.internal.Handshaker.HandshakerResp> METHOD_DO_HANDSHAKE = getDoHandshakeMethodHelper();
34-
3530
private static volatile io.grpc.MethodDescriptor<io.grpc.alts.internal.Handshaker.HandshakerReq,
3631
io.grpc.alts.internal.Handshaker.HandshakerResp> getDoHandshakeMethod;
3732

38-
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
3933
public static io.grpc.MethodDescriptor<io.grpc.alts.internal.Handshaker.HandshakerReq,
4034
io.grpc.alts.internal.Handshaker.HandshakerResp> getDoHandshakeMethod() {
41-
return getDoHandshakeMethodHelper();
42-
}
43-
44-
private static io.grpc.MethodDescriptor<io.grpc.alts.internal.Handshaker.HandshakerReq,
45-
io.grpc.alts.internal.Handshaker.HandshakerResp> getDoHandshakeMethodHelper() {
4635
io.grpc.MethodDescriptor<io.grpc.alts.internal.Handshaker.HandshakerReq, io.grpc.alts.internal.Handshaker.HandshakerResp> getDoHandshakeMethod;
4736
if ((getDoHandshakeMethod = HandshakerServiceGrpc.getDoHandshakeMethod) == null) {
4837
synchronized (HandshakerServiceGrpc.class) {
@@ -104,13 +93,13 @@ public static abstract class HandshakerServiceImplBase implements io.grpc.Bindab
10493
*/
10594
public io.grpc.stub.StreamObserver<io.grpc.alts.internal.Handshaker.HandshakerReq> doHandshake(
10695
io.grpc.stub.StreamObserver<io.grpc.alts.internal.Handshaker.HandshakerResp> responseObserver) {
107-
return asyncUnimplementedStreamingCall(getDoHandshakeMethodHelper(), responseObserver);
96+
return asyncUnimplementedStreamingCall(getDoHandshakeMethod(), responseObserver);
10897
}
10998

11099
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
111100
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
112101
.addMethod(
113-
getDoHandshakeMethodHelper(),
102+
getDoHandshakeMethod(),
114103
asyncBidiStreamingCall(
115104
new MethodHandlers<
116105
io.grpc.alts.internal.Handshaker.HandshakerReq,
@@ -151,7 +140,7 @@ protected HandshakerServiceStub build(io.grpc.Channel channel,
151140
public io.grpc.stub.StreamObserver<io.grpc.alts.internal.Handshaker.HandshakerReq> doHandshake(
152141
io.grpc.stub.StreamObserver<io.grpc.alts.internal.Handshaker.HandshakerResp> responseObserver) {
153142
return asyncBidiStreamingCall(
154-
getChannel().newCall(getDoHandshakeMethodHelper(), getCallOptions()), responseObserver);
143+
getChannel().newCall(getDoHandshakeMethod(), getCallOptions()), responseObserver);
155144
}
156145
}
157146

@@ -276,7 +265,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
276265
if (result == null) {
277266
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
278267
.setSchemaDescriptor(new HandshakerServiceFileDescriptorSupplier())
279-
.addMethod(getDoHandshakeMethodHelper())
268+
.addMethod(getDoHandshakeMethod())
280269
.build();
281270
}
282271
}

benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java

Lines changed: 23 additions & 74 deletions
Large diffs are not rendered by default.

benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,11 @@ private ReportQpsScenarioServiceGrpc() {}
2727
public static final String SERVICE_NAME = "grpc.testing.ReportQpsScenarioService";
2828

2929
// Static method descriptors that strictly reflect the proto.
30-
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
31-
@java.lang.Deprecated // Use {@link #getReportScenarioMethod()} instead.
32-
public static final io.grpc.MethodDescriptor<io.grpc.benchmarks.proto.Control.ScenarioResult,
33-
io.grpc.benchmarks.proto.Control.Void> METHOD_REPORT_SCENARIO = getReportScenarioMethodHelper();
34-
3530
private static volatile io.grpc.MethodDescriptor<io.grpc.benchmarks.proto.Control.ScenarioResult,
3631
io.grpc.benchmarks.proto.Control.Void> getReportScenarioMethod;
3732

38-
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
3933
public static io.grpc.MethodDescriptor<io.grpc.benchmarks.proto.Control.ScenarioResult,
4034
io.grpc.benchmarks.proto.Control.Void> getReportScenarioMethod() {
41-
return getReportScenarioMethodHelper();
42-
}
43-
44-
private static io.grpc.MethodDescriptor<io.grpc.benchmarks.proto.Control.ScenarioResult,
45-
io.grpc.benchmarks.proto.Control.Void> getReportScenarioMethodHelper() {
4635
io.grpc.MethodDescriptor<io.grpc.benchmarks.proto.Control.ScenarioResult, io.grpc.benchmarks.proto.Control.Void> getReportScenarioMethod;
4736
if ((getReportScenarioMethod = ReportQpsScenarioServiceGrpc.getReportScenarioMethod) == null) {
4837
synchronized (ReportQpsScenarioServiceGrpc.class) {
@@ -99,13 +88,13 @@ public static abstract class ReportQpsScenarioServiceImplBase implements io.grpc
9988
*/
10089
public void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request,
10190
io.grpc.stub.StreamObserver<io.grpc.benchmarks.proto.Control.Void> responseObserver) {
102-
asyncUnimplementedUnaryCall(getReportScenarioMethodHelper(), responseObserver);
91+
asyncUnimplementedUnaryCall(getReportScenarioMethod(), responseObserver);
10392
}
10493

10594
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
10695
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
10796
.addMethod(
108-
getReportScenarioMethodHelper(),
97+
getReportScenarioMethod(),
10998
asyncUnaryCall(
11099
new MethodHandlers<
111100
io.grpc.benchmarks.proto.Control.ScenarioResult,
@@ -141,7 +130,7 @@ protected ReportQpsScenarioServiceStub build(io.grpc.Channel channel,
141130
public void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request,
142131
io.grpc.stub.StreamObserver<io.grpc.benchmarks.proto.Control.Void> responseObserver) {
143132
asyncUnaryCall(
144-
getChannel().newCall(getReportScenarioMethodHelper(), getCallOptions()), request, responseObserver);
133+
getChannel().newCall(getReportScenarioMethod(), getCallOptions()), request, responseObserver);
145134
}
146135
}
147136

@@ -170,7 +159,7 @@ protected ReportQpsScenarioServiceBlockingStub build(io.grpc.Channel channel,
170159
*/
171160
public io.grpc.benchmarks.proto.Control.Void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request) {
172161
return blockingUnaryCall(
173-
getChannel(), getReportScenarioMethodHelper(), getCallOptions(), request);
162+
getChannel(), getReportScenarioMethod(), getCallOptions(), request);
174163
}
175164
}
176165

@@ -200,7 +189,7 @@ protected ReportQpsScenarioServiceFutureStub build(io.grpc.Channel channel,
200189
public com.google.common.util.concurrent.ListenableFuture<io.grpc.benchmarks.proto.Control.Void> reportScenario(
201190
io.grpc.benchmarks.proto.Control.ScenarioResult request) {
202191
return futureUnaryCall(
203-
getChannel().newCall(getReportScenarioMethodHelper(), getCallOptions()), request);
192+
getChannel().newCall(getReportScenarioMethod(), getCallOptions()), request);
204193
}
205194
}
206195

@@ -288,7 +277,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
288277
if (result == null) {
289278
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
290279
.setSchemaDescriptor(new ReportQpsScenarioServiceFileDescriptorSupplier())
291-
.addMethod(getReportScenarioMethodHelper())
280+
.addMethod(getReportScenarioMethod())
292281
.build();
293282
}
294283
}

0 commit comments

Comments
 (0)