Skip to content

Commit a16d655

Browse files
authored
compiler: generate blocking v2 unary calls that throw StatusException (#12126)
1 parent 6afacf5 commit a16d655

File tree

40 files changed

+157
-138
lines changed

40 files changed

+157
-138
lines changed

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ protected LoadBalancerStatsServiceBlockingV2Stub build(
242242
* Gets the backend distribution for RPCs sent by a test client.
243243
* </pre>
244244
*/
245-
public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) {
246-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
245+
public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) throws io.grpc.StatusException {
246+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
247247
getChannel(), getGetClientStatsMethod(), getCallOptions(), request);
248248
}
249249

@@ -252,8 +252,8 @@ public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientS
252252
* Gets the accumulated stats for RPCs sent by a test client.
253253
* </pre>
254254
*/
255-
public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) {
256-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
255+
public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) throws io.grpc.StatusException {
256+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
257257
getChannel(), getGetClientAccumulatedStatsMethod(), getCallOptions(), request);
258258
}
259259
}

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ protected MetricsServiceBlockingV2Stub build(
242242
* Returns the value of one gauge
243243
* </pre>
244244
*/
245-
public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) {
246-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
245+
public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) throws io.grpc.StatusException {
246+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
247247
getChannel(), getGetGaugeMethod(), getCallOptions(), request);
248248
}
249249
}

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ protected ReconnectServiceBlockingV2Stub build(
227227

228228
/**
229229
*/
230-
public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) {
231-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
230+
public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) throws io.grpc.StatusException {
231+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
232232
getChannel(), getStartMethod(), getCallOptions(), request);
233233
}
234234

235235
/**
236236
*/
237-
public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) {
238-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
237+
public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
238+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
239239
getChannel(), getStopMethod(), getCallOptions(), request);
240240
}
241241
}

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ protected TestServiceBlockingV2Stub build(
573573
* One empty request followed by one empty response.
574574
* </pre>
575575
*/
576-
public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) {
577-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
576+
public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
577+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
578578
getChannel(), getEmptyCallMethod(), getCallOptions(), request);
579579
}
580580

@@ -583,8 +583,8 @@ public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.i
583583
* One request followed by one response.
584584
* </pre>
585585
*/
586-
public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) {
587-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
586+
public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException {
587+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
588588
getChannel(), getUnaryCallMethod(), getCallOptions(), request);
589589
}
590590

@@ -595,8 +595,8 @@ public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.tes
595595
* satisfy subsequent requests.
596596
* </pre>
597597
*/
598-
public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) {
599-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
598+
public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException {
599+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
600600
getChannel(), getCacheableUnaryCallMethod(), getCallOptions(), request);
601601
}
602602

@@ -661,8 +661,8 @@ public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io
661661
* to test the behavior when clients call unimplemented methods.
662662
* </pre>
663663
*/
664-
public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) {
665-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
664+
public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
665+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
666666
getChannel(), getUnimplementedCallMethod(), getCallOptions(), request);
667667
}
668668
}

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ protected UnimplementedServiceBlockingV2Stub build(
196196
* A call that no server should implement
197197
* </pre>
198198
*/
199-
public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) {
200-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
199+
public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
200+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
201201
getChannel(), getUnimplementedCallMethod(), getCallOptions(), request);
202202
}
203203
}

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ protected XdsUpdateClientConfigureServiceBlockingV2Stub build(
191191
* Update the tes client's configuration.
192192
* </pre>
193193
*/
194-
public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) {
195-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
194+
public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) throws io.grpc.StatusException {
195+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
196196
getChannel(), getConfigureMethod(), getCallOptions(), request);
197197
}
198198
}

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ protected XdsUpdateHealthServiceBlockingV2Stub build(
227227

228228
/**
229229
*/
230-
public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) {
231-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
230+
public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
231+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
232232
getChannel(), getSetServingMethod(), getCallOptions(), request);
233233
}
234234

235235
/**
236236
*/
237-
public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) {
238-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
237+
public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
238+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
239239
getChannel(), getSetNotServingMethod(), getCallOptions(), request);
240240
}
241241
}

android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ protected LoadBalancerStatsServiceBlockingV2Stub build(
242242
* Gets the backend distribution for RPCs sent by a test client.
243243
* </pre>
244244
*/
245-
public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) {
246-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
245+
public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) throws io.grpc.StatusException {
246+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
247247
getChannel(), getGetClientStatsMethod(), getCallOptions(), request);
248248
}
249249

@@ -252,8 +252,8 @@ public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientS
252252
* Gets the accumulated stats for RPCs sent by a test client.
253253
* </pre>
254254
*/
255-
public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) {
256-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
255+
public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) throws io.grpc.StatusException {
256+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
257257
getChannel(), getGetClientAccumulatedStatsMethod(), getCallOptions(), request);
258258
}
259259
}

android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ protected MetricsServiceBlockingV2Stub build(
242242
* Returns the value of one gauge
243243
* </pre>
244244
*/
245-
public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) {
246-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
245+
public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) throws io.grpc.StatusException {
246+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
247247
getChannel(), getGetGaugeMethod(), getCallOptions(), request);
248248
}
249249
}

android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ protected ReconnectServiceBlockingV2Stub build(
227227

228228
/**
229229
*/
230-
public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) {
231-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
230+
public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) throws io.grpc.StatusException {
231+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
232232
getChannel(), getStartMethod(), getCallOptions(), request);
233233
}
234234

235235
/**
236236
*/
237-
public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) {
238-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
237+
public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
238+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
239239
getChannel(), getStopMethod(), getCallOptions(), request);
240240
}
241241
}

