From a16d6559194d1598197d210a8aa9593e336128b1 Mon Sep 17 00:00:00 2001 From: MV Shiva Date: Tue, 10 Jun 2025 10:31:03 +0530 Subject: [PATCH] compiler: generate blocking v2 unary calls that throw StatusException (#12126) --- .../LoadBalancerStatsServiceGrpc.java | 8 +++--- .../integration/MetricsServiceGrpc.java | 4 +-- .../integration/ReconnectServiceGrpc.java | 8 +++--- .../testing/integration/TestServiceGrpc.java | 16 +++++------ .../integration/UnimplementedServiceGrpc.java | 4 +-- .../XdsUpdateClientConfigureServiceGrpc.java | 4 +-- .../XdsUpdateHealthServiceGrpc.java | 8 +++--- .../LoadBalancerStatsServiceGrpc.java | 8 +++--- .../integration/MetricsServiceGrpc.java | 4 +-- .../integration/ReconnectServiceGrpc.java | 8 +++--- .../testing/integration/TestServiceGrpc.java | 16 +++++------ .../integration/UnimplementedServiceGrpc.java | 4 +-- .../XdsUpdateClientConfigureServiceGrpc.java | 4 +-- .../XdsUpdateHealthServiceGrpc.java | 8 +++--- .../proto/BenchmarkServiceGrpc.java | 4 +-- .../proto/ReportQpsScenarioServiceGrpc.java | 4 +-- .../benchmarks/proto/WorkerServiceGrpc.java | 8 +++--- .../src/java_plugin/cpp/java_generator.cpp | 6 ++-- .../golden/TestDeprecatedService.java.txt | 4 +-- compiler/src/test/golden/TestService.java.txt | 12 ++++---- .../golden/TestDeprecatedService.java.txt | 4 +-- .../src/testLite/golden/TestService.java.txt | 12 ++++---- .../LoadBalancerStatsServiceGrpc.java | 8 +++--- .../integration/MetricsServiceGrpc.java | 4 +-- .../integration/ReconnectServiceGrpc.java | 8 +++--- .../testing/integration/TestServiceGrpc.java | 16 +++++------ .../integration/UnimplementedServiceGrpc.java | 4 +-- .../XdsUpdateClientConfigureServiceGrpc.java | 4 +-- .../XdsUpdateHealthServiceGrpc.java | 8 +++--- .../io/istio/test/EchoTestServiceGrpc.java | 8 +++--- .../lookup/v1/RouteLookupServiceGrpc.java | 4 +-- .../io/grpc/channelz/v1/ChannelzGrpc.java | 28 +++++++++---------- .../grpc/io/grpc/health/v1/HealthGrpc.java | 4 +-- .../testing/AnotherDynamicServiceGrpc.java | 4 +-- .../AnotherReflectableServiceGrpc.java | 4 +-- .../testing/DynamicServiceGrpc.java | 4 +-- .../testing/ReflectableServiceGrpc.java | 4 +-- .../main/java/io/grpc/stub/ClientCalls.java | 17 +++++++++++ .../testing/protobuf/SimpleServiceGrpc.java | 4 +-- .../v3/ClientStatusDiscoveryServiceGrpc.java | 4 +-- 40 files changed, 157 insertions(+), 138 deletions(-) diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java index 42934e94c5..33b914bb4b 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java @@ -242,8 +242,8 @@ public final class LoadBalancerStatsServiceGrpc { * Gets the backend distribution for RPCs sent by a test client. * */ - public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetClientStatsMethod(), getCallOptions(), request); } @@ -252,8 +252,8 @@ public final class LoadBalancerStatsServiceGrpc { * Gets the accumulated stats for RPCs sent by a test client. * */ - public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetClientAccumulatedStatsMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index 6c2166468f..c99abcff7c 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -242,8 +242,8 @@ public final class MetricsServiceGrpc { * Returns the value of one gauge * */ - public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetGaugeMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index 07ce250bc4..fffcaad2df 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -227,15 +227,15 @@ public final class ReconnectServiceGrpc { /** */ - public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getStartMethod(), getCallOptions(), request); } /** */ - public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getStopMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java index 4593215b60..1d7805e3a3 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -573,8 +573,8 @@ public final class TestServiceGrpc { * One empty request followed by one empty response. * */ - public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getEmptyCallMethod(), getCallOptions(), request); } @@ -583,8 +583,8 @@ public final class TestServiceGrpc { * One request followed by one response. * */ - public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnaryCallMethod(), getCallOptions(), request); } @@ -595,8 +595,8 @@ public final class TestServiceGrpc { * satisfy subsequent requests. * */ - public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getCacheableUnaryCallMethod(), getCallOptions(), request); } @@ -661,8 +661,8 @@ public final class TestServiceGrpc { * to test the behavior when clients call unimplemented methods. * */ - public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnimplementedCallMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index d9ef0e6ddd..bec9b5a723 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -196,8 +196,8 @@ public final class UnimplementedServiceGrpc { * A call that no server should implement * */ - public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnimplementedCallMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java index 8ae0c2f93a..3453b6c01b 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java @@ -191,8 +191,8 @@ public final class XdsUpdateClientConfigureServiceGrpc { * Update the tes client's configuration. * */ - public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getConfigureMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java index 5b950c73c1..fb5f2cdebc 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java @@ -227,15 +227,15 @@ public final class XdsUpdateHealthServiceGrpc { /** */ - public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getSetServingMethod(), getCallOptions(), request); } /** */ - public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getSetNotServingMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java index 42934e94c5..33b914bb4b 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java @@ -242,8 +242,8 @@ public final class LoadBalancerStatsServiceGrpc { * Gets the backend distribution for RPCs sent by a test client. * */ - public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetClientStatsMethod(), getCallOptions(), request); } @@ -252,8 +252,8 @@ public final class LoadBalancerStatsServiceGrpc { * Gets the accumulated stats for RPCs sent by a test client. * */ - public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetClientAccumulatedStatsMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index 6c2166468f..c99abcff7c 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -242,8 +242,8 @@ public final class MetricsServiceGrpc { * Returns the value of one gauge * */ - public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetGaugeMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index 07ce250bc4..fffcaad2df 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -227,15 +227,15 @@ public final class ReconnectServiceGrpc { /** */ - public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getStartMethod(), getCallOptions(), request); } /** */ - public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getStopMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java index 4593215b60..1d7805e3a3 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -573,8 +573,8 @@ public final class TestServiceGrpc { * One empty request followed by one empty response. * */ - public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getEmptyCallMethod(), getCallOptions(), request); } @@ -583,8 +583,8 @@ public final class TestServiceGrpc { * One request followed by one response. * */ - public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnaryCallMethod(), getCallOptions(), request); } @@ -595,8 +595,8 @@ public final class TestServiceGrpc { * satisfy subsequent requests. * */ - public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getCacheableUnaryCallMethod(), getCallOptions(), request); } @@ -661,8 +661,8 @@ public final class TestServiceGrpc { * to test the behavior when clients call unimplemented methods. * */ - public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnimplementedCallMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index d9ef0e6ddd..bec9b5a723 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -196,8 +196,8 @@ public final class UnimplementedServiceGrpc { * A call that no server should implement * */ - public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnimplementedCallMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java index 8ae0c2f93a..3453b6c01b 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java @@ -191,8 +191,8 @@ public final class XdsUpdateClientConfigureServiceGrpc { * Update the tes client's configuration. * */ - public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getConfigureMethod(), getCallOptions(), request); } } diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java index 5b950c73c1..fb5f2cdebc 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java @@ -227,15 +227,15 @@ public final class XdsUpdateHealthServiceGrpc { /** */ - public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getSetServingMethod(), getCallOptions(), request); } /** */ - public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getSetNotServingMethod(), getCallOptions(), request); } } diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java index 15b9a67918..68e911afc4 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java @@ -398,8 +398,8 @@ public final class BenchmarkServiceGrpc { * The server returns the client payload as-is. * */ - public io.grpc.benchmarks.proto.Messages.SimpleResponse unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.benchmarks.proto.Messages.SimpleResponse unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnaryCallMethod(), getCallOptions(), request); } diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java index 8fe5f926d9..c5064875bb 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java @@ -177,8 +177,8 @@ public final class ReportQpsScenarioServiceGrpc { * Report results of a QPS test benchmark scenario. * */ - public io.grpc.benchmarks.proto.Control.Void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.benchmarks.proto.Control.Void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getReportScenarioMethod(), getCallOptions(), request); } } diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java index bf9649e837..721b4f9ab1 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java @@ -387,8 +387,8 @@ public final class WorkerServiceGrpc { * Just return the core count - unary call * */ - public io.grpc.benchmarks.proto.Control.CoreResponse coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.benchmarks.proto.Control.CoreResponse coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getCoreCountMethod(), getCallOptions(), request); } @@ -397,8 +397,8 @@ public final class WorkerServiceGrpc { * Quit this worker * */ - public io.grpc.benchmarks.proto.Control.Void quitWorker(io.grpc.benchmarks.proto.Control.Void request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.benchmarks.proto.Control.Void quitWorker(io.grpc.benchmarks.proto.Control.Void request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getQuitWorkerMethod(), getCallOptions(), request); } } diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index 8421a4a920..4cee799940 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -745,9 +745,10 @@ static void PrintStub( " $lower_method_name$($input_type$ request)"); } else { // Simple RPC + (*vars)["throws_decl"] = " throws io.grpc.StatusException"; p->Print( *vars, - "$output_type$ $lower_method_name$($input_type$ request)"); + "$output_type$ $lower_method_name$($input_type$ request)$throws_decl$"); } break; case ASYNC_CALL: @@ -827,7 +828,8 @@ static void PrintStub( if (server_streaming) { (*vars)["calls_method"] = "io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall"; } else { - (*vars)["calls_method"] = "io.grpc.stub.ClientCalls.blockingUnaryCall"; + (*vars)["calls_method"] = "io.grpc.stub.ClientCalls.blockingV2UnaryCall"; + (*vars)["throws_decl"] = " throws io.grpc.StatusException"; } p->Print( diff --git a/compiler/src/test/golden/TestDeprecatedService.java.txt b/compiler/src/test/golden/TestDeprecatedService.java.txt index 712be32132..548a9e3d80 100644 --- a/compiler/src/test/golden/TestDeprecatedService.java.txt +++ b/compiler/src/test/golden/TestDeprecatedService.java.txt @@ -203,8 +203,8 @@ public final class TestDeprecatedServiceGrpc { * */ @java.lang.Deprecated - public io.grpc.testing.compiler.Test.SimpleResponse deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.compiler.Test.SimpleResponse deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getDeprecatedMethodMethod(), getCallOptions(), request); } } diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt index e3c759639e..93551f6d58 100644 --- a/compiler/src/test/golden/TestService.java.txt +++ b/compiler/src/test/golden/TestService.java.txt @@ -580,8 +580,8 @@ public final class TestServiceGrpc { * The server returns the client payload as-is. * */ - public io.grpc.testing.compiler.Test.SimpleResponse unaryCall(io.grpc.testing.compiler.Test.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.compiler.Test.SimpleResponse unaryCall(io.grpc.testing.compiler.Test.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnaryCallMethod(), getCallOptions(), request); } @@ -658,8 +658,8 @@ public final class TestServiceGrpc { * A unary call that is Safe. * */ - public io.grpc.testing.compiler.Test.SimpleResponse safeCall(io.grpc.testing.compiler.Test.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.compiler.Test.SimpleResponse safeCall(io.grpc.testing.compiler.Test.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getSafeCallMethod(), getCallOptions(), request); } @@ -668,8 +668,8 @@ public final class TestServiceGrpc { * A unary call that is Idempotent. * */ - public io.grpc.testing.compiler.Test.SimpleResponse idempotentCall(io.grpc.testing.compiler.Test.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.compiler.Test.SimpleResponse idempotentCall(io.grpc.testing.compiler.Test.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getIdempotentCallMethod(), getCallOptions(), request); } } diff --git a/compiler/src/testLite/golden/TestDeprecatedService.java.txt b/compiler/src/testLite/golden/TestDeprecatedService.java.txt index 22a57c7152..89ea2e698b 100644 --- a/compiler/src/testLite/golden/TestDeprecatedService.java.txt +++ b/compiler/src/testLite/golden/TestDeprecatedService.java.txt @@ -199,8 +199,8 @@ public final class TestDeprecatedServiceGrpc { * */ @java.lang.Deprecated - public io.grpc.testing.compiler.Test.SimpleResponse deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.compiler.Test.SimpleResponse deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getDeprecatedMethodMethod(), getCallOptions(), request); } } diff --git a/compiler/src/testLite/golden/TestService.java.txt b/compiler/src/testLite/golden/TestService.java.txt index d13d9959a4..4e9dfb8d68 100644 --- a/compiler/src/testLite/golden/TestService.java.txt +++ b/compiler/src/testLite/golden/TestService.java.txt @@ -569,8 +569,8 @@ public final class TestServiceGrpc { * The server returns the client payload as-is. * */ - public io.grpc.testing.compiler.Test.SimpleResponse unaryCall(io.grpc.testing.compiler.Test.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.compiler.Test.SimpleResponse unaryCall(io.grpc.testing.compiler.Test.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnaryCallMethod(), getCallOptions(), request); } @@ -647,8 +647,8 @@ public final class TestServiceGrpc { * A unary call that is Safe. * */ - public io.grpc.testing.compiler.Test.SimpleResponse safeCall(io.grpc.testing.compiler.Test.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.compiler.Test.SimpleResponse safeCall(io.grpc.testing.compiler.Test.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getSafeCallMethod(), getCallOptions(), request); } @@ -657,8 +657,8 @@ public final class TestServiceGrpc { * A unary call that is Idempotent. * */ - public io.grpc.testing.compiler.Test.SimpleResponse idempotentCall(io.grpc.testing.compiler.Test.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.compiler.Test.SimpleResponse idempotentCall(io.grpc.testing.compiler.Test.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getIdempotentCallMethod(), getCallOptions(), request); } } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java index 766d63a51d..22c64d12f3 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java @@ -244,8 +244,8 @@ public final class LoadBalancerStatsServiceGrpc { * Gets the backend distribution for RPCs sent by a test client. * */ - public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetClientStatsMethod(), getCallOptions(), request); } @@ -254,8 +254,8 @@ public final class LoadBalancerStatsServiceGrpc { * Gets the accumulated stats for RPCs sent by a test client. * */ - public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetClientAccumulatedStatsMethod(), getCallOptions(), request); } } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index 8693f1086b..980dee010f 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -244,8 +244,8 @@ public final class MetricsServiceGrpc { * Returns the value of one gauge * */ - public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetGaugeMethod(), getCallOptions(), request); } } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index 164c92295c..05d46ce8e9 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -229,15 +229,15 @@ public final class ReconnectServiceGrpc { /** */ - public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty start(io.grpc.testing.integration.Messages.ReconnectParams request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getStartMethod(), getCallOptions(), request); } /** */ - public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getStopMethod(), getCallOptions(), request); } } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java index b8c220925e..a881c85c15 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -581,8 +581,8 @@ public final class TestServiceGrpc { * One empty request followed by one empty response. * */ - public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getEmptyCallMethod(), getCallOptions(), request); } @@ -591,8 +591,8 @@ public final class TestServiceGrpc { * One request followed by one response. * */ - public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnaryCallMethod(), getCallOptions(), request); } @@ -603,8 +603,8 @@ public final class TestServiceGrpc { * satisfy subsequent requests. * */ - public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getCacheableUnaryCallMethod(), getCallOptions(), request); } @@ -669,8 +669,8 @@ public final class TestServiceGrpc { * to test the behavior when clients call unimplemented methods. * */ - public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnimplementedCallMethod(), getCallOptions(), request); } } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index fe6c7c7d1c..fdd8d5650e 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -197,8 +197,8 @@ public final class UnimplementedServiceGrpc { * A call that no server should implement * */ - public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnimplementedCallMethod(), getCallOptions(), request); } } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java index 9a628ea1b1..6c019efefe 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java @@ -192,8 +192,8 @@ public final class XdsUpdateClientConfigureServiceGrpc { * Update the tes client's configuration. * */ - public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getConfigureMethod(), getCallOptions(), request); } } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java index 5582c60d9c..5531033ae5 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java @@ -229,15 +229,15 @@ public final class XdsUpdateHealthServiceGrpc { /** */ - public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty setServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getSetServingMethod(), getCallOptions(), request); } /** */ - public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getSetNotServingMethod(), getCallOptions(), request); } } diff --git a/istio-interop-testing/src/generated/main/grpc/io/istio/test/EchoTestServiceGrpc.java b/istio-interop-testing/src/generated/main/grpc/io/istio/test/EchoTestServiceGrpc.java index c6947a075d..61d20d2f7b 100644 --- a/istio-interop-testing/src/generated/main/grpc/io/istio/test/EchoTestServiceGrpc.java +++ b/istio-interop-testing/src/generated/main/grpc/io/istio/test/EchoTestServiceGrpc.java @@ -214,15 +214,15 @@ public final class EchoTestServiceGrpc { /** */ - public io.istio.test.Echo.EchoResponse echo(io.istio.test.Echo.EchoRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.istio.test.Echo.EchoResponse echo(io.istio.test.Echo.EchoRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getEchoMethod(), getCallOptions(), request); } /** */ - public io.istio.test.Echo.ForwardEchoResponse forwardEcho(io.istio.test.Echo.ForwardEchoRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.istio.test.Echo.ForwardEchoResponse forwardEcho(io.istio.test.Echo.ForwardEchoRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getForwardEchoMethod(), getCallOptions(), request); } } diff --git a/rls/src/generated/main/grpc/io/grpc/lookup/v1/RouteLookupServiceGrpc.java b/rls/src/generated/main/grpc/io/grpc/lookup/v1/RouteLookupServiceGrpc.java index 39e9d0f414..be060e576a 100644 --- a/rls/src/generated/main/grpc/io/grpc/lookup/v1/RouteLookupServiceGrpc.java +++ b/rls/src/generated/main/grpc/io/grpc/lookup/v1/RouteLookupServiceGrpc.java @@ -177,8 +177,8 @@ public final class RouteLookupServiceGrpc { * Lookup returns a target for a single key. * */ - public io.grpc.lookup.v1.RouteLookupResponse routeLookup(io.grpc.lookup.v1.RouteLookupRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.lookup.v1.RouteLookupResponse routeLookup(io.grpc.lookup.v1.RouteLookupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getRouteLookupMethod(), getCallOptions(), request); } } diff --git a/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java b/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java index f839f11cfe..c4ac4076d2 100644 --- a/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java @@ -512,8 +512,8 @@ public final class ChannelzGrpc { * created). This does not include subchannels nor non-top level channels. * */ - public io.grpc.channelz.v1.GetTopChannelsResponse getTopChannels(io.grpc.channelz.v1.GetTopChannelsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.channelz.v1.GetTopChannelsResponse getTopChannels(io.grpc.channelz.v1.GetTopChannelsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetTopChannelsMethod(), getCallOptions(), request); } @@ -522,8 +522,8 @@ public final class ChannelzGrpc { * Gets all servers that exist in the process. * */ - public io.grpc.channelz.v1.GetServersResponse getServers(io.grpc.channelz.v1.GetServersRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.channelz.v1.GetServersResponse getServers(io.grpc.channelz.v1.GetServersRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetServersMethod(), getCallOptions(), request); } @@ -532,8 +532,8 @@ public final class ChannelzGrpc { * Returns a single Server, or else a NOT_FOUND code. * */ - public io.grpc.channelz.v1.GetServerResponse getServer(io.grpc.channelz.v1.GetServerRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.channelz.v1.GetServerResponse getServer(io.grpc.channelz.v1.GetServerRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetServerMethod(), getCallOptions(), request); } @@ -542,8 +542,8 @@ public final class ChannelzGrpc { * Gets all server sockets that exist in the process. * */ - public io.grpc.channelz.v1.GetServerSocketsResponse getServerSockets(io.grpc.channelz.v1.GetServerSocketsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.channelz.v1.GetServerSocketsResponse getServerSockets(io.grpc.channelz.v1.GetServerSocketsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetServerSocketsMethod(), getCallOptions(), request); } @@ -552,8 +552,8 @@ public final class ChannelzGrpc { * Returns a single Channel, or else a NOT_FOUND code. * */ - public io.grpc.channelz.v1.GetChannelResponse getChannel(io.grpc.channelz.v1.GetChannelRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.channelz.v1.GetChannelResponse getChannel(io.grpc.channelz.v1.GetChannelRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetChannelMethod(), getCallOptions(), request); } @@ -562,8 +562,8 @@ public final class ChannelzGrpc { * Returns a single Subchannel, or else a NOT_FOUND code. * */ - public io.grpc.channelz.v1.GetSubchannelResponse getSubchannel(io.grpc.channelz.v1.GetSubchannelRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.channelz.v1.GetSubchannelResponse getSubchannel(io.grpc.channelz.v1.GetSubchannelRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetSubchannelMethod(), getCallOptions(), request); } @@ -572,8 +572,8 @@ public final class ChannelzGrpc { * Returns a single Socket or else a NOT_FOUND code. * */ - public io.grpc.channelz.v1.GetSocketResponse getSocket(io.grpc.channelz.v1.GetSocketRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.channelz.v1.GetSocketResponse getSocket(io.grpc.channelz.v1.GetSocketRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getGetSocketMethod(), getCallOptions(), request); } } diff --git a/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java b/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java index feb5932b0d..b8e94ef7d2 100644 --- a/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java @@ -256,8 +256,8 @@ public final class HealthGrpc { * NOT_FOUND. * */ - public io.grpc.health.v1.HealthCheckResponse check(io.grpc.health.v1.HealthCheckRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.health.v1.HealthCheckResponse check(io.grpc.health.v1.HealthCheckRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getCheckMethod(), getCallOptions(), request); } diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java index 5b7aaa1e4e..978af2d887 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java @@ -192,8 +192,8 @@ public final class AnotherDynamicServiceGrpc { * A method * */ - public io.grpc.reflection.testing.DynamicReply method(io.grpc.reflection.testing.DynamicRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.reflection.testing.DynamicReply method(io.grpc.reflection.testing.DynamicRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getMethodMethod(), getCallOptions(), request); } } diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherReflectableServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherReflectableServiceGrpc.java index f8b8d58e62..e688c3d5cc 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherReflectableServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherReflectableServiceGrpc.java @@ -168,8 +168,8 @@ public final class AnotherReflectableServiceGrpc { /** */ - public io.grpc.reflection.testing.Reply method(io.grpc.reflection.testing.Request request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.reflection.testing.Reply method(io.grpc.reflection.testing.Request request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getMethodMethod(), getCallOptions(), request); } } diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java index 81e6043851..efef61be15 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java @@ -192,8 +192,8 @@ public final class DynamicServiceGrpc { * A method * */ - public io.grpc.reflection.testing.DynamicReply method(io.grpc.reflection.testing.DynamicRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.reflection.testing.DynamicReply method(io.grpc.reflection.testing.DynamicRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getMethodMethod(), getCallOptions(), request); } } diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java index 5f620038b2..b5d130d695 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java @@ -168,8 +168,8 @@ public final class ReflectableServiceGrpc { /** */ - public io.grpc.reflection.testing.Reply method(io.grpc.reflection.testing.Request request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.reflection.testing.Reply method(io.grpc.reflection.testing.Request request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getMethodMethod(), getCallOptions(), request); } } diff --git a/stub/src/main/java/io/grpc/stub/ClientCalls.java b/stub/src/main/java/io/grpc/stub/ClientCalls.java index f307c80648..e5a94f4d86 100644 --- a/stub/src/main/java/io/grpc/stub/ClientCalls.java +++ b/stub/src/main/java/io/grpc/stub/ClientCalls.java @@ -182,6 +182,23 @@ public final class ClientCalls { } } + /** + * Executes a unary call and blocks on the response, + * throws a checked {@link StatusException}. + * + * @return the single response message. + * @throws StatusException on error + */ + public static RespT blockingV2UnaryCall( + Channel channel, MethodDescriptor method, CallOptions callOptions, ReqT req) + throws StatusException { + try { + return blockingUnaryCall(channel, method, callOptions, req); + } catch (StatusRuntimeException e) { + throw e.getStatus().asException(e.getTrailers()); + } + } + /** * Executes a server-streaming call returning a blocking {@link Iterator} over the * response stream. The {@code call} should not be already started. After calling this method, diff --git a/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java b/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java index cccc4eb8f8..e242fd0f51 100644 --- a/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java +++ b/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java @@ -348,8 +348,8 @@ public final class SimpleServiceGrpc { * Simple unary RPC. * */ - public io.grpc.testing.protobuf.SimpleResponse unaryRpc(io.grpc.testing.protobuf.SimpleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.grpc.testing.protobuf.SimpleResponse unaryRpc(io.grpc.testing.protobuf.SimpleRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getUnaryRpcMethod(), getCallOptions(), request); } diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/status/v3/ClientStatusDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/status/v3/ClientStatusDiscoveryServiceGrpc.java index 775fa0c1e3..cb16650356 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/status/v3/ClientStatusDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/status/v3/ClientStatusDiscoveryServiceGrpc.java @@ -248,8 +248,8 @@ public final class ClientStatusDiscoveryServiceGrpc { /** */ - public io.envoyproxy.envoy.service.status.v3.ClientStatusResponse fetchClientStatus(io.envoyproxy.envoy.service.status.v3.ClientStatusRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( + public io.envoyproxy.envoy.service.status.v3.ClientStatusResponse fetchClientStatus(io.envoyproxy.envoy.service.status.v3.ClientStatusRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getFetchClientStatusMethod(), getCallOptions(), request); } }