Skip to content

Commit 288517e

Browse files
committed
Merge branch 'master' into inprocess-transport
2 parents f9654c5 + a6585e3 commit 288517e

17 files changed

Lines changed: 223 additions & 892 deletions

File tree

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

Lines changed: 22 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class TestServiceGrpc {
2323
"grpc.testing.TestService", "UnaryCall",
2424
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleRequest.parser()),
2525
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleResponse.parser()));
26-
// Static method descriptors that strictly reflect the proto.
2726
public static final io.grpc.MethodDescriptor<io.grpc.testing.SimpleRequest,
2827
io.grpc.testing.SimpleResponse> METHOD_STREAMING_CALL =
2928
io.grpc.MethodDescriptor.create(
@@ -33,59 +32,17 @@ public class TestServiceGrpc {
3332
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleResponse.parser()));
3433

3534
public static TestServiceStub newStub(io.grpc.Channel channel) {
36-
return new TestServiceStub(channel, CONFIG);
35+
return new TestServiceStub(channel);
3736
}
3837

3938
public static TestServiceBlockingStub newBlockingStub(
4039
io.grpc.Channel channel) {
41-
return new TestServiceBlockingStub(channel, CONFIG);
40+
return new TestServiceBlockingStub(channel);
4241
}
4342

4443
public static TestServiceFutureStub newFutureStub(
4544
io.grpc.Channel channel) {
46-
return new TestServiceFutureStub(channel, CONFIG);
47-
}
48-
49-
// The default service descriptor
50-
private static final TestServiceServiceDescriptor CONFIG =
51-
new TestServiceServiceDescriptor();
52-
53-
@javax.annotation.concurrent.Immutable
54-
public static class TestServiceServiceDescriptor extends
55-
io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
56-
public final io.grpc.MethodDescriptor<io.grpc.testing.SimpleRequest,
57-
io.grpc.testing.SimpleResponse> unaryCall;
58-
public final io.grpc.MethodDescriptor<io.grpc.testing.SimpleRequest,
59-
io.grpc.testing.SimpleResponse> streamingCall;
60-
61-
private TestServiceServiceDescriptor() {
62-
unaryCall = METHOD_UNARY_CALL;
63-
streamingCall = METHOD_STREAMING_CALL;
64-
}
65-
66-
@SuppressWarnings("unchecked")
67-
private TestServiceServiceDescriptor(
68-
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
69-
unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.SimpleRequest,
70-
io.grpc.testing.SimpleResponse>) methodMap.get(
71-
CONFIG.unaryCall.getFullMethodName());
72-
streamingCall = (io.grpc.MethodDescriptor<io.grpc.testing.SimpleRequest,
73-
io.grpc.testing.SimpleResponse>) methodMap.get(
74-
CONFIG.streamingCall.getFullMethodName());
75-
}
76-
77-
@java.lang.Override
78-
protected TestServiceServiceDescriptor build(
79-
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
80-
return new TestServiceServiceDescriptor(methodMap);
81-
}
82-
83-
@java.lang.Override
84-
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
85-
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
86-
unaryCall,
87-
streamingCall);
88-
}
45+
return new TestServiceFutureStub(channel);
8946
}
9047

9148
public static interface TestService {
@@ -108,96 +65,84 @@ public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.Simple
10865
io.grpc.testing.SimpleRequest request);
10966
}
11067

