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 74bd337f7c..a4505aaee5 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 @@ -30,21 +30,27 @@ public final class BenchmarkServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_UNARY_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.BenchmarkService", "UnaryCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Messages.SimpleRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Messages.SimpleResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.BenchmarkService", "UnaryCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Messages.SimpleRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Messages.SimpleResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.BenchmarkService", "StreamingCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Messages.SimpleRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Messages.SimpleResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.BenchmarkService", "StreamingCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Messages.SimpleRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Messages.SimpleResponse.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service 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 9d60fd1653..7be1d5d1ba 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 @@ -30,39 +30,51 @@ public final class WorkerServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_RUN_SERVER = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.WorkerService", "RunServer"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Control.ServerArgs.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Control.ServerStatus.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.WorkerService", "RunServer")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Control.ServerArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Control.ServerStatus.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_RUN_CLIENT = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.WorkerService", "RunClient"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Control.ClientArgs.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Control.ClientStatus.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.WorkerService", "RunClient")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Control.ClientArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Control.ClientStatus.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_CORE_COUNT = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.WorkerService", "CoreCount"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Control.CoreRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Control.CoreResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.WorkerService", "CoreCount")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Control.CoreRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Control.CoreResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_QUIT_WORKER = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.WorkerService", "QuitWorker"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Control.Void.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Control.Void.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.WorkerService", "QuitWorker")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Control.Void.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.benchmarks.proto.Control.Void.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index 8c9e39fb29..d48263e25a 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -339,15 +339,15 @@ static void PrintMethodFields( "@$ExperimentalApi$(\"https://github.com/grpc/grpc-java/issues/1901\")\n" "public static final $MethodDescriptor$<$input_type$,\n" " $output_type$> $method_field_name$ =\n" - " $MethodDescriptor$.create(\n" - " $MethodType$.$method_type$,\n" - " generateFullMethodName(\n" - " \"$Package$$service_name$\", \"$method_name$\"),\n" - " $NanoUtils$.<$input_type$>marshaller(\n" - " new NanoFactory<$input_type$>(ARG_IN_$method_field_name$)),\n" - " $NanoUtils$.<$output_type$>marshaller(\n" - " new NanoFactory<$output_type$>(ARG_OUT_$method_field_name$))\n" - " );\n"); + " $MethodDescriptor$.<$input_type$, $output_type$>newBuilder()\n" + " .setType($MethodType$.$method_type$)\n" + " .setFullMethodName(generateFullMethodName(\n" + " \"$Package$$service_name$\", \"$method_name$\"))\n" + " .setRequestMarshaller($NanoUtils$.<$input_type$>marshaller(\n" + " new NanoFactory<$input_type$>(ARG_IN_$method_field_name$)))\n" + " .setResponseMarshaller($NanoUtils$.<$output_type$>marshaller(\n" + " new NanoFactory<$output_type$>(ARG_OUT_$method_field_name$)))\n" + " .build();\n"); } else { if (flavor == ProtoFlavor::LITE) { (*vars)["ProtoUtils"] = "io.grpc.protobuf.lite.ProtoLiteUtils"; @@ -359,12 +359,15 @@ static void PrintMethodFields( "@$ExperimentalApi$(\"https://github.com/grpc/grpc-java/issues/1901\")\n" "public static final $MethodDescriptor$<$input_type$,\n" " $output_type$> $method_field_name$ =\n" - " $MethodDescriptor$.create(\n" - " $MethodType$.$method_type$,\n" - " generateFullMethodName(\n" - " \"$Package$$service_name$\", \"$method_name$\"),\n" - " $ProtoUtils$.marshaller($input_type$.getDefaultInstance()),\n" - " $ProtoUtils$.marshaller($output_type$.getDefaultInstance()));\n"); + " $MethodDescriptor$.<$input_type$, $output_type$>newBuilder()\n" + " .setType($MethodType$.$method_type$)\n" + " .setFullMethodName(generateFullMethodName(\n" + " \"$Package$$service_name$\", \"$method_name$\"))\n" + " .setRequestMarshaller($ProtoUtils$.marshaller(\n" + " $input_type$.getDefaultInstance()))\n" + " .setResponseMarshaller($ProtoUtils$.marshaller(\n" + " $output_type$.getDefaultInstance()))\n" + " .build();\n"); } } p->Print("\n"); diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt index 455a2d7c28..4de84cd181 100644 --- a/compiler/src/test/golden/TestService.java.txt +++ b/compiler/src/test/golden/TestService.java.txt @@ -33,48 +33,63 @@ public final class TestServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_UNARY_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.TestService", "UnaryCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "UnaryCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.SimpleResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_OUTPUT_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "StreamingOutputCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "StreamingOutputCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_INPUT_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "StreamingInputCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "StreamingInputCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.StreamingInputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_FULL_BIDI_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "FullBidiCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "FullBidiCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_HALF_BIDI_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "HalfBidiCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "HalfBidiCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service diff --git a/compiler/src/testLite/golden/TestService.java.txt b/compiler/src/testLite/golden/TestService.java.txt index 565a1094f8..57c5dd0be9 100644 --- a/compiler/src/testLite/golden/TestService.java.txt +++ b/compiler/src/testLite/golden/TestService.java.txt @@ -33,48 +33,63 @@ public final class TestServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_UNARY_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.TestService", "UnaryCall"), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance()), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "UnaryCall")) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.SimpleResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_OUTPUT_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "StreamingOutputCall"), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "StreamingOutputCall")) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_INPUT_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "StreamingInputCall"), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance()), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "StreamingInputCall")) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.StreamingInputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_FULL_BIDI_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "FullBidiCall"), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "FullBidiCall")) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_HALF_BIDI_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "HalfBidiCall"), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "HalfBidiCall")) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service diff --git a/compiler/src/testNano/golden/TestService.java.txt b/compiler/src/testNano/golden/TestService.java.txt index fe1cf9b447..11df28fa06 100644 --- a/compiler/src/testNano/golden/TestService.java.txt +++ b/compiler/src/testNano/golden/TestService.java.txt @@ -37,71 +37,71 @@ public final class TestServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_UNARY_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.TestService", "UnaryCall"), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_IN_METHOD_UNARY_CALL)), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_OUT_METHOD_UNARY_CALL)) - ); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "UnaryCall")) + .setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_IN_METHOD_UNARY_CALL))) + .setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_OUT_METHOD_UNARY_CALL))) + .build(); private static final int ARG_IN_METHOD_STREAMING_OUTPUT_CALL = 2; private static final int ARG_OUT_METHOD_STREAMING_OUTPUT_CALL = 3; @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_OUTPUT_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "StreamingOutputCall"), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_IN_METHOD_STREAMING_OUTPUT_CALL)), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_OUT_METHOD_STREAMING_OUTPUT_CALL)) - ); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "StreamingOutputCall")) + .setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_IN_METHOD_STREAMING_OUTPUT_CALL))) + .setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_OUT_METHOD_STREAMING_OUTPUT_CALL))) + .build(); private static final int ARG_IN_METHOD_STREAMING_INPUT_CALL = 4; private static final int ARG_OUT_METHOD_STREAMING_INPUT_CALL = 5; @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_INPUT_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "StreamingInputCall"), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_IN_METHOD_STREAMING_INPUT_CALL)), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_OUT_METHOD_STREAMING_INPUT_CALL)) - ); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "StreamingInputCall")) + .setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_IN_METHOD_STREAMING_INPUT_CALL))) + .setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_OUT_METHOD_STREAMING_INPUT_CALL))) + .build(); private static final int ARG_IN_METHOD_FULL_BIDI_CALL = 6; private static final int ARG_OUT_METHOD_FULL_BIDI_CALL = 7; @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_FULL_BIDI_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "FullBidiCall"), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_IN_METHOD_FULL_BIDI_CALL)), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_OUT_METHOD_FULL_BIDI_CALL)) - ); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "FullBidiCall")) + .setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_IN_METHOD_FULL_BIDI_CALL))) + .setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_OUT_METHOD_FULL_BIDI_CALL))) + .build(); private static final int ARG_IN_METHOD_HALF_BIDI_CALL = 8; private static final int ARG_OUT_METHOD_HALF_BIDI_CALL = 9; @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_HALF_BIDI_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "HalfBidiCall"), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_IN_METHOD_HALF_BIDI_CALL)), - io.grpc.protobuf.nano.NanoUtils.marshaller( - new NanoFactory(ARG_OUT_METHOD_HALF_BIDI_CALL)) - ); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "HalfBidiCall")) + .setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_IN_METHOD_HALF_BIDI_CALL))) + .setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.marshaller( + new NanoFactory(ARG_OUT_METHOD_HALF_BIDI_CALL))) + .build(); private static final class NanoFactory implements io.grpc.protobuf.nano.MessageNanoFactory { 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 31ab3b03b0..2a074345b3 100644 --- a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java +++ b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java @@ -30,12 +30,15 @@ public final class LoadBalancerGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_BALANCE_LOAD = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.lb.v1.LoadBalancer", "BalanceLoad"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.grpclb.LoadBalanceRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.grpclb.LoadBalanceResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.lb.v1.LoadBalancer", "BalanceLoad")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.grpclb.LoadBalanceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.grpclb.LoadBalanceResponse.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service 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 898f044dd1..bc51b4e6e6 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 @@ -30,12 +30,15 @@ public final class HealthGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_CHECK = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.health.v1.Health", "Check"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.health.v1.HealthCheckRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.health.v1.HealthCheckResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.health.v1.Health", "Check")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.health.v1.HealthCheckRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.health.v1.HealthCheckResponse.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service diff --git a/services/src/generated/main/grpc/io/grpc/instrumentation/v1alpha/MonitoringGrpc.java b/services/src/generated/main/grpc/io/grpc/instrumentation/v1alpha/MonitoringGrpc.java index 1acc0ae322..d0577f4374 100644 --- a/services/src/generated/main/grpc/io/grpc/instrumentation/v1alpha/MonitoringGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/instrumentation/v1alpha/MonitoringGrpc.java @@ -30,48 +30,63 @@ public final class MonitoringGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_GET_CANONICAL_RPC_STATS = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.instrumentation.v1alpha.Monitoring", "GetCanonicalRpcStats"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.CanonicalRpcStats.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.instrumentation.v1alpha.Monitoring", "GetCanonicalRpcStats")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.CanonicalRpcStats.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_GET_STATS = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.instrumentation.v1alpha.Monitoring", "GetStats"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.StatsRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.StatsResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.instrumentation.v1alpha.Monitoring", "GetStats")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.StatsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.StatsResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_WATCH_STATS = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, - generateFullMethodName( - "grpc.instrumentation.v1alpha.Monitoring", "WatchStats"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.StatsRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.StatsResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.instrumentation.v1alpha.Monitoring", "WatchStats")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.StatsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.StatsResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_GET_REQUEST_TRACES = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.instrumentation.v1alpha.Monitoring", "GetRequestTraces"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.TraceRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.TraceResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.instrumentation.v1alpha.Monitoring", "GetRequestTraces")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.TraceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.TraceResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_GET_CUSTOM_MONITORING_DATA = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.instrumentation.v1alpha.Monitoring", "GetCustomMonitoringData"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.MonitoringDataGroup.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.CustomMonitoringData.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.instrumentation.v1alpha.Monitoring", "GetCustomMonitoringData")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.MonitoringDataGroup.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.instrumentation.v1alpha.CustomMonitoringData.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service 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 9e510c206f..cb050e8064 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 @@ -30,12 +30,15 @@ public final class ServerReflectionGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_SERVER_REFLECTION_INFO = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.reflection.v1alpha.ServerReflection", "ServerReflectionInfo"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.reflection.v1alpha.ServerReflectionRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.reflection.v1alpha.ServerReflectionResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.reflection.v1alpha.ServerReflection", "ServerReflectionInfo")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.reflection.v1alpha.ServerReflectionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.reflection.v1alpha.ServerReflectionResponse.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service 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 31f7283ba7..063d54ad6b 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 @@ -33,12 +33,15 @@ public final class AnotherDynamicServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_METHOD = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.reflection.testing.AnotherDynamicService", "Method"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.reflection.testing.DynamicRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.reflection.testing.DynamicReply.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.reflection.testing.AnotherDynamicService", "Method")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.reflection.testing.DynamicRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.reflection.testing.DynamicReply.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service 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 234b7fe5df..55418c46b0 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 @@ -33,12 +33,15 @@ public final class DynamicServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_METHOD = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.reflection.testing.DynamicService", "Method"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.reflection.testing.DynamicRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.reflection.testing.DynamicReply.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.reflection.testing.DynamicService", "Method")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.reflection.testing.DynamicRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.reflection.testing.DynamicReply.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service 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 5d5b156898..28822f2d5e 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 @@ -30,12 +30,15 @@ public final class ReflectableServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_METHOD = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.reflection.testing.ReflectableService", "Method"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.reflection.testing.Request.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.reflection.testing.Reply.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.reflection.testing.ReflectableService", "Method")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.reflection.testing.Request.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.reflection.testing.Reply.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service diff --git a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index 8f217a5ae6..b474d48270 100644 --- a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -30,21 +30,27 @@ public final class MetricsServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_GET_ALL_GAUGES = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, - generateFullMethodName( - "grpc.testing.MetricsService", "GetAllGauges"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Metrics.EmptyMessage.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Metrics.GaugeResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.MetricsService", "GetAllGauges")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Metrics.EmptyMessage.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Metrics.GaugeResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_GET_GAUGE = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.MetricsService", "GetGauge"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Metrics.GaugeRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Metrics.GaugeResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.MetricsService", "GetGauge")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Metrics.GaugeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Metrics.GaugeResponse.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service diff --git a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index a64d76aafc..92f78a31e0 100644 --- a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -33,21 +33,27 @@ public final class ReconnectServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_START = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.ReconnectService", "Start"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.ReconnectService", "Start")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STOP = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.ReconnectService", "Stop"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.ReconnectInfo.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.ReconnectService", "Stop")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.ReconnectInfo.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service diff --git a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java index 688cf89e0b..9d07cd3e7c 100644 --- a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -34,66 +34,87 @@ public final class TestServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_EMPTY_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.TestService", "EmptyCall"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "EmptyCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_UNARY_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.TestService", "UnaryCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "UnaryCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.SimpleRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.SimpleResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_OUTPUT_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "StreamingOutputCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "StreamingOutputCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.StreamingOutputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_STREAMING_INPUT_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "StreamingInputCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "StreamingInputCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.StreamingInputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.StreamingInputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_FULL_DUPLEX_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "FullDuplexCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "FullDuplexCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.StreamingOutputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_HALF_DUPLEX_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, - generateFullMethodName( - "grpc.testing.TestService", "HalfDuplexCall"), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "HalfDuplexCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.StreamingOutputCallRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.testing.integration.Messages.StreamingOutputCallResponse.getDefaultInstance())) + .build(); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_UNIMPLEMENTED_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.TestService", "UnimplementedCall"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.TestService", "UnimplementedCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service diff --git a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index cfdd9bfdff..71445bfc53 100644 --- a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -34,12 +34,15 @@ public final class UnimplementedServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_UNIMPLEMENTED_CALL = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "grpc.testing.UnimplementedService", "UnimplementedCall"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grpc.testing.UnimplementedService", "UnimplementedCall")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service