Skip to content

Commit 79f3f02

Browse files
committed
Migrate from PARSER to parser() as a way of getting the parser of a protobuf message.
This was done by grpc#587 (commit af9fb6d) but was accidentally reverted by commit 73acc73.
1 parent 0003e44 commit 79f3f02

7 files changed

Lines changed: 42 additions & 42 deletions

File tree

benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ public class TestServiceGrpc {
2121
io.grpc.MethodDescriptor.create(
2222
io.grpc.MethodDescriptor.MethodType.UNARY,
2323
"grpc.testing.TestService", "UnaryCall",
24-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleRequest.PARSER),
25-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleResponse.PARSER));
24+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleRequest.parser()),
25+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleResponse.parser()));
2626
// Static method descriptors that strictly reflect the proto.
2727
public static final io.grpc.MethodDescriptor<io.grpc.testing.SimpleRequest,
2828
io.grpc.testing.SimpleResponse> METHOD_STREAMING_CALL =
2929
io.grpc.MethodDescriptor.create(
3030
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
3131
"grpc.testing.TestService", "StreamingCall",
32-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleRequest.PARSER),
33-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleResponse.PARSER));
32+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleRequest.parser()),
33+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleResponse.parser()));
3434

3535
public static TestServiceStub newStub(io.grpc.Channel channel) {
3636
return new TestServiceStub(channel, CONFIG);

benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ public class WorkerGrpc {
2121
io.grpc.MethodDescriptor.create(
2222
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
2323
"grpc.testing.Worker", "RunTest",
24-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ClientArgs.PARSER),
25-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ClientStatus.PARSER));
24+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ClientArgs.parser()),
25+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ClientStatus.parser()));
2626
// Static method descriptors that strictly reflect the proto.
2727
public static final io.grpc.MethodDescriptor<io.grpc.testing.ServerArgs,
2828
io.grpc.testing.ServerStatus> METHOD_RUN_SERVER =
2929
io.grpc.MethodDescriptor.create(
3030
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
3131
"grpc.testing.Worker", "RunServer",
32-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ServerArgs.PARSER),
33-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ServerStatus.PARSER));
32+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ServerArgs.parser()),
33+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ServerStatus.parser()));
3434

3535
public static WorkerStub newStub(io.grpc.Channel channel) {
3636
return new WorkerStub(channel, CONFIG);

compiler/src/java_plugin/cpp/java_generator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ static void PrintMethodFields(
122122
" $MethodDescriptor$.create(\n"
123123
" $MethodType$.$method_type$,\n"
124124
" \"$Package$$service_name$\", \"$method_name$\",\n"
125-
" $ProtoUtils$.marshaller($input_type$.PARSER),\n"
126-
" $ProtoUtils$.marshaller($output_type$.PARSER));\n");
125+
" $ProtoUtils$.marshaller($input_type$.parser()),\n"
126+
" $ProtoUtils$.marshaller($output_type$.parser()));\n");
127127
}
128128
}
129129
p->Print("\n");

compiler/src/test/golden/TestService.java.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,40 @@ public class TestServiceGrpc {
2121
io.grpc.MethodDescriptor.create(
2222
io.grpc.MethodDescriptor.MethodType.UNARY,
2323
"grpc.testing.TestService", "UnaryCall",
24-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.PARSER),
25-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.PARSER));
24+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.parser()),
25+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.parser()));
2626
// Static method descriptors that strictly reflect the proto.
2727
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
2828
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
2929
io.grpc.MethodDescriptor.create(
3030
io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
3131
"grpc.testing.TestService", "StreamingOutputCall",
32-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
33-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
32+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
33+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
3434
// Static method descriptors that strictly reflect the proto.
3535
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
3636
io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
3737
io.grpc.MethodDescriptor.create(
3838
io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
3939
"grpc.testing.TestService", "StreamingInputCall",
40-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.PARSER),
41-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.PARSER));
40+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.parser()),
41+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.parser()));
4242
// Static method descriptors that strictly reflect the proto.
4343
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
4444
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
4545
io.grpc.MethodDescriptor.create(
4646
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
4747
"grpc.testing.TestService", "FullDuplexCall",
48-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
49-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
48+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
49+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
5050
// Static method descriptors that strictly reflect the proto.
5151
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
5252
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
5353
io.grpc.MethodDescriptor.create(
5454
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
5555
"grpc.testing.TestService", "HalfDuplexCall",
56-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
57-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
56+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
57+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
5858

5959
public static TestServiceStub newStub(io.grpc.Channel channel) {
6060
return new TestServiceStub(channel, CONFIG);

examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class GreeterGrpc {
2121
io.grpc.MethodDescriptor.create(
2222
io.grpc.MethodDescriptor.MethodType.UNARY,
2323
"helloworld.Greeter", "SayHello",
24-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloRequest.PARSER),
25-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloResponse.PARSER));
24+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloRequest.parser()),
25+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloResponse.parser()));
2626

