diff --git a/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java b/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java index 295a747fc9..4a4f9fba78 100644 --- a/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java @@ -59,6 +59,38 @@ public final class HealthGrpc { return getCheckMethod; } + private static volatile io.grpc.MethodDescriptor getWatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Watch", + requestType = io.grpc.health.v1.HealthCheckRequest.class, + responseType = io.grpc.health.v1.HealthCheckResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getWatchMethod() { + io.grpc.MethodDescriptor getWatchMethod; + if ((getWatchMethod = HealthGrpc.getWatchMethod) == null) { + synchronized (HealthGrpc.class) { + if ((getWatchMethod = HealthGrpc.getWatchMethod) == null) { + HealthGrpc.getWatchMethod = getWatchMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "grpc.health.v1.Health", "Watch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.health.v1.HealthCheckRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grpc.health.v1.HealthCheckResponse.getDefaultInstance())) + .setSchemaDescriptor(new HealthMethodDescriptorSupplier("Watch")) + .build(); + } + } + } + return getWatchMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -87,12 +119,38 @@ public final class HealthGrpc { public static abstract class HealthImplBase implements io.grpc.BindableService { /** + *
+     * If the requested service is unknown, the call will fail with status
+     * NOT_FOUND.
+     * 
*/ public void check(io.grpc.health.v1.HealthCheckRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCheckMethod(), responseObserver); } + /** + *
+     * Performs a watch for the serving status of the requested service.
+     * The server will immediately send back a message indicating the current
+     * serving status.  It will then subsequently send a new message whenever
+     * the service's serving status changes.
+     * If the requested service is unknown when the call is received, the
+     * server will send a message setting the serving status to
+     * SERVICE_UNKNOWN but will *not* terminate the call.  If at some
+     * future point, the serving status of the service becomes known, the
+     * server will send a new message with the service's serving status.
+     * If the call terminates with status UNIMPLEMENTED, then clients
+     * should assume this method is not supported and should not retry the
+     * call.  If the call terminates with any other status (including OK),
+     * clients should retry the call with appropriate exponential backoff.
+     * 
+ */ + public void watch(io.grpc.health.v1.HealthCheckRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getWatchMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -102,6 +160,13 @@ public final class HealthGrpc { io.grpc.health.v1.HealthCheckRequest, io.grpc.health.v1.HealthCheckResponse>( this, METHODID_CHECK))) + .addMethod( + getWatchMethod(), + asyncServerStreamingCall( + new MethodHandlers< + io.grpc.health.v1.HealthCheckRequest, + io.grpc.health.v1.HealthCheckResponse>( + this, METHODID_WATCH))) .build(); } } @@ -125,12 +190,39 @@ public final class HealthGrpc { } /** + *
+     * If the requested service is unknown, the call will fail with status
+     * NOT_FOUND.
+     * 
*/ public void check(io.grpc.health.v1.HealthCheckRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getCheckMethod(), getCallOptions()), request, responseObserver); } + + /** + *
+     * Performs a watch for the serving status of the requested service.
+     * The server will immediately send back a message indicating the current
+     * serving status.  It will then subsequently send a new message whenever
+     * the service's serving status changes.
+     * If the requested service is unknown when the call is received, the
+     * server will send a message setting the serving status to
+     * SERVICE_UNKNOWN but will *not* terminate the call.  If at some
+     * future point, the serving status of the service becomes known, the
+     * server will send a new message with the service's serving status.
+     * If the call terminates with status UNIMPLEMENTED, then clients
+     * should assume this method is not supported and should not retry the
+     * call.  If the call terminates with any other status (including OK),
+     * clients should retry the call with appropriate exponential backoff.
+     * 
+ */ + public void watch(io.grpc.health.v1.HealthCheckRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getWatchMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -152,11 +244,38 @@ public final class HealthGrpc { } /** + *
+     * If the requested service is unknown, the call will fail with status
+     * NOT_FOUND.
+     * 
*/ public io.grpc.health.v1.HealthCheckResponse check(io.grpc.health.v1.HealthCheckRequest request) { return blockingUnaryCall( getChannel(), getCheckMethod(), getCallOptions(), request); } + + /** + *
+     * Performs a watch for the serving status of the requested service.
+     * The server will immediately send back a message indicating the current
+     * serving status.  It will then subsequently send a new message whenever
+     * the service's serving status changes.
+     * If the requested service is unknown when the call is received, the
+     * server will send a message setting the serving status to
+     * SERVICE_UNKNOWN but will *not* terminate the call.  If at some
+     * future point, the serving status of the service becomes known, the
+     * server will send a new message with the service's serving status.
+     * If the call terminates with status UNIMPLEMENTED, then clients
+     * should assume this method is not supported and should not retry the
+     * call.  If the call terminates with any other status (including OK),
+     * clients should retry the call with appropriate exponential backoff.
+     * 
+ */ + public java.util.Iterator watch( + io.grpc.health.v1.HealthCheckRequest request) { + return blockingServerStreamingCall( + getChannel(), getWatchMethod(), getCallOptions(), request); + } } /** @@ -178,6 +297,10 @@ public final class HealthGrpc { } /** + *
+     * If the requested service is unknown, the call will fail with status
+     * NOT_FOUND.
+     * 
*/ public com.google.common.util.concurrent.ListenableFuture check( io.grpc.health.v1.HealthCheckRequest request) { @@ -187,6 +310,7 @@ public final class HealthGrpc { } private static final int METHODID_CHECK = 0; + private static final int METHODID_WATCH = 1; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -209,6 +333,10 @@ public final class HealthGrpc { serviceImpl.check((io.grpc.health.v1.HealthCheckRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_WATCH: + serviceImpl.watch((io.grpc.health.v1.HealthCheckRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -271,6 +399,7 @@ public final class HealthGrpc { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new HealthFileDescriptorSupplier()) .addMethod(getCheckMethod()) + .addMethod(getWatchMethod()) .build(); } } diff --git a/services/src/generated/main/java/io/grpc/health/v1/HealthCheckResponse.java b/services/src/generated/main/java/io/grpc/health/v1/HealthCheckResponse.java index efe312cad9..cfb969b493 100644 --- a/services/src/generated/main/java/io/grpc/health/v1/HealthCheckResponse.java +++ b/services/src/generated/main/java/io/grpc/health/v1/HealthCheckResponse.java @@ -97,6 +97,14 @@ private static final long serialVersionUID = 0L; * NOT_SERVING = 2; */ NOT_SERVING(2), + /** + *
+     * Used only by the Watch method.
+     * 
+ * + * SERVICE_UNKNOWN = 3; + */ + SERVICE_UNKNOWN(3), UNRECOGNIZED(-1), ; @@ -112,6 +120,14 @@ private static final long serialVersionUID = 0L; * NOT_SERVING = 2; */ public static final int NOT_SERVING_VALUE = 2; + /** + *
+     * Used only by the Watch method.
+     * 
+ * + * SERVICE_UNKNOWN = 3; + */ + public static final int SERVICE_UNKNOWN_VALUE = 3; public final int getNumber() { @@ -135,6 +151,7 @@ private static final long serialVersionUID = 0L; case 0: return UNKNOWN; case 1: return SERVING; case 2: return NOT_SERVING; + case 3: return SERVICE_UNKNOWN; default: return null; } } diff --git a/services/src/generated/main/java/io/grpc/health/v1/HealthProto.java b/services/src/generated/main/java/io/grpc/health/v1/HealthProto.java index ce0d1bde10..8329cbea52 100644 --- a/services/src/generated/main/java/io/grpc/health/v1/HealthProto.java +++ b/services/src/generated/main/java/io/grpc/health/v1/HealthProto.java @@ -35,14 +35,18 @@ public final class HealthProto { java.lang.String[] descriptorData = { "\n\033grpc/health/v1/health.proto\022\016grpc.heal" + "th.v1\"%\n\022HealthCheckRequest\022\017\n\007service\030\001" + - " \001(\t\"\224\001\n\023HealthCheckResponse\022A\n\006status\030\001" + + " \001(\t\"\251\001\n\023HealthCheckResponse\022A\n\006status\030\001" + " \001(\01621.grpc.health.v1.HealthCheckRespons" + - "e.ServingStatus\":\n\rServingStatus\022\013\n\007UNKN" + - "OWN\020\000\022\013\n\007SERVING\020\001\022\017\n\013NOT_SERVING\020\0022Z\n\006H" + - "ealth\022P\n\005Check\022\".grpc.health.v1.HealthCh" + - "eckRequest\032#.grpc.health.v1.HealthCheckR" + - "esponseB3\n\021io.grpc.health.v1B\013HealthProt" + - "oP\001\252\002\016Grpc.Health.V1b\006proto3" + "e.ServingStatus\"O\n\rServingStatus\022\013\n\007UNKN" + + "OWN\020\000\022\013\n\007SERVING\020\001\022\017\n\013NOT_SERVING\020\002\022\023\n\017S" + + "ERVICE_UNKNOWN\020\0032\256\001\n\006Health\022P\n\005Check\022\".g" + + "rpc.health.v1.HealthCheckRequest\032#.grpc." + + "health.v1.HealthCheckResponse\022R\n\005Watch\022\"" + + ".grpc.health.v1.HealthCheckRequest\032#.grp" + + "c.health.v1.HealthCheckResponse0\001Ba\n\021io." + + "grpc.health.v1B\013HealthProtoP\001Z,google.go" + + "lang.org/grpc/health/grpc_health_v1\252\002\016Gr" + + "pc.Health.V1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/services/src/main/proto/grpc/health/v1/health.proto b/services/src/main/proto/grpc/health/v1/health.proto index 44c443230d..38843ff1e7 100644 --- a/services/src/main/proto/grpc/health/v1/health.proto +++ b/services/src/main/proto/grpc/health/v1/health.proto @@ -12,11 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +// The canonical version of this proto can be found at +// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto + syntax = "proto3"; package grpc.health.v1; option csharp_namespace = "Grpc.Health.V1"; +option go_package = "google.golang.org/grpc/health/grpc_health_v1"; option java_multiple_files = true; option java_outer_classname = "HealthProto"; option java_package = "io.grpc.health.v1"; @@ -30,10 +34,30 @@ message HealthCheckResponse { UNKNOWN = 0; SERVING = 1; NOT_SERVING = 2; + SERVICE_UNKNOWN = 3; // Used only by the Watch method. } ServingStatus status = 1; } service Health { + // If the requested service is unknown, the call will fail with status + // NOT_FOUND. rpc Check(HealthCheckRequest) returns (HealthCheckResponse); + + // Performs a watch for the serving status of the requested service. + // The server will immediately send back a message indicating the current + // serving status. It will then subsequently send a new message whenever + // the service's serving status changes. + // + // If the requested service is unknown when the call is received, the + // server will send a message setting the serving status to + // SERVICE_UNKNOWN but will *not* terminate the call. If at some + // future point, the serving status of the service becomes known, the + // server will send a new message with the service's serving status. + // + // If the call terminates with status UNIMPLEMENTED, then clients + // should assume this method is not supported and should not retry the + // call. If the call terminates with any other status (including OK), + // clients should retry the call with appropriate exponential backoff. + rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse); }