diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java index 8883137416..67c764ee13 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java @@ -15,6 +15,8 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: services.proto") @@ -44,25 +46,48 @@ public class BenchmarkServiceGrpc { io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Messages.SimpleRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.benchmarks.proto.Messages.SimpleResponse.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static BenchmarkServiceStub newStub(io.grpc.Channel channel) { return new BenchmarkServiceStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static BenchmarkServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new BenchmarkServiceBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static BenchmarkServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new BenchmarkServiceFutureStub(channel); } + /** + */ public static interface BenchmarkService { + /** + *
+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public void unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request, io.grpc.stub.StreamObserver
+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public io.grpc.stub.StreamObserver
+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public io.grpc.benchmarks.proto.Messages.SimpleResponse unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request); } + /** + */ public static interface BenchmarkServiceFutureClient { + /** + *
+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public com.google.common.util.concurrent.ListenableFuture
+ * Start server with specified workload. + * First request sent specifies the ServerConfig followed by ServerStatus + * response. After that, a "Mark" can be sent anytime to request the latest + * stats. Closing the stream will initiate shutdown of the test server + * and once the shutdown has finished, the OK status is sent to terminate + * this RPC. + *+ */ public io.grpc.stub.StreamObserver
+ * Start client with specified workload. + * First request sent specifies the ClientConfig followed by ClientStatus + * response. After that, a "Mark" can be sent anytime to request the latest + * stats. Closing the stream will initiate shutdown of the test client + * and once the shutdown has finished, the OK status is sent to terminate + * this RPC. + *+ */ public io.grpc.stub.StreamObserver
+ * Just return the core count - unary call + *+ */ public void coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request, io.grpc.stub.StreamObserver
+ * Quit this worker + *+ */ public void quitWorker(io.grpc.benchmarks.proto.Control.Void request, io.grpc.stub.StreamObserver
+ * Just return the core count - unary call + *+ */ public io.grpc.benchmarks.proto.Control.CoreResponse coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request); + /** + *
+ * Quit this worker + *+ */ public io.grpc.benchmarks.proto.Control.Void quitWorker(io.grpc.benchmarks.proto.Control.Void request); } + /** + */ public static interface WorkerServiceFutureClient { + /** + *
+ * Just return the core count - unary call + *+ */ public com.google.common.util.concurrent.ListenableFuture
+ * Quit this worker + *+ */ public com.google.common.util.concurrent.ListenableFuture
to get fixed-width text formatting. + + // If the comment itself contains block comment start or end markers, + // HTML-escape them so that they don't accidentally close the doc comment. + string escapedComments = GrpcEscapeJavadoc(comments); + + vectorlines = GrpcSplit(escapedComments, "\n"); + while (!lines.empty() && lines.back().empty()) { + lines.pop_back(); + } + return lines; + } + return vector (); +} + +// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. +template +static vector GrpcGetDocLinesForDescriptor(const DescriptorType* descriptor) { + return GrpcGetDocLines(GrpcGetCommentsForDescriptor(descriptor)); +} + +// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. +static void GrpcWriteDocCommentBody(Printer* printer, + const vector & lines, + bool surroundWithPreTag) { + if (!lines.empty()) { + if (surroundWithPreTag) { + printer->Print(" * \n"); + } + + for (int i = 0; i < lines.size(); i++) { + // Most lines should start with a space. Watch out for lines that start + // with a /, since putting that right after the leading asterisk will + // close the comment. + if (!lines[i].empty() && lines[i][0] == '/') { + printer->Print(" * $line$\n", "line", lines[i]); + } else { + printer->Print(" *$line$\n", "line", lines[i]); + } + } + + if (surroundWithPreTag) { + printer->Print(" *\n"); + } + } +} + +// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. +static void GrpcWriteDocComment(Printer* printer, const string& comments) { + printer->Print("/**\n"); + vectorlines = GrpcGetDocLines(comments); + GrpcWriteDocCommentBody(printer, lines, false); + printer->Print(" */\n"); +} + +// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. +static void GrpcWriteServiceDocComment(Printer* printer, + const ServiceDescriptor* service) { + // Deviating from protobuf to avoid extraneous docs + // (see https://github.com/google/protobuf/issues/1406); + printer->Print("/**\n"); + vector lines = GrpcGetDocLinesForDescriptor(service); + GrpcWriteDocCommentBody(printer, lines, true); + printer->Print(" */\n"); +} + +// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. +void GrpcWriteMethodDocComment(Printer* printer, + const MethodDescriptor* method) { + // Deviating from protobuf to avoid extraneous docs + // (see https://github.com/google/protobuf/issues/1406); + printer->Print("/**\n"); + vector lines = GrpcGetDocLinesForDescriptor(method); + GrpcWriteDocCommentBody(printer, lines, true); + printer->Print(" */\n"); +} + static void PrintMethodFields( const ServiceDescriptor* service, map * vars, Printer* p, ProtoFlavor flavor) { @@ -293,6 +496,7 @@ static void PrintStub( (*vars)["interface_name"] = interface_name; (*vars)["impl_name"] = impl_name; + bool interface = !abstract && !impl; // Class head if (abstract) { p->Print( @@ -300,7 +504,10 @@ static void PrintStub( "@$ExperimentalApi$\n" "public static abstract class $abstract_name$ implements $service_name$, " "$BindableService$ {\n"); - } else if (!impl) { + } else if (interface) { + // TODO(nmittler): Replace with WriteServiceDocComment when included in protobuf distribution. + // Print the service-level javadoc when we define the interface. + GrpcWriteServiceDocComment(p, service); p->Print( *vars, "public static interface $interface_name$ {\n"); @@ -366,7 +573,10 @@ static void PrintStub( // Method signature p->Print("\n"); - if (impl || abstract) { + if (interface) { + // TODO(nmittler): Replace with WriteMethodDocComment once included by the protobuf distro. + GrpcWriteMethodDocComment(p, method); + } else { p->Print( *vars, "@$Override$\n"); @@ -715,6 +925,8 @@ static void PrintService(const ServiceDescriptor* service, #else (*vars)["grpc_version"] = ""; #endif + // TODO(nmittler): Replace with WriteServiceDocComment once included by protobuf distro. + GrpcWriteServiceDocComment(p, service); p->Print( *vars, "@$Generated$(\n" @@ -733,6 +945,8 @@ static void PrintService(const ServiceDescriptor* service, PrintMethodFields(service, vars, p, flavor); + // TODO(nmittler): Replace with WriteDocComment once included by protobuf distro. + GrpcWriteDocComment(p, " Creates a new async stub that supports all call types for the service"); p->Print( *vars, "public static $service_name$Stub newStub($Channel$ channel) {\n"); @@ -742,6 +956,10 @@ static void PrintService(const ServiceDescriptor* service, "return new $service_name$Stub(channel);\n"); p->Outdent(); p->Print("}\n\n"); + + // TODO(nmittler): Replace with WriteDocComment once included by protobuf distro. + GrpcWriteDocComment(p, " Creates a new blocking-style stub that supports unary and streaming " + "output calls on the service"); p->Print( *vars, "public static $service_name$BlockingStub newBlockingStub(\n" @@ -752,6 +970,10 @@ static void PrintService(const ServiceDescriptor* service, "return new $service_name$BlockingStub(channel);\n"); p->Outdent(); p->Print("}\n\n"); + + // TODO(nmittler): Replace with WriteDocComment once included by protobuf distro. + GrpcWriteDocComment(p, " Creates a new ListenableFuture-style stub that supports unary and " + "streaming output calls on the service"); p->Print( *vars, "public static $service_name$FutureStub newFutureStub(\n" diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt index 57691bf84a..535313a2b6 100644 --- a/compiler/src/test/golden/TestService.java.txt +++ b/compiler/src/test/golden/TestService.java.txt @@ -15,6 +15,11 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + * + * Test service that supports all call types. + *+ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: test.proto") @@ -71,34 +76,81 @@ public class TestServiceGrpc { io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static TestServiceStub newStub(io.grpc.Channel channel) { return new TestServiceStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static TestServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new TestServiceBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static TestServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new TestServiceFutureStub(channel); } + /** + *+ * Test service that supports all call types. + *+ */ public static interface TestService { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + *+ */ public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * A sequence of requests followed by one response (streamed upload). + * The server returns the aggregated size of client payload as the result. + *+ */ public io.grpc.stub.StreamObserverstreamingInputCall( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A sequence of requests with each request served by the server immediately. + * As one request could lead to multiple responses, this interface + * demonstrates the idea of full bidirectionality. + *+ */ public io.grpc.stub.StreamObserverfullBidiCall( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A sequence of requests followed by a sequence of responses. + * The server buffers all the client requests and then serves them in order. A + * stream of responses are returned to the client when the server starts with + * first request. + *+ */ public io.grpc.stub.StreamObserverhalfBidiCall( io.grpc.stub.StreamObserver responseObserver); } @@ -141,16 +193,44 @@ public class TestServiceGrpc { } } + /** + * + * Test service that supports all call types. + *+ */ public static interface TestServiceBlockingClient { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request); + /** + *+ * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + *+ */ public java.util.IteratorstreamingOutputCall( io.grpc.testing.integration.Test.StreamingOutputCallRequest request); } + /** + * + * Test service that supports all call types. + *+ */ public static interface TestServiceFutureClient { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public com.google.common.util.concurrent.ListenableFutureunaryCall( io.grpc.testing.integration.Test.SimpleRequest request); } diff --git a/compiler/src/test/proto/test.proto b/compiler/src/test/proto/test.proto index 5b4a267685..dfaaed571c 100644 --- a/compiler/src/test/proto/test.proto +++ b/compiler/src/test/proto/test.proto @@ -23,6 +23,7 @@ message StreamingOutputCallRequest { message StreamingOutputCallResponse { } +// Test service that supports all call types. service TestService { // One request followed by one response. // The server returns the client payload as-is. diff --git a/compiler/src/testLite/golden/TestService.java.txt b/compiler/src/testLite/golden/TestService.java.txt index 31002c94d9..90343fd9aa 100644 --- a/compiler/src/testLite/golden/TestService.java.txt +++ b/compiler/src/testLite/golden/TestService.java.txt @@ -15,6 +15,11 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + * + * Test service that supports all call types. + *+ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: test.proto") @@ -71,34 +76,81 @@ public class TestServiceGrpc { io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static TestServiceStub newStub(io.grpc.Channel channel) { return new TestServiceStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static TestServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new TestServiceBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static TestServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new TestServiceFutureStub(channel); } + /** + *+ * Test service that supports all call types. + *+ */ public static interface TestService { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + *+ */ public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * A sequence of requests followed by one response (streamed upload). + * The server returns the aggregated size of client payload as the result. + *+ */ public io.grpc.stub.StreamObserverstreamingInputCall( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A sequence of requests with each request served by the server immediately. + * As one request could lead to multiple responses, this interface + * demonstrates the idea of full bidirectionality. + *+ */ public io.grpc.stub.StreamObserverfullBidiCall( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A sequence of requests followed by a sequence of responses. + * The server buffers all the client requests and then serves them in order. A + * stream of responses are returned to the client when the server starts with + * first request. + *+ */ public io.grpc.stub.StreamObserverhalfBidiCall( io.grpc.stub.StreamObserver responseObserver); } @@ -141,16 +193,44 @@ public class TestServiceGrpc { } } + /** + * + * Test service that supports all call types. + *+ */ public static interface TestServiceBlockingClient { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request); + /** + *+ * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + *+ */ public java.util.IteratorstreamingOutputCall( io.grpc.testing.integration.Test.StreamingOutputCallRequest request); } + /** + * + * Test service that supports all call types. + *+ */ public static interface TestServiceFutureClient { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public com.google.common.util.concurrent.ListenableFutureunaryCall( io.grpc.testing.integration.Test.SimpleRequest request); } diff --git a/compiler/src/testLite/proto/test.proto b/compiler/src/testLite/proto/test.proto index fb2e3e7722..d2a1fd5879 100644 --- a/compiler/src/testLite/proto/test.proto +++ b/compiler/src/testLite/proto/test.proto @@ -24,6 +24,7 @@ message StreamingOutputCallRequest { message StreamingOutputCallResponse { } +// Test service that supports all call types. service TestService { // One request followed by one response. // The server returns the client payload as-is. diff --git a/compiler/src/testNano/golden/TestService.java.txt b/compiler/src/testNano/golden/TestService.java.txt index 1f2c91c361..f0232ecce0 100644 --- a/compiler/src/testNano/golden/TestService.java.txt +++ b/compiler/src/testNano/golden/TestService.java.txt @@ -17,6 +17,11 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; import java.io.IOException; +/** + * + * Test service that supports all call types. + *+ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: test.proto") @@ -149,34 +154,81 @@ public class TestServiceGrpc { } } + /** + * Creates a new async stub that supports all call types for the service + */ public static TestServiceStub newStub(io.grpc.Channel channel) { return new TestServiceStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static TestServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new TestServiceBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static TestServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new TestServiceFutureStub(channel); } + /** + *+ * Test service that supports all call types. + *+ */ public static interface TestService { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + *+ */ public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * A sequence of requests followed by one response (streamed upload). + * The server returns the aggregated size of client payload as the result. + *+ */ public io.grpc.stub.StreamObserverstreamingInputCall( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A sequence of requests with each request served by the server immediately. + * As one request could lead to multiple responses, this interface + * demonstrates the idea of full bidirectionality. + *+ */ public io.grpc.stub.StreamObserverfullBidiCall( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A sequence of requests followed by a sequence of responses. + * The server buffers all the client requests and then serves them in order. A + * stream of responses are returned to the client when the server starts with + * first request. + *+ */ public io.grpc.stub.StreamObserverhalfBidiCall( io.grpc.stub.StreamObserver responseObserver); } @@ -219,16 +271,44 @@ public class TestServiceGrpc { } } + /** + * + * Test service that supports all call types. + *+ */ public static interface TestServiceBlockingClient { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request); + /** + *+ * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + *+ */ public java.util.IteratorstreamingOutputCall( io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request); } + /** + * + * Test service that supports all call types. + *+ */ public static interface TestServiceFutureClient { + /** + *+ * One request followed by one response. + * The server returns the client payload as-is. + *+ */ public com.google.common.util.concurrent.ListenableFutureunaryCall( io.grpc.testing.integration.nano.Test.SimpleRequest 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 d6f69dd95b..b72f51a4a4 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 @@ -15,6 +15,11 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + * + * The greeting service definition. + *+ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: helloworld.proto") @@ -35,22 +40,41 @@ public class GreeterGrpc { io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloReply.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static GreeterStub newStub(io.grpc.Channel channel) { return new GreeterStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static GreeterBlockingStub newBlockingStub( io.grpc.Channel channel) { return new GreeterBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static GreeterFutureStub newFutureStub( io.grpc.Channel channel) { return new GreeterFutureStub(channel); } + /** + *+ * The greeting service definition. + *+ */ public static interface Greeter { + /** + *+ * Sends a greeting + *+ */ public void sayHello(io.grpc.examples.helloworld.HelloRequest request, io.grpc.stub.StreamObserverresponseObserver); } @@ -69,13 +93,33 @@ public class GreeterGrpc { } } + /** + * + * The greeting service definition. + *+ */ public static interface GreeterBlockingClient { + /** + *+ * Sends a greeting + *+ */ public io.grpc.examples.helloworld.HelloReply sayHello(io.grpc.examples.helloworld.HelloRequest request); } + /** + *+ * The greeting service definition. + *+ */ public static interface GreeterFutureClient { + /** + *+ * Sends a greeting + *+ */ public com.google.common.util.concurrent.ListenableFuturesayHello( io.grpc.examples.helloworld.HelloRequest 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 d7dcdac4a6..16b4e11acc 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 @@ -15,6 +15,11 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + * + * Interface exported by the server. + *+ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: route_guide.proto") @@ -62,31 +67,76 @@ public class RouteGuideGrpc { io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteNote.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteNote.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static RouteGuideStub newStub(io.grpc.Channel channel) { return new RouteGuideStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static RouteGuideBlockingStub newBlockingStub( io.grpc.Channel channel) { return new RouteGuideBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static RouteGuideFutureStub newFutureStub( io.grpc.Channel channel) { return new RouteGuideFutureStub(channel); } + /** + *+ * Interface exported by the server. + *+ */ public static interface RouteGuide { + /** + *+ * A simple RPC. + * Obtains the feature at a given position. + * A feature with an empty name is returned if there's no feature at the given + * position. + *+ */ public void getFeature(io.grpc.examples.routeguide.Point request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * A server-to-client streaming RPC. + * Obtains the Features available within the given Rectangle. Results are + * streamed rather than returned at once (e.g. in a response message with a + * repeated field), as the rectangle may cover a large area and contain a + * huge number of features. + *+ */ public void listFeatures(io.grpc.examples.routeguide.Rectangle request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * A client-to-server streaming RPC. + * Accepts a stream of Points on a route being traversed, returning a + * RouteSummary when traversal is completed. + *+ */ public io.grpc.stub.StreamObserverrecordRoute( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A Bidirectional streaming RPC. + * Accepts a stream of RouteNotes sent while a route is being traversed, + * while receiving other RouteNotes (e.g. from other users). + *+ */ public io.grpc.stub.StreamObserverrouteChat( io.grpc.stub.StreamObserver responseObserver); } @@ -123,16 +173,51 @@ public class RouteGuideGrpc { } } + /** + * + * Interface exported by the server. + *+ */ public static interface RouteGuideBlockingClient { + /** + *+ * A simple RPC. + * Obtains the feature at a given position. + * A feature with an empty name is returned if there's no feature at the given + * position. + *+ */ public io.grpc.examples.routeguide.Feature getFeature(io.grpc.examples.routeguide.Point request); + /** + *+ * A server-to-client streaming RPC. + * Obtains the Features available within the given Rectangle. Results are + * streamed rather than returned at once (e.g. in a response message with a + * repeated field), as the rectangle may cover a large area and contain a + * huge number of features. + *+ */ public java.util.IteratorlistFeatures( io.grpc.examples.routeguide.Rectangle request); } + /** + * + * Interface exported by the server. + *+ */ public static interface RouteGuideFutureClient { + /** + *+ * A simple RPC. + * Obtains the feature at a given position. + * A feature with an empty name is returned if there's no feature at the given + * position. + *+ */ public com.google.common.util.concurrent.ListenableFuturegetFeature( io.grpc.examples.routeguide.Point request); } diff --git a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java index 1bd73a00fa..aa9fa9030a 100644 --- a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java +++ b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java @@ -15,6 +15,8 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: load_balancer.proto") @@ -35,22 +37,38 @@ public class LoadBalancerGrpc { io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.grpclb.LoadBalanceRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.grpclb.LoadBalanceResponse.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static LoadBalancerStub newStub(io.grpc.Channel channel) { return new LoadBalancerStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static LoadBalancerBlockingStub newBlockingStub( io.grpc.Channel channel) { return new LoadBalancerBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static LoadBalancerFutureStub newFutureStub( io.grpc.Channel channel) { return new LoadBalancerFutureStub(channel); } + /** + */ public static interface LoadBalancer { + /** + * + * Bidirectional rpc to get a list of servers. + *+ */ public io.grpc.stub.StreamObserverbalanceLoad( io.grpc.stub.StreamObserver responseObserver); } @@ -69,9 +87,13 @@ public class LoadBalancerGrpc { } } + /** + */ public static interface LoadBalancerBlockingClient { } + /** + */ public static interface LoadBalancerFutureClient { } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index 5685594181..6d05a07fdd 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -15,6 +15,8 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: io/grpc/testing/integration/metrics.proto") @@ -44,25 +46,47 @@ public class MetricsServiceGrpc { io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Metrics.GaugeRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Metrics.GaugeResponse.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static MetricsServiceStub newStub(io.grpc.Channel channel) { return new MetricsServiceStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static MetricsServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new MetricsServiceBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static MetricsServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new MetricsServiceFutureStub(channel); } + /** + */ public static interface MetricsService { + /** + * + * Returns the values of all the gauges that are currently being maintained by + * the service + *+ */ public void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * Returns the value of one gauge + *+ */ public void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, io.grpc.stub.StreamObserverresponseObserver); } @@ -87,16 +111,36 @@ public class MetricsServiceGrpc { } } + /** + */ public static interface MetricsServiceBlockingClient { + /** + * + * Returns the values of all the gauges that are currently being maintained by + * the service + *+ */ public java.util.IteratorgetAllGauges( io.grpc.testing.integration.Metrics.EmptyMessage request); + /** + * + * Returns the value of one gauge + *+ */ public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request); } + /** + */ public static interface MetricsServiceFutureClient { + /** + *+ * Returns the value of one gauge + *+ */ public com.google.common.util.concurrent.ListenableFuturegetGauge( io.grpc.testing.integration.Metrics.GaugeRequest request); } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index 77f0d0b9e8..f35ef154db 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -15,6 +15,11 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + * + * A service used to control reconnect server. + *+ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: io/grpc/testing/integration/test.proto") @@ -44,25 +49,43 @@ public class ReconnectServiceGrpc { io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.ReconnectInfo.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static ReconnectServiceStub newStub(io.grpc.Channel channel) { return new ReconnectServiceStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static ReconnectServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new ReconnectServiceBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static ReconnectServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new ReconnectServiceFutureStub(channel); } + /** + *+ * A service used to control reconnect server. + *+ */ public static interface ReconnectService { + /** + */ public void start(com.google.protobuf.EmptyProtos.Empty request, io.grpc.stub.StreamObserverresponseObserver); + /** + */ public void stop(com.google.protobuf.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver); } @@ -87,18 +110,36 @@ public class ReconnectServiceGrpc { } } + /** + * + * A service used to control reconnect server. + *+ */ public static interface ReconnectServiceBlockingClient { + /** + */ public com.google.protobuf.EmptyProtos.Empty start(com.google.protobuf.EmptyProtos.Empty request); + /** + */ public io.grpc.testing.integration.Messages.ReconnectInfo stop(com.google.protobuf.EmptyProtos.Empty request); } + /** + *+ * A service used to control reconnect server. + *+ */ public static interface ReconnectServiceFutureClient { + /** + */ public com.google.common.util.concurrent.ListenableFuturestart( com.google.protobuf.EmptyProtos.Empty request); + /** + */ public com.google.common.util.concurrent.ListenableFuture stop( com.google.protobuf.EmptyProtos.Empty 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 b633b788f6..242bf1ae93 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 @@ -15,6 +15,12 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + * + * A simple service to test the various types of RPCs and experiment with + * performance with various types of payload. + *+ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: io/grpc/testing/integration/test.proto") @@ -80,37 +86,89 @@ public class TestServiceGrpc { io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static TestServiceStub newStub(io.grpc.Channel channel) { return new TestServiceStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static TestServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new TestServiceBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static TestServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new TestServiceFutureStub(channel); } + /** + *+ * A simple service to test the various types of RPCs and experiment with + * performance with various types of payload. + *+ */ public static interface TestService { + /** + *+ * One empty request followed by one empty response. + *+ */ public void emptyCall(com.google.protobuf.EmptyProtos.Empty request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * One request followed by one response. + *+ */ public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + *+ */ public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request, io.grpc.stub.StreamObserverresponseObserver); + /** + * + * A sequence of requests followed by one response (streamed upload). + * The server returns the aggregated size of client payload as the result. + *+ */ public io.grpc.stub.StreamObserverstreamingInputCall( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A sequence of requests with each request served by the server immediately. + * As one request could lead to multiple responses, this interface + * demonstrates the idea of full duplexing. + *+ */ public io.grpc.stub.StreamObserverfullDuplexCall( io.grpc.stub.StreamObserver responseObserver); + /** + * + * A sequence of requests followed by a sequence of responses. + * The server buffers all the client requests and then serves them in order. A + * stream of responses are returned to the client when the server starts with + * first request. + *+ */ public io.grpc.stub.StreamObserverhalfDuplexCall( io.grpc.stub.StreamObserver responseObserver); } @@ -159,21 +217,59 @@ public class TestServiceGrpc { } } + /** + * + * A simple service to test the various types of RPCs and experiment with + * performance with various types of payload. + *+ */ public static interface TestServiceBlockingClient { + /** + *+ * One empty request followed by one empty response. + *+ */ public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request); + /** + *+ * One request followed by one response. + *+ */ public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request); + /** + *+ * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + *+ */ public java.util.IteratorstreamingOutputCall( io.grpc.testing.integration.Messages.StreamingOutputCallRequest request); } + /** + * + * A simple service to test the various types of RPCs and experiment with + * performance with various types of payload. + *+ */ public static interface TestServiceFutureClient { + /** + *+ * One empty request followed by one empty response. + *+ */ public com.google.common.util.concurrent.ListenableFutureemptyCall( com.google.protobuf.EmptyProtos.Empty request); + /** + * + * One request followed by one response. + *+ */ public com.google.common.util.concurrent.ListenableFutureunaryCall( io.grpc.testing.integration.Messages.SimpleRequest request); } diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index 653301f4ee..7c6822ac5f 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -15,6 +15,12 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +/** + * + * A simple service NOT implemented at servers so clients can test for + * that case. + *+ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)", comments = "Source: io/grpc/testing/integration/test.proto") @@ -35,22 +41,42 @@ public class UnimplementedServiceGrpc { io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.getDefaultInstance())); + /** + * Creates a new async stub that supports all call types for the service + */ public static UnimplementedServiceStub newStub(io.grpc.Channel channel) { return new UnimplementedServiceStub(channel); } + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ public static UnimplementedServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new UnimplementedServiceBlockingStub(channel); } + /** + * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + */ public static UnimplementedServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new UnimplementedServiceFutureStub(channel); } + /** + *+ * A simple service NOT implemented at servers so clients can test for + * that case. + *+ */ public static interface UnimplementedService { + /** + *+ * A call that no server should implement + *+ */ public void unimplementedCall(com.google.protobuf.EmptyProtos.Empty request, io.grpc.stub.StreamObserverresponseObserver); } @@ -69,13 +95,35 @@ public class UnimplementedServiceGrpc { } } + /** + * + * A simple service NOT implemented at servers so clients can test for + * that case. + *+ */ public static interface UnimplementedServiceBlockingClient { + /** + *+ * A call that no server should implement + *+ */ public com.google.protobuf.EmptyProtos.Empty unimplementedCall(com.google.protobuf.EmptyProtos.Empty request); } + /** + *+ * A simple service NOT implemented at servers so clients can test for + * that case. + *+ */ public static interface UnimplementedServiceFutureClient { + /** + *+ * A call that no server should implement + *+ */ public com.google.common.util.concurrent.ListenableFutureunimplementedCall( com.google.protobuf.EmptyProtos.Empty request); }