2727
public static GreeterStub newStub(io.grpc.Channel channel) {
2828
return new GreeterStub(channel, CONFIG);

examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,32 @@ public class RouteGuideGrpc {
2121
io.grpc.MethodDescriptor.create(
2222
io.grpc.MethodDescriptor.MethodType.UNARY,
2323
"routeguide.RouteGuide", "GetFeature",
24-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Point.PARSER),
25-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Feature.PARSER));
24+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Point.parser()),
25+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Feature.parser()));
2626
// Static method descriptors that strictly reflect the proto.
2727
public static final io.grpc.MethodDescriptor<io.grpc.examples.routeguide.Rectangle,
2828
io.grpc.examples.routeguide.Feature> METHOD_LIST_FEATURES =
2929
io.grpc.MethodDescriptor.create(
3030
io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
3131
"routeguide.RouteGuide", "ListFeatures",
32-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Rectangle.PARSER),
33-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Feature.PARSER));
32+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Rectangle.parser()),
33+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Feature.parser()));
3434
// Static method descriptors that strictly reflect the proto.
3535
public static final io.grpc.MethodDescriptor<io.grpc.examples.routeguide.Point,
3636
io.grpc.examples.routeguide.RouteSummary> METHOD_RECORD_ROUTE =
3737
io.grpc.MethodDescriptor.create(
3838
io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
3939
"routeguide.RouteGuide", "RecordRoute",
40-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Point.PARSER),
41-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteSummary.PARSER));
40+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Point.parser()),
41+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteSummary.parser()));
4242
// Static method descriptors that strictly reflect the proto.
4343
public static final io.grpc.MethodDescriptor<io.grpc.examples.routeguide.RouteNote,
4444
io.grpc.examples.routeguide.RouteNote> METHOD_ROUTE_CHAT =
4545
io.grpc.MethodDescriptor.create(
4646
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
4747
"routeguide.RouteGuide", "RouteChat",
48-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteNote.PARSER),
49-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteNote.PARSER));
48+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteNote.parser()),
49+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteNote.parser()));
5050

5151
public static RouteGuideStub newStub(io.grpc.Channel channel) {
5252
return new RouteGuideStub(channel, CONFIG);

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,48 +21,48 @@ public class TestServiceGrpc {
2121
io.grpc.MethodDescriptor.create(
2222
io.grpc.MethodDescriptor.MethodType.UNARY,
2323
"grpc.testing.TestService", "EmptyCall",
24-
io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER),
25-
io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER));
24+
io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.parser()),
25+
io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.parser()));
2626
// Static method descriptors that strictly reflect the proto.
2727
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.SimpleRequest,
2828
io.grpc.testing.integration.Messages.SimpleResponse> METHOD_UNARY_CALL =
2929
io.grpc.MethodDescriptor.create(
3030
io.grpc.MethodDescriptor.MethodType.UNARY,
3131
"grpc.testing.TestService", "UnaryCall",
32-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleRequest.PARSER),
33-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleResponse.PARSER));
32+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleRequest.parser()),
33+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleResponse.parser()));
3434
// Static method descriptors that strictly reflect the proto.
3535
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
3636
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
3737
io.grpc.MethodDescriptor.create(
3838
io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
3939
"grpc.testing.TestService", "StreamingOutputCall",
40-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
41-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
40+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.parser()),
41+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.parser()));
4242
// Static method descriptors that strictly reflect the proto.
4343
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingInputCallRequest,
4444
io.grpc.testing.integration.Messages.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
4545
io.grpc.MethodDescriptor.create(
4646
io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
4747
"grpc.testing.TestService", "StreamingInputCall",
48-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallRequest.PARSER),
49-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallResponse.PARSER));
48+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallRequest.parser()),
49+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallResponse.parser()));
5050
// Static method descriptors that strictly reflect the proto.
5151
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
5252
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
5353
io.grpc.MethodDescriptor.create(
5454
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
5555
"grpc.testing.TestService", "FullDuplexCall",
56-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
57-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
56+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.parser()),
57+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.parser()));
5858
// Static method descriptors that strictly reflect the proto.
5959
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
6060
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
6161
io.grpc.MethodDescriptor.create(
6262
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
6363
"grpc.testing.TestService", "HalfDuplexCall",
64-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
65-
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
64+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.parser()),
65+
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.parser()));
6666

6767
public static TestServiceStub newStub(io.grpc.Channel channel) {
6868
return new TestServiceStub(channel, CONFIG);

0 commit comments

Comments
 (0)