Partially synchronize helloworld.proto with main repository

Mainly HelloResponse is now HelloReply
This commit is contained in:
Eric Anderson 2016-02-02 12:54:04 -08:00
parent 4573836df9
commit 2a17d2648c
12 changed files with 108 additions and 107 deletions

View File

@ -23,13 +23,13 @@ public class GreeterGrpc {
// Static method descriptors that strictly reflect the proto. // Static method descriptors that strictly reflect the proto.
@io.grpc.ExperimentalApi @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.examples.helloworld.HelloRequest, public static final io.grpc.MethodDescriptor<io.grpc.examples.helloworld.HelloRequest,
io.grpc.examples.helloworld.HelloResponse> METHOD_SAY_HELLO = io.grpc.examples.helloworld.HelloReply> METHOD_SAY_HELLO =
io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY, io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName( generateFullMethodName(
"helloworld.Greeter", "SayHello"), "helloworld.Greeter", "SayHello"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloResponse.getDefaultInstance())); io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloReply.getDefaultInstance()));
public static GreeterStub newStub(io.grpc.Channel channel) { public static GreeterStub newStub(io.grpc.Channel channel) {
return new GreeterStub(channel); return new GreeterStub(channel);
@ -48,17 +48,17 @@ public class GreeterGrpc {
public static interface Greeter { public static interface Greeter {
public void sayHello(io.grpc.examples.helloworld.HelloRequest request, public void sayHello(io.grpc.examples.helloworld.HelloRequest request,
io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloResponse> responseObserver); io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply> responseObserver);
} }
public static interface GreeterBlockingClient { public static interface GreeterBlockingClient {
public io.grpc.examples.helloworld.HelloResponse sayHello(io.grpc.examples.helloworld.HelloRequest request); public io.grpc.examples.helloworld.HelloReply sayHello(io.grpc.examples.helloworld.HelloRequest request);
} }
public static interface GreeterFutureClient { public static interface GreeterFutureClient {
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.helloworld.HelloResponse> sayHello( public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.helloworld.HelloReply> sayHello(
io.grpc.examples.helloworld.HelloRequest request); io.grpc.examples.helloworld.HelloRequest request);
} }
@ -81,7 +81,7 @@ public class GreeterGrpc {
@java.lang.Override @java.lang.Override
public void sayHello(io.grpc.examples.helloworld.HelloRequest request, public void sayHello(io.grpc.examples.helloworld.HelloRequest request,
io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloResponse> responseObserver) { io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply> responseObserver) {
asyncUnaryCall( asyncUnaryCall(
getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request, responseObserver); getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request, responseObserver);
} }
@ -105,7 +105,7 @@ public class GreeterGrpc {
} }
@java.lang.Override @java.lang.Override
public io.grpc.examples.helloworld.HelloResponse sayHello(io.grpc.examples.helloworld.HelloRequest request) { public io.grpc.examples.helloworld.HelloReply sayHello(io.grpc.examples.helloworld.HelloRequest request) {
return blockingUnaryCall( return blockingUnaryCall(
getChannel(), METHOD_SAY_HELLO, getCallOptions(), request); getChannel(), METHOD_SAY_HELLO, getCallOptions(), request);
} }
@ -129,7 +129,7 @@ public class GreeterGrpc {
} }
@java.lang.Override @java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.helloworld.HelloResponse> sayHello( public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.helloworld.HelloReply> sayHello(
io.grpc.examples.helloworld.HelloRequest request) { io.grpc.examples.helloworld.HelloRequest request) {
return futureUnaryCall( return futureUnaryCall(
getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request); getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request);
@ -156,7 +156,7 @@ public class GreeterGrpc {
switch (methodId) { switch (methodId) {
case METHODID_SAY_HELLO: case METHODID_SAY_HELLO:
serviceImpl.sayHello((io.grpc.examples.helloworld.HelloRequest) request, serviceImpl.sayHello((io.grpc.examples.helloworld.HelloRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloResponse>) responseObserver); (io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply>) responseObserver);
break; break;
default: default:
throw new AssertionError(); throw new AssertionError();
@ -181,7 +181,7 @@ public class GreeterGrpc {
asyncUnaryCall( asyncUnaryCall(
new MethodHandlers< new MethodHandlers<
io.grpc.examples.helloworld.HelloRequest, io.grpc.examples.helloworld.HelloRequest,
io.grpc.examples.helloworld.HelloResponse>( io.grpc.examples.helloworld.HelloReply>(
serviceImpl, METHODID_SAY_HELLO))) serviceImpl, METHODID_SAY_HELLO)))
.build(); .build();
} }

View File

@ -1,24 +1,24 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: hello_world.proto // source: helloworld.proto
package io.grpc.examples.helloworld; package io.grpc.examples.helloworld;
/** /**
* Protobuf type {@code helloworld.HelloResponse} * Protobuf type {@code helloworld.HelloReply}
* *
* <pre> * <pre>
* The response message containing the greetings * The response message containing the greetings
* </pre> * </pre>
*/ */
public final class HelloResponse extends public final class HelloReply extends
com.google.protobuf.GeneratedMessage implements com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:helloworld.HelloResponse) // @@protoc_insertion_point(message_implements:helloworld.HelloReply)
HelloResponseOrBuilder { HelloReplyOrBuilder {
// Use HelloResponse.newBuilder() to construct. // Use HelloReply.newBuilder() to construct.
private HelloResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) { private HelloReply(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder); super(builder);
} }
private HelloResponse() { private HelloReply() {
message_ = ""; message_ = "";
} }
@ -27,7 +27,7 @@ public final class HelloResponse extends
getUnknownFields() { getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
} }
private HelloResponse( private HelloReply(
com.google.protobuf.CodedInputStream input, com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) { com.google.protobuf.ExtensionRegistryLite extensionRegistry) {
this(); this();
@ -66,14 +66,14 @@ public final class HelloResponse extends
} }
public static final com.google.protobuf.Descriptors.Descriptor public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() { getDescriptor() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloResponse_descriptor; return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloReply_descriptor;
} }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() { internalGetFieldAccessorTable() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloResponse_fieldAccessorTable return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloReply_fieldAccessorTable
.ensureFieldAccessorsInitialized( .ensureFieldAccessorsInitialized(
io.grpc.examples.helloworld.HelloResponse.class, io.grpc.examples.helloworld.HelloResponse.Builder.class); io.grpc.examples.helloworld.HelloReply.class, io.grpc.examples.helloworld.HelloReply.Builder.class);
} }
public static final int MESSAGE_FIELD_NUMBER = 1; public static final int MESSAGE_FIELD_NUMBER = 1;
@ -140,53 +140,53 @@ public final class HelloResponse extends
} }
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;
public static io.grpc.examples.helloworld.HelloResponse parseFrom( public static io.grpc.examples.helloworld.HelloReply parseFrom(
com.google.protobuf.ByteString data) com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data); return PARSER.parseFrom(data);
} }
public static io.grpc.examples.helloworld.HelloResponse parseFrom( public static io.grpc.examples.helloworld.HelloReply parseFrom(
com.google.protobuf.ByteString data, com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry); return PARSER.parseFrom(data, extensionRegistry);
} }
public static io.grpc.examples.helloworld.HelloResponse parseFrom(byte[] data) public static io.grpc.examples.helloworld.HelloReply parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data); return PARSER.parseFrom(data);
} }
public static io.grpc.examples.helloworld.HelloResponse parseFrom( public static io.grpc.examples.helloworld.HelloReply parseFrom(
byte[] data, byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry); return PARSER.parseFrom(data, extensionRegistry);
} }
public static io.grpc.examples.helloworld.HelloResponse parseFrom(java.io.InputStream input) public static io.grpc.examples.helloworld.HelloReply parseFrom(java.io.InputStream input)
throws java.io.IOException { throws java.io.IOException {
return PARSER.parseFrom(input); return PARSER.parseFrom(input);
} }
public static io.grpc.examples.helloworld.HelloResponse parseFrom( public static io.grpc.examples.helloworld.HelloReply parseFrom(
java.io.InputStream input, java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry); return PARSER.parseFrom(input, extensionRegistry);
} }
public static io.grpc.examples.helloworld.HelloResponse parseDelimitedFrom(java.io.InputStream input) public static io.grpc.examples.helloworld.HelloReply parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException { throws java.io.IOException {
return PARSER.parseDelimitedFrom(input); return PARSER.parseDelimitedFrom(input);
} }
public static io.grpc.examples.helloworld.HelloResponse parseDelimitedFrom( public static io.grpc.examples.helloworld.HelloReply parseDelimitedFrom(
java.io.InputStream input, java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry); return PARSER.parseDelimitedFrom(input, extensionRegistry);
} }
public static io.grpc.examples.helloworld.HelloResponse parseFrom( public static io.grpc.examples.helloworld.HelloReply parseFrom(
com.google.protobuf.CodedInputStream input) com.google.protobuf.CodedInputStream input)
throws java.io.IOException { throws java.io.IOException {
return PARSER.parseFrom(input); return PARSER.parseFrom(input);
} }
public static io.grpc.examples.helloworld.HelloResponse parseFrom( public static io.grpc.examples.helloworld.HelloReply parseFrom(
com.google.protobuf.CodedInputStream input, com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
@ -197,7 +197,7 @@ public final class HelloResponse extends
public static Builder newBuilder() { public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder(); return DEFAULT_INSTANCE.toBuilder();
} }
public static Builder newBuilder(io.grpc.examples.helloworld.HelloResponse prototype) { public static Builder newBuilder(io.grpc.examples.helloworld.HelloReply prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
} }
public Builder toBuilder() { public Builder toBuilder() {
@ -212,7 +212,7 @@ public final class HelloResponse extends
return builder; return builder;
} }
/** /**
* Protobuf type {@code helloworld.HelloResponse} * Protobuf type {@code helloworld.HelloReply}
* *
* <pre> * <pre>
* The response message containing the greetings * The response message containing the greetings
@ -220,21 +220,21 @@ public final class HelloResponse extends
*/ */
public static final class Builder extends public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:helloworld.HelloResponse) // @@protoc_insertion_point(builder_implements:helloworld.HelloReply)
io.grpc.examples.helloworld.HelloResponseOrBuilder { io.grpc.examples.helloworld.HelloReplyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() { getDescriptor() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloResponse_descriptor; return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloReply_descriptor;
} }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() { internalGetFieldAccessorTable() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloResponse_fieldAccessorTable return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloReply_fieldAccessorTable
.ensureFieldAccessorsInitialized( .ensureFieldAccessorsInitialized(
io.grpc.examples.helloworld.HelloResponse.class, io.grpc.examples.helloworld.HelloResponse.Builder.class); io.grpc.examples.helloworld.HelloReply.class, io.grpc.examples.helloworld.HelloReply.Builder.class);
} }
// Construct using io.grpc.examples.helloworld.HelloResponse.newBuilder() // Construct using io.grpc.examples.helloworld.HelloReply.newBuilder()
private Builder() { private Builder() {
maybeForceBuilderInitialization(); maybeForceBuilderInitialization();
} }
@ -257,39 +257,39 @@ public final class HelloResponse extends
public com.google.protobuf.Descriptors.Descriptor public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() { getDescriptorForType() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloResponse_descriptor; return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloReply_descriptor;
} }
public io.grpc.examples.helloworld.HelloResponse getDefaultInstanceForType() { public io.grpc.examples.helloworld.HelloReply getDefaultInstanceForType() {
return io.grpc.examples.helloworld.HelloResponse.getDefaultInstance(); return io.grpc.examples.helloworld.HelloReply.getDefaultInstance();
} }
public io.grpc.examples.helloworld.HelloResponse build() { public io.grpc.examples.helloworld.HelloReply build() {
io.grpc.examples.helloworld.HelloResponse result = buildPartial(); io.grpc.examples.helloworld.HelloReply result = buildPartial();
if (!result.isInitialized()) { if (!result.isInitialized()) {
throw newUninitializedMessageException(result); throw newUninitializedMessageException(result);
} }
return result; return result;
} }
public io.grpc.examples.helloworld.HelloResponse buildPartial() { public io.grpc.examples.helloworld.HelloReply buildPartial() {
io.grpc.examples.helloworld.HelloResponse result = new io.grpc.examples.helloworld.HelloResponse(this); io.grpc.examples.helloworld.HelloReply result = new io.grpc.examples.helloworld.HelloReply(this);
result.message_ = message_; result.message_ = message_;
onBuilt(); onBuilt();
return result; return result;
} }
public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.helloworld.HelloResponse) { if (other instanceof io.grpc.examples.helloworld.HelloReply) {
return mergeFrom((io.grpc.examples.helloworld.HelloResponse)other); return mergeFrom((io.grpc.examples.helloworld.HelloReply)other);
} else { } else {
super.mergeFrom(other); super.mergeFrom(other);
return this; return this;
} }
} }
public Builder mergeFrom(io.grpc.examples.helloworld.HelloResponse other) { public Builder mergeFrom(io.grpc.examples.helloworld.HelloReply other) {
if (other == io.grpc.examples.helloworld.HelloResponse.getDefaultInstance()) return this; if (other == io.grpc.examples.helloworld.HelloReply.getDefaultInstance()) return this;
if (!other.getMessage().isEmpty()) { if (!other.getMessage().isEmpty()) {
message_ = other.message_; message_ = other.message_;
onChanged(); onChanged();
@ -306,11 +306,11 @@ public final class HelloResponse extends
com.google.protobuf.CodedInputStream input, com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
io.grpc.examples.helloworld.HelloResponse parsedMessage = null; io.grpc.examples.helloworld.HelloReply parsedMessage = null;
try { try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) { } catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.helloworld.HelloResponse) e.getUnfinishedMessage(); parsedMessage = (io.grpc.examples.helloworld.HelloReply) e.getUnfinishedMessage();
throw e; throw e;
} finally { } finally {
if (parsedMessage != null) { if (parsedMessage != null) {
@ -399,27 +399,27 @@ public final class HelloResponse extends
} }
// @@protoc_insertion_point(builder_scope:helloworld.HelloResponse) // @@protoc_insertion_point(builder_scope:helloworld.HelloReply)
} }
// @@protoc_insertion_point(class_scope:helloworld.HelloResponse) // @@protoc_insertion_point(class_scope:helloworld.HelloReply)
private static final io.grpc.examples.helloworld.HelloResponse DEFAULT_INSTANCE; private static final io.grpc.examples.helloworld.HelloReply DEFAULT_INSTANCE;
static { static {
DEFAULT_INSTANCE = new io.grpc.examples.helloworld.HelloResponse(); DEFAULT_INSTANCE = new io.grpc.examples.helloworld.HelloReply();
} }
public static io.grpc.examples.helloworld.HelloResponse getDefaultInstance() { public static io.grpc.examples.helloworld.HelloReply getDefaultInstance() {
return DEFAULT_INSTANCE; return DEFAULT_INSTANCE;
} }
private static final com.google.protobuf.Parser<HelloResponse> private static final com.google.protobuf.Parser<HelloReply>
PARSER = new com.google.protobuf.AbstractParser<HelloResponse>() { PARSER = new com.google.protobuf.AbstractParser<HelloReply>() {
public HelloResponse parsePartialFrom( public HelloReply parsePartialFrom(
com.google.protobuf.CodedInputStream input, com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
try { try {
return new HelloResponse(input, extensionRegistry); return new HelloReply(input, extensionRegistry);
} catch (RuntimeException e) { } catch (RuntimeException e) {
if (e.getCause() instanceof if (e.getCause() instanceof
com.google.protobuf.InvalidProtocolBufferException) { com.google.protobuf.InvalidProtocolBufferException) {
@ -431,16 +431,16 @@ public final class HelloResponse extends
} }
}; };
public static com.google.protobuf.Parser<HelloResponse> parser() { public static com.google.protobuf.Parser<HelloReply> parser() {
return PARSER; return PARSER;
} }
@java.lang.Override @java.lang.Override
public com.google.protobuf.Parser<HelloResponse> getParserForType() { public com.google.protobuf.Parser<HelloReply> getParserForType() {
return PARSER; return PARSER;
} }
public io.grpc.examples.helloworld.HelloResponse getDefaultInstanceForType() { public io.grpc.examples.helloworld.HelloReply getDefaultInstanceForType() {
return DEFAULT_INSTANCE; return DEFAULT_INSTANCE;
} }

View File

@ -1,10 +1,10 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: hello_world.proto // source: helloworld.proto
package io.grpc.examples.helloworld; package io.grpc.examples.helloworld;
public interface HelloResponseOrBuilder extends public interface HelloReplyOrBuilder extends
// @@protoc_insertion_point(interface_extends:helloworld.HelloResponse) // @@protoc_insertion_point(interface_extends:helloworld.HelloReply)
com.google.protobuf.MessageOrBuilder { com.google.protobuf.MessageOrBuilder {
/** /**

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: hello_world.proto // source: helloworld.proto
package io.grpc.examples.helloworld; package io.grpc.examples.helloworld;
@ -66,12 +66,12 @@ public final class HelloRequest extends
} }
public static final com.google.protobuf.Descriptors.Descriptor public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() { getDescriptor() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_descriptor; return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloRequest_descriptor;
} }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() { internalGetFieldAccessorTable() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_fieldAccessorTable return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized( .ensureFieldAccessorsInitialized(
io.grpc.examples.helloworld.HelloRequest.class, io.grpc.examples.helloworld.HelloRequest.Builder.class); io.grpc.examples.helloworld.HelloRequest.class, io.grpc.examples.helloworld.HelloRequest.Builder.class);
} }
@ -224,12 +224,12 @@ public final class HelloRequest extends
io.grpc.examples.helloworld.HelloRequestOrBuilder { io.grpc.examples.helloworld.HelloRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() { getDescriptor() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_descriptor; return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloRequest_descriptor;
} }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() { internalGetFieldAccessorTable() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_fieldAccessorTable return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized( .ensureFieldAccessorsInitialized(
io.grpc.examples.helloworld.HelloRequest.class, io.grpc.examples.helloworld.HelloRequest.Builder.class); io.grpc.examples.helloworld.HelloRequest.class, io.grpc.examples.helloworld.HelloRequest.Builder.class);
} }
@ -257,7 +257,7 @@ public final class HelloRequest extends
public com.google.protobuf.Descriptors.Descriptor public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() { getDescriptorForType() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_descriptor; return io.grpc.examples.helloworld.HelloWorld.internal_static_helloworld_HelloRequest_descriptor;
} }
public io.grpc.examples.helloworld.HelloRequest getDefaultInstanceForType() { public io.grpc.examples.helloworld.HelloRequest getDefaultInstanceForType() {

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: hello_world.proto // source: helloworld.proto
package io.grpc.examples.helloworld; package io.grpc.examples.helloworld;

View File

@ -1,10 +1,10 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: hello_world.proto // source: helloworld.proto
package io.grpc.examples.helloworld; package io.grpc.examples.helloworld;
public final class HelloWorldProto { public final class HelloWorld {
private HelloWorldProto() {} private HelloWorld() {}
public static void registerAllExtensions( public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) { com.google.protobuf.ExtensionRegistry registry) {
} }
@ -14,10 +14,10 @@ public final class HelloWorldProto {
com.google.protobuf.GeneratedMessage.FieldAccessorTable com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_helloworld_HelloRequest_fieldAccessorTable; internal_static_helloworld_HelloRequest_fieldAccessorTable;
static com.google.protobuf.Descriptors.Descriptor static com.google.protobuf.Descriptors.Descriptor
internal_static_helloworld_HelloResponse_descriptor; internal_static_helloworld_HelloReply_descriptor;
static static
com.google.protobuf.GeneratedMessage.FieldAccessorTable com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_helloworld_HelloResponse_fieldAccessorTable; internal_static_helloworld_HelloReply_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() { getDescriptor() {
@ -27,12 +27,12 @@ public final class HelloWorldProto {
descriptor; descriptor;
static { static {
java.lang.String[] descriptorData = { java.lang.String[] descriptorData = {
"\n\021hello_world.proto\022\nhelloworld\"\034\n\014Hello" + "\n\020helloworld.proto\022\nhelloworld\"\034\n\014HelloR" +
"Request\022\014\n\004name\030\001 \001(\t\" \n\rHelloResponse\022\017" + "equest\022\014\n\004name\030\001 \001(\t\"\035\n\nHelloReply\022\017\n\007me" +
"\n\007message\030\001 \001(\t2L\n\007Greeter\022A\n\010SayHello\022\030" + "ssage\030\001 \001(\t2I\n\007Greeter\022>\n\010SayHello\022\030.hel" +
".helloworld.HelloRequest\032\031.helloworld.He" + "loworld.HelloRequest\032\026.helloworld.HelloR" +
"lloResponse\"\000B0\n\033io.grpc.examples.hellow" + "eply\"\000B1\n\033io.grpc.examples.helloworldB\nH" +
"orldB\017HelloWorldProtoP\001b\006proto3" "elloWorldP\001\242\002\003HLWb\006proto3"
}; };
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@ -52,11 +52,11 @@ public final class HelloWorldProto {
com.google.protobuf.GeneratedMessage.FieldAccessorTable( com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_helloworld_HelloRequest_descriptor, internal_static_helloworld_HelloRequest_descriptor,
new java.lang.String[] { "Name", }); new java.lang.String[] { "Name", });
internal_static_helloworld_HelloResponse_descriptor = internal_static_helloworld_HelloReply_descriptor =
getDescriptor().getMessageTypes().get(1); getDescriptor().getMessageTypes().get(1);
internal_static_helloworld_HelloResponse_fieldAccessorTable = new internal_static_helloworld_HelloReply_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable( com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_helloworld_HelloResponse_descriptor, internal_static_helloworld_HelloReply_descriptor,
new java.lang.String[] { "Message", }); new java.lang.String[] { "Message", });
} }

View File

@ -41,8 +41,8 @@ import io.grpc.ManagedChannelBuilder;
import io.grpc.Metadata; import io.grpc.Metadata;
import io.grpc.Status; import io.grpc.Status;
import io.grpc.examples.helloworld.GreeterGrpc; import io.grpc.examples.helloworld.GreeterGrpc;
import io.grpc.examples.helloworld.HelloReply;
import io.grpc.examples.helloworld.HelloRequest; import io.grpc.examples.helloworld.HelloRequest;
import io.grpc.examples.helloworld.HelloResponse;
import io.grpc.internal.GrpcUtil; import io.grpc.internal.GrpcUtil;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
@ -75,12 +75,12 @@ public class CompressingHelloWorldClient {
/** Say hello to server. */ /** Say hello to server. */
public void greet(final String name) { public void greet(final String name) {
final ClientCall<HelloRequest, HelloResponse> call = final ClientCall<HelloRequest, HelloReply> call =
channel.newCall(GreeterGrpc.METHOD_SAY_HELLO, CallOptions.DEFAULT); channel.newCall(GreeterGrpc.METHOD_SAY_HELLO, CallOptions.DEFAULT);
final CountDownLatch latch = new CountDownLatch(1); final CountDownLatch latch = new CountDownLatch(1);
call.start(new Listener<HelloResponse>() { call.start(new Listener<HelloReply>() {
@Override @Override
public void onHeaders(Metadata headers) { public void onHeaders(Metadata headers) {
super.onHeaders(headers); super.onHeaders(headers);
@ -91,7 +91,7 @@ public class CompressingHelloWorldClient {
} }
@Override @Override
public void onMessage(HelloResponse message) { public void onMessage(HelloReply message) {
super.onMessage(message); super.onMessage(message);
logger.info("Greeting: " + message.getMessage()); logger.info("Greeting: " + message.getMessage());
latch.countDown(); latch.countDown();

View File

@ -38,8 +38,8 @@ import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder; import io.grpc.ManagedChannelBuilder;
import io.grpc.StatusRuntimeException; import io.grpc.StatusRuntimeException;
import io.grpc.examples.helloworld.GreeterGrpc; import io.grpc.examples.helloworld.GreeterGrpc;
import io.grpc.examples.helloworld.HelloReply;
import io.grpc.examples.helloworld.HelloRequest; import io.grpc.examples.helloworld.HelloRequest;
import io.grpc.examples.helloworld.HelloResponse;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.logging.Level; import java.util.logging.Level;
@ -77,7 +77,7 @@ public class CustomHeaderClient {
private void greet(String name) { private void greet(String name) {
logger.info("Will try to greet " + name + " ..."); logger.info("Will try to greet " + name + " ...");
HelloRequest request = HelloRequest.newBuilder().setName(name).build(); HelloRequest request = HelloRequest.newBuilder().setName(name).build();
HelloResponse response; HelloReply response;
try { try {
response = blockingStub.sayHello(request); response = blockingStub.sayHello(request);
} catch (StatusRuntimeException e) { } catch (StatusRuntimeException e) {

View File

@ -35,8 +35,8 @@ import io.grpc.Server;
import io.grpc.ServerBuilder; import io.grpc.ServerBuilder;
import io.grpc.ServerInterceptors; import io.grpc.ServerInterceptors;
import io.grpc.examples.helloworld.GreeterGrpc; import io.grpc.examples.helloworld.GreeterGrpc;
import io.grpc.examples.helloworld.HelloReply;
import io.grpc.examples.helloworld.HelloRequest; import io.grpc.examples.helloworld.HelloRequest;
import io.grpc.examples.helloworld.HelloResponse;
import io.grpc.stub.StreamObserver; import io.grpc.stub.StreamObserver;
import java.io.IOException; import java.io.IOException;
@ -98,8 +98,8 @@ public class CustomHeaderServer {
private class GreeterImpl implements GreeterGrpc.Greeter { private class GreeterImpl implements GreeterGrpc.Greeter {
@Override @Override
public void sayHello(HelloRequest req, StreamObserver<HelloResponse> responseObserver) { public void sayHello(HelloRequest req, StreamObserver<HelloReply> responseObserver) {
HelloResponse reply = HelloResponse.newBuilder().setMessage("Hello " + req.getName()).build(); HelloReply reply = HelloReply.newBuilder().setMessage("Hello " + req.getName()).build();
responseObserver.onNext(reply); responseObserver.onNext(reply);
responseObserver.onCompleted(); responseObserver.onCompleted();
} }

View File

@ -64,7 +64,7 @@ public class HelloWorldClient {
public void greet(String name) { public void greet(String name) {
logger.info("Will try to greet " + name + " ..."); logger.info("Will try to greet " + name + " ...");
HelloRequest request = HelloRequest.newBuilder().setName(name).build(); HelloRequest request = HelloRequest.newBuilder().setName(name).build();
HelloResponse response; HelloReply response;
try { try {
response = blockingStub.sayHello(request); response = blockingStub.sayHello(request);
} catch (StatusRuntimeException e) { } catch (StatusRuntimeException e) {

View File

@ -92,8 +92,8 @@ public class HelloWorldServer {
private class GreeterImpl implements GreeterGrpc.Greeter { private class GreeterImpl implements GreeterGrpc.Greeter {
@Override @Override
public void sayHello(HelloRequest req, StreamObserver<HelloResponse> responseObserver) { public void sayHello(HelloRequest req, StreamObserver<HelloReply> responseObserver) {
HelloResponse reply = HelloResponse.newBuilder().setMessage("Hello " + req.getName()).build(); HelloReply reply = HelloReply.newBuilder().setMessage("Hello " + req.getName()).build();
responseObserver.onNext(reply); responseObserver.onNext(reply);
responseObserver.onCompleted(); responseObserver.onCompleted();
} }

View File

@ -29,16 +29,17 @@
syntax = "proto3"; syntax = "proto3";
package helloworld;
option java_multiple_files = true; option java_multiple_files = true;
option java_package = "io.grpc.examples.helloworld"; option java_package = "io.grpc.examples.helloworld";
option java_outer_classname = "HelloWorldProto"; option java_outer_classname = "HelloWorld";
option objc_class_prefix = "HLW";
package helloworld;
// The greeting service definition. // The greeting service definition.
service Greeter { service Greeter {
// Sends a greeting // Sends a greeting
rpc SayHello (HelloRequest) returns (HelloResponse) {} rpc SayHello (HelloRequest) returns (HelloReply) {}
} }
// The request message containing the user's name. // The request message containing the user's name.
@ -47,6 +48,6 @@ message HelloRequest {
} }
// The response message containing the greetings // The response message containing the greetings
message HelloResponse { message HelloReply {
string message = 1; string message = 1;
} }