From ffcb3b964bd908dda5793daf82cd0e2556b54592 Mon Sep 17 00:00:00 2001 From: jbingham-google <40675267+jbingham-google@users.noreply.github.com> Date: Tue, 10 Jul 2018 14:24:50 -0600 Subject: [PATCH] compiler, stub: Rename inputType and outputType in @RpcMethod --- .../alts/internal/HandshakerServiceGrpc.java | 4 +-- .../proto/BenchmarkServiceGrpc.java | 20 ++++++------ .../proto/ReportQpsScenarioServiceGrpc.java | 4 +-- .../benchmarks/proto/WorkerServiceGrpc.java | 16 +++++----- .../src/java_plugin/cpp/java_generator.cpp | 4 +-- compiler/src/test/golden/TestService.java.txt | 24 +++++++------- .../src/testLite/golden/TestService.java.txt | 24 +++++++------- .../grpc/io/grpc/grpclb/LoadBalancerGrpc.java | 4 +-- .../integration/MetricsServiceGrpc.java | 8 ++--- .../integration/ReconnectServiceGrpc.java | 8 ++--- .../testing/integration/TestServiceGrpc.java | 32 +++++++++---------- .../integration/UnimplementedServiceGrpc.java | 4 +-- .../io/grpc/channelz/v1/ChannelzGrpc.java | 24 +++++++------- .../grpc/io/grpc/health/v1/HealthGrpc.java | 4 +-- .../v1alpha/ServerReflectionGrpc.java | 4 +-- .../testing/AnotherDynamicServiceGrpc.java | 4 +-- .../testing/DynamicServiceGrpc.java | 4 +-- .../testing/ReflectableServiceGrpc.java | 4 +-- .../io/grpc/stub/annotations/RpcMethod.java | 24 ++++++++++---- .../testing/protobuf/SimpleServiceGrpc.java | 16 +++++----- 20 files changed, 123 insertions(+), 113 deletions(-) diff --git a/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java b/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java index 5295a21b6b..def37fedb5 100644 --- a/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java +++ b/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java @@ -33,8 +33,8 @@ public final class HandshakerServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.gcp.HandshakerService", methodName = "DoHandshake", - inputType = io.grpc.alts.internal.Handshaker.HandshakerReq.class, - outputType = io.grpc.alts.internal.Handshaker.HandshakerResp.class, + requestType = io.grpc.alts.internal.Handshaker.HandshakerReq.class, + responseType = io.grpc.alts.internal.Handshaker.HandshakerResp.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getDoHandshakeMethod() { 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 6be515010b..77b6ae6a20 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 @@ -33,8 +33,8 @@ public final class BenchmarkServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.BenchmarkService", methodName = "UnaryCall", - inputType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, - outputType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, + requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, + responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getUnaryCallMethod() { @@ -66,8 +66,8 @@ public final class BenchmarkServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.BenchmarkService", methodName = "StreamingCall", - inputType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, - outputType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, + requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, + responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getStreamingCallMethod() { @@ -99,8 +99,8 @@ public final class BenchmarkServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.BenchmarkService", methodName = "StreamingFromClient", - inputType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, - outputType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, + requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, + responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) public static io.grpc.MethodDescriptor getStreamingFromClientMethod() { @@ -132,8 +132,8 @@ public final class BenchmarkServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.BenchmarkService", methodName = "StreamingFromServer", - inputType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, - outputType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, + requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, + responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) public static io.grpc.MethodDescriptor getStreamingFromServerMethod() { @@ -165,8 +165,8 @@ public final class BenchmarkServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.BenchmarkService", methodName = "StreamingBothWays", - inputType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, - outputType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, + requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, + responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getStreamingBothWaysMethod() { 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 3eb572cca9..1ae1d0160e 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 @@ -33,8 +33,8 @@ public final class ReportQpsScenarioServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.ReportQpsScenarioService", methodName = "ReportScenario", - inputType = io.grpc.benchmarks.proto.Control.ScenarioResult.class, - outputType = io.grpc.benchmarks.proto.Control.Void.class, + requestType = io.grpc.benchmarks.proto.Control.ScenarioResult.class, + responseType = io.grpc.benchmarks.proto.Control.Void.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getReportScenarioMethod() { 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 1db4066c4e..2d9fdabe95 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 @@ -33,8 +33,8 @@ public final class WorkerServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.WorkerService", methodName = "RunServer", - inputType = io.grpc.benchmarks.proto.Control.ServerArgs.class, - outputType = io.grpc.benchmarks.proto.Control.ServerStatus.class, + requestType = io.grpc.benchmarks.proto.Control.ServerArgs.class, + responseType = io.grpc.benchmarks.proto.Control.ServerStatus.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getRunServerMethod() { @@ -66,8 +66,8 @@ public final class WorkerServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.WorkerService", methodName = "RunClient", - inputType = io.grpc.benchmarks.proto.Control.ClientArgs.class, - outputType = io.grpc.benchmarks.proto.Control.ClientStatus.class, + requestType = io.grpc.benchmarks.proto.Control.ClientArgs.class, + responseType = io.grpc.benchmarks.proto.Control.ClientStatus.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getRunClientMethod() { @@ -99,8 +99,8 @@ public final class WorkerServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.WorkerService", methodName = "CoreCount", - inputType = io.grpc.benchmarks.proto.Control.CoreRequest.class, - outputType = io.grpc.benchmarks.proto.Control.CoreResponse.class, + requestType = io.grpc.benchmarks.proto.Control.CoreRequest.class, + responseType = io.grpc.benchmarks.proto.Control.CoreResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getCoreCountMethod() { @@ -132,8 +132,8 @@ public final class WorkerServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.WorkerService", methodName = "QuitWorker", - inputType = io.grpc.benchmarks.proto.Control.Void.class, - outputType = io.grpc.benchmarks.proto.Control.Void.class, + requestType = io.grpc.benchmarks.proto.Control.Void.class, + responseType = io.grpc.benchmarks.proto.Control.Void.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getQuitWorkerMethod() { diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index 8a55bebdef..ecc3df7c36 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -480,8 +480,8 @@ static void PrintMethodFields( "@$RpcMethod$(\n" " fullServiceName = \"$Package$$service_name$\",\n" " methodName = \"$method_name$\",\n" - " inputType = $input_type$.class,\n" - " outputType = $output_type$.class,\n" + " requestType = $input_type$.class,\n" + " responseType = $output_type$.class,\n" " methodType = $MethodType$.$method_type$)\n" "public static $MethodDescriptor$<$input_type$,\n" " $output_type$> $method_method_name$() {\n" diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt index 8d40a93ec5..d41733f03e 100644 --- a/compiler/src/test/golden/TestService.java.txt +++ b/compiler/src/test/golden/TestService.java.txt @@ -36,8 +36,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "UnaryCall", - inputType = io.grpc.testing.compiler.Test.SimpleRequest.class, - outputType = io.grpc.testing.compiler.Test.SimpleResponse.class, + requestType = io.grpc.testing.compiler.Test.SimpleRequest.class, + responseType = io.grpc.testing.compiler.Test.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getUnaryCallMethod() { @@ -69,8 +69,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "StreamingOutputCall", - inputType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) public static io.grpc.MethodDescriptor getStreamingOutputCallMethod() { @@ -102,8 +102,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "StreamingInputCall", - inputType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) public static io.grpc.MethodDescriptor getStreamingInputCallMethod() { @@ -135,8 +135,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "FullBidiCall", - inputType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getFullBidiCallMethod() { @@ -168,8 +168,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "HalfBidiCall", - inputType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getHalfBidiCallMethod() { @@ -201,8 +201,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "Import", - inputType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getImportMethod() { diff --git a/compiler/src/testLite/golden/TestService.java.txt b/compiler/src/testLite/golden/TestService.java.txt index 7f6ab0ae4c..86653f9734 100644 --- a/compiler/src/testLite/golden/TestService.java.txt +++ b/compiler/src/testLite/golden/TestService.java.txt @@ -36,8 +36,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "UnaryCall", - inputType = io.grpc.testing.compiler.Test.SimpleRequest.class, - outputType = io.grpc.testing.compiler.Test.SimpleResponse.class, + requestType = io.grpc.testing.compiler.Test.SimpleRequest.class, + responseType = io.grpc.testing.compiler.Test.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getUnaryCallMethod() { @@ -68,8 +68,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "StreamingOutputCall", - inputType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) public static io.grpc.MethodDescriptor getStreamingOutputCallMethod() { @@ -100,8 +100,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "StreamingInputCall", - inputType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) public static io.grpc.MethodDescriptor getStreamingInputCallMethod() { @@ -132,8 +132,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "FullBidiCall", - inputType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getFullBidiCallMethod() { @@ -164,8 +164,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "HalfBidiCall", - inputType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getHalfBidiCallMethod() { @@ -196,8 +196,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.compiler.TestService", methodName = "Import", - inputType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, - outputType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, + requestType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, + responseType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getImportMethod() { diff --git a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java index 8ff135f0de..3107ec6a10 100644 --- a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java +++ b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java @@ -33,8 +33,8 @@ public final class LoadBalancerGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.lb.v1.LoadBalancer", methodName = "BalanceLoad", - inputType = io.grpc.grpclb.LoadBalanceRequest.class, - outputType = io.grpc.grpclb.LoadBalanceResponse.class, + requestType = io.grpc.grpclb.LoadBalanceRequest.class, + responseType = io.grpc.grpclb.LoadBalanceResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getBalanceLoadMethod() { 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 49e5eaf64c..108a54d6b3 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 @@ -33,8 +33,8 @@ public final class MetricsServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.MetricsService", methodName = "GetAllGauges", - inputType = io.grpc.testing.integration.Metrics.EmptyMessage.class, - outputType = io.grpc.testing.integration.Metrics.GaugeResponse.class, + requestType = io.grpc.testing.integration.Metrics.EmptyMessage.class, + responseType = io.grpc.testing.integration.Metrics.GaugeResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) public static io.grpc.MethodDescriptor getGetAllGaugesMethod() { @@ -66,8 +66,8 @@ public final class MetricsServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.MetricsService", methodName = "GetGauge", - inputType = io.grpc.testing.integration.Metrics.GaugeRequest.class, - outputType = io.grpc.testing.integration.Metrics.GaugeResponse.class, + requestType = io.grpc.testing.integration.Metrics.GaugeRequest.class, + responseType = io.grpc.testing.integration.Metrics.GaugeResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetGaugeMethod() { 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 38e53638bd..25c4d6f6d7 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 @@ -36,8 +36,8 @@ public final class ReconnectServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.ReconnectService", methodName = "Start", - inputType = io.grpc.testing.integration.EmptyProtos.Empty.class, - outputType = io.grpc.testing.integration.EmptyProtos.Empty.class, + requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, + responseType = io.grpc.testing.integration.EmptyProtos.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getStartMethod() { @@ -69,8 +69,8 @@ public final class ReconnectServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.ReconnectService", methodName = "Stop", - inputType = io.grpc.testing.integration.EmptyProtos.Empty.class, - outputType = io.grpc.testing.integration.Messages.ReconnectInfo.class, + requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, + responseType = io.grpc.testing.integration.Messages.ReconnectInfo.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getStopMethod() { 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 84bf864db0..12b7013b2e 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 @@ -37,8 +37,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.TestService", methodName = "EmptyCall", - inputType = io.grpc.testing.integration.EmptyProtos.Empty.class, - outputType = io.grpc.testing.integration.EmptyProtos.Empty.class, + requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, + responseType = io.grpc.testing.integration.EmptyProtos.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getEmptyCallMethod() { @@ -70,8 +70,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.TestService", methodName = "UnaryCall", - inputType = io.grpc.testing.integration.Messages.SimpleRequest.class, - outputType = io.grpc.testing.integration.Messages.SimpleResponse.class, + requestType = io.grpc.testing.integration.Messages.SimpleRequest.class, + responseType = io.grpc.testing.integration.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getUnaryCallMethod() { @@ -103,8 +103,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.TestService", methodName = "CacheableUnaryCall", - inputType = io.grpc.testing.integration.Messages.SimpleRequest.class, - outputType = io.grpc.testing.integration.Messages.SimpleResponse.class, + requestType = io.grpc.testing.integration.Messages.SimpleRequest.class, + responseType = io.grpc.testing.integration.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getCacheableUnaryCallMethod() { @@ -136,8 +136,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.TestService", methodName = "StreamingOutputCall", - inputType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) public static io.grpc.MethodDescriptor getStreamingOutputCallMethod() { @@ -169,8 +169,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.TestService", methodName = "StreamingInputCall", - inputType = io.grpc.testing.integration.Messages.StreamingInputCallRequest.class, - outputType = io.grpc.testing.integration.Messages.StreamingInputCallResponse.class, + requestType = io.grpc.testing.integration.Messages.StreamingInputCallRequest.class, + responseType = io.grpc.testing.integration.Messages.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) public static io.grpc.MethodDescriptor getStreamingInputCallMethod() { @@ -202,8 +202,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.TestService", methodName = "FullDuplexCall", - inputType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getFullDuplexCallMethod() { @@ -235,8 +235,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.TestService", methodName = "HalfDuplexCall", - inputType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, - outputType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, + requestType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, + responseType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getHalfDuplexCallMethod() { @@ -268,8 +268,8 @@ public final class TestServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.TestService", methodName = "UnimplementedCall", - inputType = io.grpc.testing.integration.EmptyProtos.Empty.class, - outputType = io.grpc.testing.integration.EmptyProtos.Empty.class, + requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, + responseType = io.grpc.testing.integration.EmptyProtos.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getUnimplementedCallMethod() { 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 aa3c7414dc..a016796901 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 @@ -37,8 +37,8 @@ public final class UnimplementedServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.UnimplementedService", methodName = "UnimplementedCall", - inputType = io.grpc.testing.integration.EmptyProtos.Empty.class, - outputType = io.grpc.testing.integration.EmptyProtos.Empty.class, + requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, + responseType = io.grpc.testing.integration.EmptyProtos.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getUnimplementedCallMethod() { 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 a85bc8a8e9..abeefb0abe 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 @@ -37,8 +37,8 @@ public final class ChannelzGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.channelz.v1.Channelz", methodName = "GetTopChannels", - inputType = io.grpc.channelz.v1.GetTopChannelsRequest.class, - outputType = io.grpc.channelz.v1.GetTopChannelsResponse.class, + requestType = io.grpc.channelz.v1.GetTopChannelsRequest.class, + responseType = io.grpc.channelz.v1.GetTopChannelsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetTopChannelsMethod() { @@ -70,8 +70,8 @@ public final class ChannelzGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.channelz.v1.Channelz", methodName = "GetServers", - inputType = io.grpc.channelz.v1.GetServersRequest.class, - outputType = io.grpc.channelz.v1.GetServersResponse.class, + requestType = io.grpc.channelz.v1.GetServersRequest.class, + responseType = io.grpc.channelz.v1.GetServersResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetServersMethod() { @@ -103,8 +103,8 @@ public final class ChannelzGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.channelz.v1.Channelz", methodName = "GetServerSockets", - inputType = io.grpc.channelz.v1.GetServerSocketsRequest.class, - outputType = io.grpc.channelz.v1.GetServerSocketsResponse.class, + requestType = io.grpc.channelz.v1.GetServerSocketsRequest.class, + responseType = io.grpc.channelz.v1.GetServerSocketsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetServerSocketsMethod() { @@ -136,8 +136,8 @@ public final class ChannelzGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.channelz.v1.Channelz", methodName = "GetChannel", - inputType = io.grpc.channelz.v1.GetChannelRequest.class, - outputType = io.grpc.channelz.v1.GetChannelResponse.class, + requestType = io.grpc.channelz.v1.GetChannelRequest.class, + responseType = io.grpc.channelz.v1.GetChannelResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetChannelMethod() { @@ -169,8 +169,8 @@ public final class ChannelzGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.channelz.v1.Channelz", methodName = "GetSubchannel", - inputType = io.grpc.channelz.v1.GetSubchannelRequest.class, - outputType = io.grpc.channelz.v1.GetSubchannelResponse.class, + requestType = io.grpc.channelz.v1.GetSubchannelRequest.class, + responseType = io.grpc.channelz.v1.GetSubchannelResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetSubchannelMethod() { @@ -202,8 +202,8 @@ public final class ChannelzGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.channelz.v1.Channelz", methodName = "GetSocket", - inputType = io.grpc.channelz.v1.GetSocketRequest.class, - outputType = io.grpc.channelz.v1.GetSocketResponse.class, + requestType = io.grpc.channelz.v1.GetSocketRequest.class, + responseType = io.grpc.channelz.v1.GetSocketResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetSocketMethod() { 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 0ec948320f..11ce8dd073 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 @@ -33,8 +33,8 @@ public final class HealthGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.health.v1.Health", methodName = "Check", - inputType = io.grpc.health.v1.HealthCheckRequest.class, - outputType = io.grpc.health.v1.HealthCheckResponse.class, + requestType = io.grpc.health.v1.HealthCheckRequest.class, + responseType = io.grpc.health.v1.HealthCheckResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getCheckMethod() { diff --git a/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java b/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java index 273f458686..e67b03a5b0 100644 --- a/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java @@ -33,8 +33,8 @@ public final class ServerReflectionGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.reflection.v1alpha.ServerReflection", methodName = "ServerReflectionInfo", - inputType = io.grpc.reflection.v1alpha.ServerReflectionRequest.class, - outputType = io.grpc.reflection.v1alpha.ServerReflectionResponse.class, + requestType = io.grpc.reflection.v1alpha.ServerReflectionRequest.class, + responseType = io.grpc.reflection.v1alpha.ServerReflectionResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getServerReflectionInfoMethod() { 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 786c8b6c30..f38cc3cf24 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 @@ -36,8 +36,8 @@ public final class AnotherDynamicServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.reflection.testing.AnotherDynamicService", methodName = "Method", - inputType = io.grpc.reflection.testing.DynamicRequest.class, - outputType = io.grpc.reflection.testing.DynamicReply.class, + requestType = io.grpc.reflection.testing.DynamicRequest.class, + responseType = io.grpc.reflection.testing.DynamicReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getMethodMethod() { 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 9909078d88..a3e5282432 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 @@ -36,8 +36,8 @@ public final class DynamicServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.reflection.testing.DynamicService", methodName = "Method", - inputType = io.grpc.reflection.testing.DynamicRequest.class, - outputType = io.grpc.reflection.testing.DynamicReply.class, + requestType = io.grpc.reflection.testing.DynamicRequest.class, + responseType = io.grpc.reflection.testing.DynamicReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getMethodMethod() { 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 097ea29184..45f364c09f 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 @@ -33,8 +33,8 @@ public final class ReflectableServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.reflection.testing.ReflectableService", methodName = "Method", - inputType = io.grpc.reflection.testing.Request.class, - outputType = io.grpc.reflection.testing.Reply.class, + requestType = io.grpc.reflection.testing.Request.class, + responseType = io.grpc.reflection.testing.Reply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getMethodMethod() { diff --git a/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java b/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java index 5d8591f58e..123dc4cd3b 100644 --- a/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java +++ b/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java @@ -16,14 +16,24 @@ package io.grpc.stub.annotations; -import io.grpc.MethodDescriptor.MethodType; +import io.grpc.MethodDescriptor; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Annotates a method descriptor method to provide metadata for annotation processing. + * {@link RpcMethod} contains a limited subset of information about the RPC to assist + * + * Java Annotation Processors. + * + *

+ * This annotation is used by the gRPC stub compiler to annotate {@link MethodDescriptor} + * getters. Users should not annotate their own classes with annotation. Not all stubs may have + * this annotation, so consumers should not assume that it is present. + *

+ * + * @since 1.14.0 */ @Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) @@ -40,17 +50,17 @@ public @interface RpcMethod { String methodName(); /** - * The input type of the method + * The request type of the method */ - Class inputType(); + Class requestType(); /** - * The output type of the method + * The response type of the method */ - Class outputType(); + Class responseType(); /** * The call type of the method */ - MethodType methodType(); + MethodDescriptor.MethodType methodType(); } 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 7aaece01b5..6de750227c 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 @@ -36,8 +36,8 @@ public final class SimpleServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.SimpleService", methodName = "UnaryRpc", - inputType = io.grpc.testing.protobuf.SimpleRequest.class, - outputType = io.grpc.testing.protobuf.SimpleResponse.class, + requestType = io.grpc.testing.protobuf.SimpleRequest.class, + responseType = io.grpc.testing.protobuf.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getUnaryRpcMethod() { @@ -69,8 +69,8 @@ public final class SimpleServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.SimpleService", methodName = "ClientStreamingRpc", - inputType = io.grpc.testing.protobuf.SimpleRequest.class, - outputType = io.grpc.testing.protobuf.SimpleResponse.class, + requestType = io.grpc.testing.protobuf.SimpleRequest.class, + responseType = io.grpc.testing.protobuf.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) public static io.grpc.MethodDescriptor getClientStreamingRpcMethod() { @@ -102,8 +102,8 @@ public final class SimpleServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.SimpleService", methodName = "ServerStreamingRpc", - inputType = io.grpc.testing.protobuf.SimpleRequest.class, - outputType = io.grpc.testing.protobuf.SimpleResponse.class, + requestType = io.grpc.testing.protobuf.SimpleRequest.class, + responseType = io.grpc.testing.protobuf.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) public static io.grpc.MethodDescriptor getServerStreamingRpcMethod() { @@ -135,8 +135,8 @@ public final class SimpleServiceGrpc { @io.grpc.stub.annotations.RpcMethod( fullServiceName = "grpc.testing.SimpleService", methodName = "BidiStreamingRpc", - inputType = io.grpc.testing.protobuf.SimpleRequest.class, - outputType = io.grpc.testing.protobuf.SimpleResponse.class, + requestType = io.grpc.testing.protobuf.SimpleRequest.class, + responseType = io.grpc.testing.protobuf.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor getBidiStreamingRpcMethod() {