Skip to content

Commit 686dcff

Browse files
committed
Rename unaryFutureCall to futureUnaryCall
1 parent 690b26e commit 686dcff

10 files changed

Lines changed: 21 additions & 21 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9-
import static io.grpc.stub.ClientCalls.unaryFutureCall;
9+
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;
@@ -196,7 +196,7 @@ protected TestServiceFutureStub build(io.grpc.Channel channel,
196196
@java.lang.Override
197197
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.SimpleResponse> unaryCall(
198198
io.grpc.testing.SimpleRequest request) {
199-
return unaryFutureCall(
199+
return futureUnaryCall(
200200
channel.newCall(config.unaryCall, callOptions), request);
201201
}
202202
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9-
import static io.grpc.stub.ClientCalls.unaryFutureCall;
9+
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;

compiler/src/java_plugin/cpp/java_generator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ static void PrintStub(const google::protobuf::ServiceDescriptor* service,
475475
<< "Future interface doesn't support streaming. "
476476
<< "client_streaming=" << client_streaming << ", "
477477
<< "server_streaming=" << server_streaming;
478-
(*vars)["calls_method"] = "unaryFutureCall";
478+
(*vars)["calls_method"] = "futureUnaryCall";
479479
p->Print(
480480
*vars,
481481
"return $calls_method$(\n"
@@ -658,7 +658,7 @@ void PrintImports(Printer* p, bool generate_nano) {
658658
"import static "
659659
"io.grpc.stub.ClientCalls.blockingServerStreamingCall;\n"
660660
"import static "
661-
"io.grpc.stub.ClientCalls.unaryFutureCall;\n"
661+
"io.grpc.stub.ClientCalls.futureUnaryCall;\n"
662662
"import static "
663663
"io.grpc.stub.ServerCalls.asyncUnaryCall;\n"
664664
"import static "

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
66
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9-
import static io.grpc.stub.ClientCalls.unaryFutureCall;
9+
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;
@@ -281,7 +281,7 @@ public class TestServiceGrpc {
281281
@java.lang.Override
282282
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
283283
io.grpc.testing.integration.Test.SimpleRequest request) {
284-
return unaryFutureCall(
284+
return futureUnaryCall(
285285
channel.newCall(config.unaryCall, callOptions), request);
286286
}
287287
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
66
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9-
import static io.grpc.stub.ClientCalls.unaryFutureCall;
9+
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;
@@ -343,7 +343,7 @@ public class TestServiceGrpc {
343343
@java.lang.Override
344344
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
345345
io.grpc.testing.integration.Test.SimpleRequest request) {
346-
return unaryFutureCall(
346+
return futureUnaryCall(
347347
channel.newCall(config.unaryCall, callOptions), request);
348348
}
349349
}

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
@@ -6,7 +6,7 @@
66
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9-
import static io.grpc.stub.ClientCalls.unaryFutureCall;
9+
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;
@@ -171,7 +171,7 @@ protected GreeterFutureStub build(io.grpc.Channel channel,
171171
@java.lang.Override
172172
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.helloworld.HelloResponse> sayHello(
173173
io.grpc.examples.helloworld.HelloRequest request) {
174-
return unaryFutureCall(
174+
return futureUnaryCall(
175175
channel.newCall(config.sayHello, callOptions), request);
176176
}
177177
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9-
import static io.grpc.stub.ClientCalls.unaryFutureCall;
9+
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;
@@ -256,7 +256,7 @@ protected RouteGuideFutureStub build(io.grpc.Channel channel,
256256
@java.lang.Override
257257
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.routeguide.Feature> getFeature(
258258
io.grpc.examples.routeguide.Point request) {
259-
return unaryFutureCall(
259+
return futureUnaryCall(
260260
channel.newCall(config.getFeature, callOptions), request);
261261
}
262262
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
77
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9-
import static io.grpc.stub.ClientCalls.unaryFutureCall;
9+
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;
@@ -317,14 +317,14 @@ protected TestServiceFutureStub build(io.grpc.Channel channel,
317317
@java.lang.Override
318318
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
319319
com.google.protobuf.EmptyProtos.Empty request) {
320-
return unaryFutureCall(
320+
return futureUnaryCall(
321321
channel.newCall(config.emptyCall, callOptions), request);
322322
}
323323

324324
@java.lang.Override
325325
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.SimpleResponse> unaryCall(
326326
io.grpc.testing.integration.Messages.SimpleRequest request) {
327-
return unaryFutureCall(
327+
return futureUnaryCall(
328328
channel.newCall(config.unaryCall, callOptions), request);
329329
}
330330
}

stub/src/main/java/io/grpc/stub/ClientCalls.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static <ReqT, RespT> StreamObserver<ReqT> asyncDuplexStreamingCall(
101101
*/
102102
public static <ReqT, RespT> RespT blockingUnaryCall(ClientCall<ReqT, RespT> call, ReqT param) {
103103
try {
104-
return getUnchecked(unaryFutureCall(call, param));
104+
return getUnchecked(futureUnaryCall(call, param));
105105
} catch (Throwable t) {
106106
call.cancel();
107107
throw Throwables.propagate(t);
@@ -126,7 +126,7 @@ public static <ReqT, RespT> Iterator<RespT> blockingServerStreamingCall(
126126
*
127127
* @return a future for the single response message.
128128
*/
129-
public static <ReqT, RespT> ListenableFuture<RespT> unaryFutureCall(
129+
public static <ReqT, RespT> ListenableFuture<RespT> futureUnaryCall(
130130
ClientCall<ReqT, RespT> call,
131131
ReqT param) {
132132
GrpcFuture<RespT> responseFuture = new GrpcFuture<RespT>(call);

stub/src/test/java/io/grpc/stub/ClientCallsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class ClientCallsTest {
6767

6868
@Test public void unaryFutureCallSuccess() throws Exception {
6969
Integer req = 2;
70-
ListenableFuture<String> future = ClientCalls.unaryFutureCall(call, req);
70+
ListenableFuture<String> future = ClientCalls.futureUnaryCall(call, req);
7171
ArgumentCaptor<ClientCall.Listener<String>> listenerCaptor = ArgumentCaptor.forClass(null);
7272
verify(call).start(listenerCaptor.capture(), any(Metadata.Headers.class));
7373
ClientCall.Listener<String> listener = listenerCaptor.getValue();
@@ -80,7 +80,7 @@ public class ClientCallsTest {
8080

8181
@Test public void unaryFutureCallFailed() throws Exception {
8282
Integer req = 2;
83-
ListenableFuture<String> future = ClientCalls.unaryFutureCall(call, req);
83+
ListenableFuture<String> future = ClientCalls.futureUnaryCall(call, req);
8484
ArgumentCaptor<ClientCall.Listener<String>> listenerCaptor = ArgumentCaptor.forClass(null);
8585
verify(call).start(listenerCaptor.capture(), any(Metadata.Headers.class));
8686
ClientCall.Listener<String> listener = listenerCaptor.getValue();
@@ -96,7 +96,7 @@ public class ClientCallsTest {
9696

9797
@Test public void unaryFutureCallCancelled() throws Exception {
9898
Integer req = 2;
99-
ListenableFuture<String> future = ClientCalls.unaryFutureCall(call, req);
99+
ListenableFuture<String> future = ClientCalls.futureUnaryCall(call, req);
100100
ArgumentCaptor<ClientCall.Listener<String>> listenerCaptor = ArgumentCaptor.forClass(null);
101101
verify(call).start(listenerCaptor.capture(), any(Metadata.Headers.class));
102102
ClientCall.Listener<String> listener = listenerCaptor.getValue();

0 commit comments

Comments
 (0)