111-
public static class TestServiceStub extends
112-
io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
68+
public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub>
11369
implements TestService {
114-
private TestServiceStub(io.grpc.Channel channel,
115-
TestServiceServiceDescriptor config) {
116-
super(channel, config);
70+
private TestServiceStub(io.grpc.Channel channel) {
71+
super(channel);
11772
}
11873

11974
private TestServiceStub(io.grpc.Channel channel,
120-
TestServiceServiceDescriptor config,
12175
io.grpc.CallOptions callOptions) {
122-
super(channel, config, callOptions);
76+
super(channel, callOptions);
12377
}
12478

12579
@java.lang.Override
12680
protected TestServiceStub build(io.grpc.Channel channel,
127-
TestServiceServiceDescriptor config,
12881
io.grpc.CallOptions callOptions) {
129-
return new TestServiceStub(channel, config, callOptions);
82+
return new TestServiceStub(channel, callOptions);
13083
}
13184

13285
@java.lang.Override
13386
public void unaryCall(io.grpc.testing.SimpleRequest request,
13487
io.grpc.stub.StreamObserver<io.grpc.testing.SimpleResponse> responseObserver) {
13588
asyncUnaryCall(
136-
channel.newCall(config.unaryCall, callOptions), request, responseObserver);
89+
channel.newCall(METHOD_UNARY_CALL, callOptions), request, responseObserver);
13790
}
13891

13992
@java.lang.Override
14093
public io.grpc.stub.StreamObserver<io.grpc.testing.SimpleRequest> streamingCall(
14194
io.grpc.stub.StreamObserver<io.grpc.testing.SimpleResponse> responseObserver) {
14295
return asyncDuplexStreamingCall(
143-
channel.newCall(config.streamingCall, callOptions), responseObserver);
96+
channel.newCall(METHOD_STREAMING_CALL, callOptions), responseObserver);
14497
}
14598
}
14699

147-
public static class TestServiceBlockingStub extends
148-
io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
100+
public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub>
149101
implements TestServiceBlockingClient {
150-
private TestServiceBlockingStub(io.grpc.Channel channel,
151-
TestServiceServiceDescriptor config) {
152-
super(channel, config);
102+
private TestServiceBlockingStub(io.grpc.Channel channel) {
103+
super(channel);
153104
}
154105

155106
private TestServiceBlockingStub(io.grpc.Channel channel,
156-
TestServiceServiceDescriptor config,
157107
io.grpc.CallOptions callOptions) {
158-
super(channel, config, callOptions);
108+
super(channel, callOptions);
159109
}
160110

161111
@java.lang.Override
162112
protected TestServiceBlockingStub build(io.grpc.Channel channel,
163-
TestServiceServiceDescriptor config,
164113
io.grpc.CallOptions callOptions) {
165-
return new TestServiceBlockingStub(channel, config, callOptions);
114+
return new TestServiceBlockingStub(channel, callOptions);
166115
}
167116

168117
@java.lang.Override
169118
public io.grpc.testing.SimpleResponse unaryCall(io.grpc.testing.SimpleRequest request) {
170119
return blockingUnaryCall(
171-
channel.newCall(config.unaryCall, callOptions), request);
120+
channel.newCall(METHOD_UNARY_CALL, callOptions), request);
172121
}
173122
}
174123

175-
public static class TestServiceFutureStub extends
176-
io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
124+
public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub>
177125
implements TestServiceFutureClient {
178-
private TestServiceFutureStub(io.grpc.Channel channel,
179-
TestServiceServiceDescriptor config) {
180-
super(channel, config);
126+
private TestServiceFutureStub(io.grpc.Channel channel) {
127+
super(channel);
181128
}
182129

183130
private TestServiceFutureStub(io.grpc.Channel channel,
184-
TestServiceServiceDescriptor config,
185131
io.grpc.CallOptions callOptions) {
186-
super(channel, config, callOptions);
132+
super(channel, callOptions);
187133
}
188134

189135
@java.lang.Override
190136
protected TestServiceFutureStub build(io.grpc.Channel channel,
191-
TestServiceServiceDescriptor config,
192137
io.grpc.CallOptions callOptions) {
193-
return new TestServiceFutureStub(channel, config, callOptions);
138+
return new TestServiceFutureStub(channel, callOptions);
194139
}
195140

196141
@java.lang.Override
197142
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.SimpleResponse> unaryCall(
198143
io.grpc.testing.SimpleRequest request) {
199144
return futureUnaryCall(
200-
channel.newCall(config.unaryCall, callOptions), request);
145+
channel.newCall(METHOD_UNARY_CALL, callOptions), request);
201146
}
202147
}
203148

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

