Skip to content

Commit 67fc45d

Browse files
Rename Duplex to Bidi
1 parent e45c0c5 commit 67fc45d

File tree

14 files changed

+105
-105
lines changed

14 files changed

+105
-105
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
44
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
55
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
6-
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
6+
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
99
import static io.grpc.stub.ClientCalls.futureUnaryCall;
1010
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
1111
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
1212
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
13-
import static io.grpc.stub.ServerCalls.asyncDuplexStreamingCall;
13+
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
1414

1515
@javax.annotation.Generated("by gRPC proto compiler")
1616
public class TestServiceGrpc {
@@ -26,7 +26,7 @@ public class TestServiceGrpc {
2626
public static final io.grpc.MethodDescriptor<io.grpc.testing.SimpleRequest,
2727
io.grpc.testing.SimpleResponse> METHOD_STREAMING_CALL =
2828
io.grpc.MethodDescriptor.create(
29-
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
29+
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
3030
"grpc.testing.TestService", "StreamingCall",
3131
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleRequest.parser()),
3232
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.SimpleResponse.parser()));
@@ -92,7 +92,7 @@ public void unaryCall(io.grpc.testing.SimpleRequest request,
9292
@java.lang.Override
9393
public io.grpc.stub.StreamObserver<io.grpc.testing.SimpleRequest> streamingCall(
9494
io.grpc.stub.StreamObserver<io.grpc.testing.SimpleResponse> responseObserver) {
95-
return asyncDuplexStreamingCall(
95+
return asyncBidiStreamingCall(
9696
channel.newCall(METHOD_STREAMING_CALL, callOptions), responseObserver);
9797
}
9898
}
@@ -164,8 +164,8 @@ public void invoke(
164164
})))
165165
.addMethod(io.grpc.ServerMethodDefinition.create(
166166
METHOD_STREAMING_CALL,
167-
asyncDuplexStreamingCall(
168-
new io.grpc.stub.ServerCalls.DuplexStreamingMethod<
167+
asyncBidiStreamingCall(
168+
new io.grpc.stub.ServerCalls.BidiStreamingMethod<
169169
io.grpc.testing.SimpleRequest,
170170
io.grpc.testing.SimpleResponse>() {
171171
@java.lang.Override

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
44
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
55
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
6-
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
6+
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
99
import static io.grpc.stub.ClientCalls.futureUnaryCall;
1010
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
1111
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
1212
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
13-
import static io.grpc.stub.ServerCalls.asyncDuplexStreamingCall;
13+
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
1414

1515
@javax.annotation.Generated("by gRPC proto compiler")
1616
public class WorkerGrpc {
@@ -19,14 +19,14 @@ public class WorkerGrpc {
1919
public static final io.grpc.MethodDescriptor<io.grpc.testing.ClientArgs,
2020
io.grpc.testing.ClientStatus> METHOD_RUN_TEST =
2121
io.grpc.MethodDescriptor.create(
22-
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
22+
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
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()));
2626
public static final io.grpc.MethodDescriptor<io.grpc.testing.ServerArgs,
2727
io.grpc.testing.ServerStatus> METHOD_RUN_SERVER =
2828
io.grpc.MethodDescriptor.create(
29-
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
29+
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
3030
"grpc.testing.Worker", "RunServer",
3131
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ServerArgs.parser()),
3232
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.ServerStatus.parser()));
@@ -80,14 +80,14 @@ protected WorkerStub build(io.grpc.Channel channel,
8080
@java.lang.Override
8181
public io.grpc.stub.StreamObserver<io.grpc.testing.ClientArgs> runTest(
8282
io.grpc.stub.StreamObserver<io.grpc.testing.ClientStatus> responseObserver) {
83-
return asyncDuplexStreamingCall(
83+
return asyncBidiStreamingCall(
8484
channel.newCall(METHOD_RUN_TEST, callOptions), responseObserver);
8585
}
8686

8787
@java.lang.Override
8888
public io.grpc.stub.StreamObserver<io.grpc.testing.ServerArgs> runServer(
8989
io.grpc.stub.StreamObserver<io.grpc.testing.ServerStatus> responseObserver) {
90-
return asyncDuplexStreamingCall(
90+
return asyncBidiStreamingCall(
9191
channel.newCall(METHOD_RUN_SERVER, callOptions), responseObserver);
9292
}
9393
}
@@ -133,8 +133,8 @@ public static io.grpc.ServerServiceDefinition bindService(
133133
return io.grpc.ServerServiceDefinition.builder("grpc.testing.Worker")
134134
.addMethod(io.grpc.ServerMethodDefinition.create(
135135
METHOD_RUN_TEST,
136-
asyncDuplexStreamingCall(
137-
new io.grpc.stub.ServerCalls.DuplexStreamingMethod<
136+
asyncBidiStreamingCall(
137+
new io.grpc.stub.ServerCalls.BidiStreamingMethod<
138138
io.grpc.testing.ClientArgs,
139139
io.grpc.testing.ClientStatus>() {
140140
@java.lang.Override
@@ -145,8 +145,8 @@ public io.grpc.stub.StreamObserver<io.grpc.testing.ClientArgs> invoke(
145145
})))
146146
.addMethod(io.grpc.ServerMethodDefinition.create(
147147
METHOD_RUN_SERVER,
148-
asyncDuplexStreamingCall(
149-
new io.grpc.stub.ServerCalls.DuplexStreamingMethod<
148+
asyncBidiStreamingCall(
149+
new io.grpc.stub.ServerCalls.BidiStreamingMethod<
150150
io.grpc.testing.ServerArgs,
151151
io.grpc.testing.ServerStatus>() {
152152
@java.lang.Override

benchmarks/src/jmh/java/io/grpc/benchmarks/netty/AbstractBenchmark.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,11 @@ public void setup(ExecutorType clientExecutor,
225225
"benchmark", "unary",
226226
new ByteBufOutputMarshaller(),
227227
new ByteBufOutputMarshaller());
228-
pingPongMethod = MethodDescriptor.create(MethodType.DUPLEX_STREAMING,
228+
pingPongMethod = MethodDescriptor.create(MethodType.BIDI_STREAMING,
229229
"benchmark", "pingPong",
230230
new ByteBufOutputMarshaller(),
231231
new ByteBufOutputMarshaller());
232-
flowControlledStreaming = MethodDescriptor.create(MethodType.DUPLEX_STREAMING,
232+
flowControlledStreaming = MethodDescriptor.create(MethodType.BIDI_STREAMING,
233233
"benchmark", "flowControlledStreaming",
234234
new ByteBufOutputMarshaller(),
235235
new ByteBufOutputMarshaller());
@@ -408,7 +408,7 @@ protected void startStreamingCalls(int callsPerChannel,
408408
channel.newCall(pingPongMethod, CALL_OPTIONS);
409409
final AtomicReference<StreamObserver<ByteBuf>> requestObserverRef =
410410
new AtomicReference<StreamObserver<ByteBuf>>();
411-
StreamObserver<ByteBuf> requestObserver = ClientCalls.asyncDuplexStreamingCall(
411+
StreamObserver<ByteBuf> requestObserver = ClientCalls.asyncBidiStreamingCall(
412412
streamingCall,
413413
new StreamObserver<ByteBuf>() {
414414
@Override
@@ -453,7 +453,7 @@ protected void startFlowControlledStreamingCalls(int callsPerChannel,
453453
channel.newCall(flowControlledStreaming, CALL_OPTIONS);
454454
final AtomicReference<StreamObserver<ByteBuf>> requestObserverRef =
455455
new AtomicReference<StreamObserver<ByteBuf>>();
456-
StreamObserver<ByteBuf> requestObserver = ClientCalls.asyncDuplexStreamingCall(
456+
StreamObserver<ByteBuf> requestObserver = ClientCalls.asyncBidiStreamingCall(
457457
streamingCall,
458458
new StreamObserver<ByteBuf>() {
459459
@Override

compiler/src/java_plugin/cpp/java_generator.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static void PrintMethodFields(
7474
bool server_streaming = method->server_streaming();
7575
if (client_streaming) {
7676
if (server_streaming) {
77-
(*vars)["method_type"] = "DUPLEX_STREAMING";
77+
(*vars)["method_type"] = "BIDI_STREAMING";
7878
} else {
7979
(*vars)["method_type"] = "CLIENT_STREAMING";
8080
}
@@ -299,7 +299,7 @@ static void PrintStub(const google::protobuf::ServiceDescriptor* service,
299299
break;
300300
case ASYNC_CALL:
301301
if (client_streaming) {
302-
// Duplex streaming or client streaming
302+
// Bidirectional streaming or client streaming
303303
p->Print(
304304
*vars,
305305
"$StreamObserver$<$input_type$> $lower_method_name$(\n"
@@ -346,7 +346,7 @@ static void PrintStub(const google::protobuf::ServiceDescriptor* service,
346346
case ASYNC_CALL:
347347
if (server_streaming) {
348348
if (client_streaming) {
349-
(*vars)["calls_method"] = "asyncDuplexStreamingCall";
349+
(*vars)["calls_method"] = "asyncBidiStreamingCall";
350350
(*vars)["params"] = "responseObserver";
351351
} else {
352352
(*vars)["calls_method"] = "asyncServerStreamingCall";
@@ -412,9 +412,9 @@ static void PrintBindServiceMethod(const ServiceDescriptor* service,
412412
bool server_streaming = method->server_streaming();
413413
if (client_streaming) {
414414
if (server_streaming) {
415-
(*vars)["calls_method"] = "asyncDuplexStreamingCall";
415+
(*vars)["calls_method"] = "asyncBidiStreamingCall";
416416
(*vars)["invocation_class"] =
417-
"io.grpc.stub.ServerCalls.DuplexStreamingMethod";
417+
"io.grpc.stub.ServerCalls.BidiStreamingMethod";
418418
} else {
419419
(*vars)["calls_method"] = "asyncClientStreamingCall";
420420
(*vars)["invocation_class"] =
@@ -543,7 +543,7 @@ void PrintImports(Printer* p, bool generate_nano) {
543543
"import static "
544544
"io.grpc.stub.ClientCalls.asyncClientStreamingCall;\n"
545545
"import static "
546-
"io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;\n"
546+
"io.grpc.stub.ClientCalls.asyncBidiStreamingCall;\n"
547547
"import static "
548548
"io.grpc.stub.ClientCalls.blockingUnaryCall;\n"
549549
"import static "
@@ -557,7 +557,7 @@ void PrintImports(Printer* p, bool generate_nano) {
557557
"import static "
558558
"io.grpc.stub.ServerCalls.asyncClientStreamingCall;\n"
559559
"import static "
560-
"io.grpc.stub.ServerCalls.asyncDuplexStreamingCall;\n\n");
560+
"io.grpc.stub.ServerCalls.asyncBidiStreamingCall;\n\n");
561561
if (generate_nano) {
562562
p->Print("import java.io.IOException;\n\n");
563563
}

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

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package io.grpc.testing.integration;
33
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
44
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
55
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
6-
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
6+
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
99
import static io.grpc.stub.ClientCalls.futureUnaryCall;
1010
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
1111
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
1212
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
13-
import static io.grpc.stub.ServerCalls.asyncDuplexStreamingCall;
13+
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
1414

1515
@javax.annotation.Generated("by gRPC proto compiler")
1616
public class TestServiceGrpc {
@@ -38,17 +38,17 @@ public class TestServiceGrpc {
3838
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.parser()),
3939
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.parser()));
4040
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
41-
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
41+
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL =
4242
io.grpc.MethodDescriptor.create(
43-
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
44-
"grpc.testing.TestService", "FullDuplexCall",
43+
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
44+
"grpc.testing.TestService", "FullBidiCall",
4545
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
4646
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
4747
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
48-
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
48+
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL =
4949
io.grpc.MethodDescriptor.create(
50-
io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
51-
"grpc.testing.TestService", "HalfDuplexCall",
50+
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
51+
"grpc.testing.TestService", "HalfBidiCall",
5252
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
5353
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
5454

@@ -77,10 +77,10 @@ public class TestServiceGrpc {
7777
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
7878
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver);
7979

80-
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
80+
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall(
8181
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
8282

83-
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
83+
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall(
8484
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
8585
}
8686

@@ -137,17 +137,17 @@ public class TestServiceGrpc {
137137
}
138138

139139
@java.lang.Override
140-
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
140+
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall(
141141
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
142-
return asyncDuplexStreamingCall(
143-
channel.newCall(METHOD_FULL_DUPLEX_CALL, callOptions), responseObserver);
142+
return asyncBidiStreamingCall(
143+
channel.newCall(METHOD_FULL_BIDI_CALL, callOptions), responseObserver);
144144
}
145145

146146
@java.lang.Override
147-
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
147+
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall(
148148
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
149-
return asyncDuplexStreamingCall(
150-
channel.newCall(METHOD_HALF_DUPLEX_CALL, callOptions), responseObserver);
149+
return asyncBidiStreamingCall(
150+
channel.newCall(METHOD_HALF_BIDI_CALL, callOptions), responseObserver);
151151
}
152152
}
153153

@@ -249,27 +249,27 @@ public class TestServiceGrpc {
249249
}
250250
})))
251251
.addMethod(io.grpc.ServerMethodDefinition.create(
252-
METHOD_FULL_DUPLEX_CALL,
253-
asyncDuplexStreamingCall(
254-
new io.grpc.stub.ServerCalls.DuplexStreamingMethod<
252+
METHOD_FULL_BIDI_CALL,
253+
asyncBidiStreamingCall(
254+
new io.grpc.stub.ServerCalls.BidiStreamingMethod<
255255
io.grpc.testing.integration.Test.StreamingOutputCallRequest,
256256
io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
257257
@java.lang.Override
258258
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
259259
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
260-
return serviceImpl.fullDuplexCall(responseObserver);
260+
return serviceImpl.fullBidiCall(responseObserver);
261261
}
262262
})))
263263
.addMethod(io.grpc.ServerMethodDefinition.create(
264-
METHOD_HALF_DUPLEX_CALL,
265-
asyncDuplexStreamingCall(
266-
new io.grpc.stub.ServerCalls.DuplexStreamingMethod<
264+
METHOD_HALF_BIDI_CALL,
265+
asyncBidiStreamingCall(
266+
new io.grpc.stub.ServerCalls.BidiStreamingMethod<
267267
io.grpc.testing.integration.Test.StreamingOutputCallRequest,
268268
io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
269269
@java.lang.Override
270270
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
271271
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
272-
return serviceImpl.halfDuplexCall(responseObserver);
272+
return serviceImpl.halfBidiCall(responseObserver);
273273
}
274274
}))).build();
275275
}

0 commit comments

Comments
 (0)