android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ protected TestServiceBlockingV2Stub build(
573573
* One empty request followed by one empty response.
574574
* </pre>
575575
*/
576-
public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) {
577-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
576+
public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
577+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
578578
getChannel(), getEmptyCallMethod(), getCallOptions(), request);
579579
}
580580

@@ -583,8 +583,8 @@ public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.i
583583
* One request followed by one response.
584584
* </pre>
585585
*/
586-
public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) {
587-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
586+
public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException {
587+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
588588
getChannel(), getUnaryCallMethod(), getCallOptions(), request);
589589
}
590590

@@ -595,8 +595,8 @@ public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.tes
595595
* satisfy subsequent requests.
596596
* </pre>
597597
*/
598-
public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) {
599-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
598+
public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException {
599+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
600600
getChannel(), getCacheableUnaryCallMethod(), getCallOptions(), request);
601601
}
602602

@@ -661,8 +661,8 @@ public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io
661661
* to test the behavior when clients call unimplemented methods.
662662
* </pre>
663663
*/
664-
public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) {
665-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
664+
public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
665+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
666666
getChannel(), getUnimplementedCallMethod(), getCallOptions(), request);
667667
}
668668
}

android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ protected UnimplementedServiceBlockingV2Stub build(
196196
* A call that no server should implement
197197
* </pre>
198198
*/
199-
public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) {
200-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
199+
public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
200+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
201201
getChannel(), getUnimplementedCallMethod(), getCallOptions(), request);
202202
}
203203
}

android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ protected XdsUpdateClientConfigureServiceBlockingV2Stub build(
191191
* Update the tes client's configuration.
192192
* </pre>
193193
*/
194-
public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) {
195-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
194+
public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) throws io.grpc.StatusException {
195+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
196196
getChannel(), getConfigureMethod(), getCallOptions(), request);
197197
}
198198
}

android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ protected XdsUpdateHealthServiceBlockingV2Stub build(
227227

228228
/**
229229
*/
230-
public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) {
231-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
230+
public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
231+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
232232
getChannel(), getSetServingMethod(), getCallOptions(), request);
233233
}
234234

235235
/**
236236
*/
237-
public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) {
238-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
237+
public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException {
238+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
239239
getChannel(), getSetNotServingMethod(), getCallOptions(), request);
240240
}
241241
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ protected BenchmarkServiceBlockingV2Stub build(
398398
* The server returns the client payload as-is.
399399
* </pre>
400400
*/
401-
public io.grpc.benchmarks.proto.Messages.SimpleResponse unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request) {
402-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
401+
public io.grpc.benchmarks.proto.Messages.SimpleResponse unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request) throws io.grpc.StatusException {
402+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
403403
getChannel(), getUnaryCallMethod(), getCallOptions(), request);
404404
}
405405

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ protected ReportQpsScenarioServiceBlockingV2Stub build(
177177
* Report results of a QPS test benchmark scenario.
178178
* </pre>
179179
*/
180-
public io.grpc.benchmarks.proto.Control.Void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request) {
181-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
180+
public io.grpc.benchmarks.proto.Control.Void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request) throws io.grpc.StatusException {
181+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
182182
getChannel(), getReportScenarioMethod(), getCallOptions(), request);
183183
}
184184
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ protected WorkerServiceBlockingV2Stub build(
387387
* Just return the core count - unary call
388388
* </pre>
389389
*/
390-
public io.grpc.benchmarks.proto.Control.CoreResponse coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request) {
391-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
390+
public io.grpc.benchmarks.proto.Control.CoreResponse coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request) throws io.grpc.StatusException {
391+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
392392
getChannel(), getCoreCountMethod(), getCallOptions(), request);
393393
}
394394

@@ -397,8 +397,8 @@ public io.grpc.benchmarks.proto.Control.CoreResponse coreCount(io.grpc.benchmark
397397
* Quit this worker
398398
* </pre>
399399
*/
400-
public io.grpc.benchmarks.proto.Control.Void quitWorker(io.grpc.benchmarks.proto.Control.Void request) {
401-
return io.grpc.stub.ClientCalls.blockingUnaryCall(
400+
public io.grpc.benchmarks.proto.Control.Void quitWorker(io.grpc.benchmarks.proto.Control.Void request) throws io.grpc.StatusException {
401+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
402402
getChannel(), getQuitWorkerMethod(), getCallOptions(), request);
403403
}
404404
}

compiler/src/java_plugin/cpp/java_generator.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,9 +745,10 @@ static void PrintStub(
745745
" $lower_method_name$($input_type$ request)");
746746
} else {
747747
// Simple RPC
748+
(*vars)["throws_decl"] = " throws io.grpc.StatusException";
748749
p->Print(
749750
*vars,
750-
"$output_type$ $lower_method_name$($input_type$ request)");
751+
"$output_type$ $lower_method_name$($input_type$ request)$throws_decl$");
751752
}
752753
break;
753754
case ASYNC_CALL:
@@ -827,7 +828,8 @@ static void PrintStub(
827828
if (server_streaming) {
828829
(*vars)["calls_method"] = "io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall";
829830
} else {
830-
(*vars)["calls_method"] = "io.grpc.stub.ClientCalls.blockingUnaryCall";
831+
(*vars)["calls_method"] = "io.grpc.stub.ClientCalls.blockingV2UnaryCall";
832+
(*vars)["throws_decl"] = " throws io.grpc.StatusException";
831833
}
832834

833835
p->Print(

0 commit comments

Comments
 (0)