Lines changed: 20 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class WorkerGrpc {
2323
"grpc.testing.Worker", "RunTest",
2424
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ClientArgs.parser()),
2525
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ClientStatus.parser()));
26-
// Static method descriptors that strictly reflect the proto.
2726
public static final io.grpc.MethodDescriptor<io.grpc.testing.ServerArgs,
2827
io.grpc.testing.ServerStatus> METHOD_RUN_SERVER =
2928
io.grpc.MethodDescriptor.create(
@@ -33,59 +32,17 @@ public class WorkerGrpc {
3332
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ServerStatus.parser()));
3433

3534
public static WorkerStub newStub(io.grpc.Channel channel) {
36-
return new WorkerStub(channel, CONFIG);
35+
return new WorkerStub(channel);
3736
}
3837

3938
public static WorkerBlockingStub newBlockingStub(
4039
io.grpc.Channel channel) {
41-
return new WorkerBlockingStub(channel, CONFIG);
40+
return new WorkerBlockingStub(channel);
4241
}
4342

4443
public static WorkerFutureStub newFutureStub(
4544
io.grpc.Channel channel) {
46-
return new WorkerFutureStub(channel, CONFIG);
47-
}
48-
49-
// The default service descriptor
50-
private static final WorkerServiceDescriptor CONFIG =
51-
new WorkerServiceDescriptor();
52-
53-
@javax.annotation.concurrent.Immutable
54-
public static class WorkerServiceDescriptor extends
55-
io.grpc.stub.AbstractServiceDescriptor<WorkerServiceDescriptor> {
56-
public final io.grpc.MethodDescriptor<io.grpc.testing.ClientArgs,
57-
io.grpc.testing.ClientStatus> runTest;
58-
public final io.grpc.MethodDescriptor<io.grpc.testing.ServerArgs,
59-
io.grpc.testing.ServerStatus> runServer;
60-
61-
private WorkerServiceDescriptor() {
62-
runTest = METHOD_RUN_TEST;
63-
runServer = METHOD_RUN_SERVER;
64-
}
65-
66-
@SuppressWarnings("unchecked")
67-
private WorkerServiceDescriptor(
68-
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
69-
runTest = (io.grpc.MethodDescriptor<io.grpc.testing.ClientArgs,
70-
io.grpc.testing.ClientStatus>) methodMap.get(
71-
CONFIG.runTest.getFullMethodName());
72-
runServer = (io.grpc.MethodDescriptor<io.grpc.testing.ServerArgs,
73-
io.grpc.testing.ServerStatus>) methodMap.get(
74-
CONFIG.runServer.getFullMethodName());
75-
}
76-
77-
@java.lang.Override
78-
protected WorkerServiceDescriptor build(
79-
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
80-
return new WorkerServiceDescriptor(methodMap);
81-
}
82-
83-
@java.lang.Override
84-
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
85-
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
86-
runTest,
87-
runServer);
88-
}
45+
return new WorkerFutureStub(channel);
8946
}
9047

