From 686dcff217c0ea803ea3d80b695a59509985130a Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Thu, 16 Jul 2015 12:34:37 -0700 Subject: [PATCH] Rename unaryFutureCall to futureUnaryCall --- .../main/grpc/io/grpc/testing/TestServiceGrpc.java | 4 ++-- .../src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java | 2 +- compiler/src/java_plugin/cpp/java_generator.cpp | 4 ++-- compiler/src/test/golden/TestService.java.txt | 4 ++-- compiler/src/test/golden/TestServiceNano.java.txt | 4 ++-- .../main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java | 4 ++-- .../grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java | 4 ++-- .../grpc/io/grpc/testing/integration/TestServiceGrpc.java | 6 +++--- stub/src/main/java/io/grpc/stub/ClientCalls.java | 4 ++-- stub/src/test/java/io/grpc/stub/ClientCallsTest.java | 6 +++--- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java index 1919a5d071..5dfcc13441 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java @@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.unaryFutureCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; @@ -196,7 +196,7 @@ public class TestServiceGrpc { @java.lang.Override public com.google.common.util.concurrent.ListenableFuture unaryCall( io.grpc.testing.SimpleRequest request) { - return unaryFutureCall( + return futureUnaryCall( channel.newCall(config.unaryCall, callOptions), request); } } diff --git a/benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java index b1c8daa20e..82220ae057 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java @@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.unaryFutureCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index 55c413bb31..07af2f1c0f 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -475,7 +475,7 @@ static void PrintStub(const google::protobuf::ServiceDescriptor* service, << "Future interface doesn't support streaming. " << "client_streaming=" << client_streaming << ", " << "server_streaming=" << server_streaming; - (*vars)["calls_method"] = "unaryFutureCall"; + (*vars)["calls_method"] = "futureUnaryCall"; p->Print( *vars, "return $calls_method$(\n" @@ -658,7 +658,7 @@ void PrintImports(Printer* p, bool generate_nano) { "import static " "io.grpc.stub.ClientCalls.blockingServerStreamingCall;\n" "import static " - "io.grpc.stub.ClientCalls.unaryFutureCall;\n" + "io.grpc.stub.ClientCalls.futureUnaryCall;\n" "import static " "io.grpc.stub.ServerCalls.asyncUnaryCall;\n" "import static " diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt index dd2f93a143..78c11c1af4 100644 --- a/compiler/src/test/golden/TestService.java.txt +++ b/compiler/src/test/golden/TestService.java.txt @@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.unaryFutureCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; @@ -281,7 +281,7 @@ public class TestServiceGrpc { @java.lang.Override public com.google.common.util.concurrent.ListenableFuture unaryCall( io.grpc.testing.integration.Test.SimpleRequest request) { - return unaryFutureCall( + return futureUnaryCall( channel.newCall(config.unaryCall, callOptions), request); } } diff --git a/compiler/src/test/golden/TestServiceNano.java.txt b/compiler/src/test/golden/TestServiceNano.java.txt index 834f93cb13..9c6ea67738 100644 --- a/compiler/src/test/golden/TestServiceNano.java.txt +++ b/compiler/src/test/golden/TestServiceNano.java.txt @@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.unaryFutureCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; @@ -343,7 +343,7 @@ public class TestServiceGrpc { @java.lang.Override public com.google.common.util.concurrent.ListenableFuture unaryCall( io.grpc.testing.integration.Test.SimpleRequest request) { - return unaryFutureCall( + return futureUnaryCall( channel.newCall(config.unaryCall, callOptions), request); } } diff --git a/examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java b/examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java index a34c6e08a0..180c1ae487 100644 --- a/examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java +++ b/examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java @@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.unaryFutureCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; @@ -171,7 +171,7 @@ public class GreeterGrpc { @java.lang.Override public com.google.common.util.concurrent.ListenableFuture sayHello( io.grpc.examples.helloworld.HelloRequest request) { - return unaryFutureCall( + return futureUnaryCall( channel.newCall(config.sayHello, callOptions), request); } } diff --git a/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java b/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java index c76077beb7..0a9416d5ce 100644 --- a/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java +++ b/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java @@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.unaryFutureCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; @@ -256,7 +256,7 @@ public class RouteGuideGrpc { @java.lang.Override public com.google.common.util.concurrent.ListenableFuture getFeature( io.grpc.examples.routeguide.Point request) { - return unaryFutureCall( + return futureUnaryCall( channel.newCall(config.getFeature, callOptions), request); } } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java index f0e1ab23a8..ca27aaadbc 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -6,7 +6,7 @@ import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.unaryFutureCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; @@ -317,14 +317,14 @@ public class TestServiceGrpc { @java.lang.Override public com.google.common.util.concurrent.ListenableFuture emptyCall( com.google.protobuf.EmptyProtos.Empty request) { - return unaryFutureCall( + return futureUnaryCall( channel.newCall(config.emptyCall, callOptions), request); } @java.lang.Override public com.google.common.util.concurrent.ListenableFuture unaryCall( io.grpc.testing.integration.Messages.SimpleRequest request) { - return unaryFutureCall( + return futureUnaryCall( channel.newCall(config.unaryCall, callOptions), request); } } diff --git a/stub/src/main/java/io/grpc/stub/ClientCalls.java b/stub/src/main/java/io/grpc/stub/ClientCalls.java index c14010b9a6..d9dae75502 100644 --- a/stub/src/main/java/io/grpc/stub/ClientCalls.java +++ b/stub/src/main/java/io/grpc/stub/ClientCalls.java @@ -101,7 +101,7 @@ public class ClientCalls { */ public static RespT blockingUnaryCall(ClientCall call, ReqT param) { try { - return getUnchecked(unaryFutureCall(call, param)); + return getUnchecked(futureUnaryCall(call, param)); } catch (Throwable t) { call.cancel(); throw Throwables.propagate(t); @@ -126,7 +126,7 @@ public class ClientCalls { * * @return a future for the single response message. */ - public static ListenableFuture unaryFutureCall( + public static ListenableFuture futureUnaryCall( ClientCall call, ReqT param) { GrpcFuture responseFuture = new GrpcFuture(call); diff --git a/stub/src/test/java/io/grpc/stub/ClientCallsTest.java b/stub/src/test/java/io/grpc/stub/ClientCallsTest.java index 5366a5cb4c..46d89efbe4 100644 --- a/stub/src/test/java/io/grpc/stub/ClientCallsTest.java +++ b/stub/src/test/java/io/grpc/stub/ClientCallsTest.java @@ -67,7 +67,7 @@ public class ClientCallsTest { @Test public void unaryFutureCallSuccess() throws Exception { Integer req = 2; - ListenableFuture future = ClientCalls.unaryFutureCall(call, req); + ListenableFuture future = ClientCalls.futureUnaryCall(call, req); ArgumentCaptor> listenerCaptor = ArgumentCaptor.forClass(null); verify(call).start(listenerCaptor.capture(), any(Metadata.Headers.class)); ClientCall.Listener listener = listenerCaptor.getValue(); @@ -80,7 +80,7 @@ public class ClientCallsTest { @Test public void unaryFutureCallFailed() throws Exception { Integer req = 2; - ListenableFuture future = ClientCalls.unaryFutureCall(call, req); + ListenableFuture future = ClientCalls.futureUnaryCall(call, req); ArgumentCaptor> listenerCaptor = ArgumentCaptor.forClass(null); verify(call).start(listenerCaptor.capture(), any(Metadata.Headers.class)); ClientCall.Listener listener = listenerCaptor.getValue(); @@ -96,7 +96,7 @@ public class ClientCallsTest { @Test public void unaryFutureCallCancelled() throws Exception { Integer req = 2; - ListenableFuture future = ClientCalls.unaryFutureCall(call, req); + ListenableFuture future = ClientCalls.futureUnaryCall(call, req); ArgumentCaptor> listenerCaptor = ArgumentCaptor.forClass(null); verify(call).start(listenerCaptor.capture(), any(Metadata.Headers.class)); ClientCall.Listener listener = listenerCaptor.getValue();