9148
public static interface Worker {
@@ -103,83 +60,71 @@ public static interface WorkerBlockingClient {
10360
public static interface WorkerFutureClient {
10461
}
10562

106-
public static class WorkerStub extends
107-
io.grpc.stub.AbstractStub<WorkerStub, WorkerServiceDescriptor>
63+
public static class WorkerStub extends io.grpc.stub.AbstractStub<WorkerStub>
10864
implements Worker {
109-
private WorkerStub(io.grpc.Channel channel,
110-
WorkerServiceDescriptor config) {
111-
super(channel, config);
65+
private WorkerStub(io.grpc.Channel channel) {
66+
super(channel);
11267
}
11368

11469
private WorkerStub(io.grpc.Channel channel,
115-
WorkerServiceDescriptor config,
11670
io.grpc.CallOptions callOptions) {
117-
super(channel, config, callOptions);
71+
super(channel, callOptions);
11872
}
11973

12074
@java.lang.Override
12175
protected WorkerStub build(io.grpc.Channel channel,
122-
WorkerServiceDescriptor config,
12376
io.grpc.CallOptions callOptions) {
124-
return new WorkerStub(channel, config, callOptions);
77+
return new WorkerStub(channel, callOptions);
12578
}
12679

12780
@java.lang.Override
12881
public io.grpc.stub.StreamObserver<io.grpc.testing.ClientArgs> runTest(
12982
io.grpc.stub.StreamObserver<io.grpc.testing.ClientStatus> responseObserver) {
13083
return asyncDuplexStreamingCall(
131-
channel.newCall(config.runTest, callOptions), responseObserver);
84+
channel.newCall(METHOD_RUN_TEST, callOptions), responseObserver);
13285
}
13386

13487
@java.lang.Override
13588
public io.grpc.stub.StreamObserver<io.grpc.testing.ServerArgs> runServer(
13689
io.grpc.stub.StreamObserver<io.grpc.testing.ServerStatus> responseObserver) {
13790
return asyncDuplexStreamingCall(
138-
channel.newCall(config.runServer, callOptions), responseObserver);
91+
channel.newCall(METHOD_RUN_SERVER, callOptions), responseObserver);
13992
}
14093
}
14194

142-
public static class WorkerBlockingStub extends
143-
io.grpc.stub.AbstractStub<WorkerBlockingStub, WorkerServiceDescriptor>
95+
public static class WorkerBlockingStub extends io.grpc.stub.AbstractStub<WorkerBlockingStub>
14496
implements WorkerBlockingClient {
145-
private WorkerBlockingStub(io.grpc.Channel channel,
146-
WorkerServiceDescriptor config) {
147-
super(channel, config);
97+
private WorkerBlockingStub(io.grpc.Channel channel) {
98+
super(channel);
14899
}
149100

150101
private WorkerBlockingStub(io.grpc.Channel channel,
151-
WorkerServiceDescriptor config,
152102
io.grpc.CallOptions callOptions) {
153-
super(channel, config, callOptions);
103+
super(channel, callOptions);
154104
}
155105

156106
@java.lang.Override
157107
protected WorkerBlockingStub build(io.grpc.Channel channel,
158-
WorkerServiceDescriptor config,
159108
io.grpc.CallOptions callOptions) {
160-
return new WorkerBlockingStub(channel, config, callOptions);
109+
return new WorkerBlockingStub(channel, callOptions);
161110
}
162111
}
163112

164-
public static class WorkerFutureStub extends
165-
io.grpc.stub.AbstractStub<WorkerFutureStub, WorkerServiceDescriptor>
113+
public static class WorkerFutureStub extends io.grpc.stub.AbstractStub<WorkerFutureStub>
166114
implements WorkerFutureClient {
167-
private WorkerFutureStub(io.grpc.Channel channel,
168-
WorkerServiceDescriptor config) {
169-
super(channel, config);
115+
private WorkerFutureStub(io.grpc.Channel channel) {
116+
super(channel);
170117
}
171118

172119
private WorkerFutureStub(io.grpc.Channel channel,
173-
WorkerServiceDescriptor config,
174120
io.grpc.CallOptions callOptions) {
175-
super(channel, config, callOptions);
121+
super(channel, callOptions);
176122
}
177123

178124
@java.lang.Override
179125
protected WorkerFutureStub build(io.grpc.Channel channel,
180-
WorkerServiceDescriptor config,
181126
io.grpc.CallOptions callOptions) {
182-
return new WorkerFutureStub(channel, config, callOptions);
127+
return new WorkerFutureStub(channel, callOptions);
183128
}
184129
}
185130

0 commit comments

Comments
 (0)