• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.github.xds.service.orca.v3;
2 
3 import static io.grpc.MethodDescriptor.generateFullMethodName;
4 
5 /**
6  * <pre>
7  * Out-of-band (OOB) load reporting service for the additional load reporting
8  * agent that does not sit in the request path. Reports are periodically sampled
9  * with sufficient frequency to provide temporal association with requests.
10  * OOB reporting compensates the limitation of in-band reporting in revealing
11  * costs for backends that do not provide a steady stream of telemetry such as
12  * long running stream operations and zero QPS services. This is a server
13  * streaming service, client needs to terminate current RPC and initiate
14  * a new call to change backend reporting frequency.
15  * </pre>
16  */
17 @javax.annotation.Generated(
18     value = "by gRPC proto compiler",
19     comments = "Source: xds/service/orca/v3/orca.proto")
20 @io.grpc.stub.annotations.GrpcGenerated
21 public final class OpenRcaServiceGrpc {
22 
OpenRcaServiceGrpc()23   private OpenRcaServiceGrpc() {}
24 
25   public static final String SERVICE_NAME = "xds.service.orca.v3.OpenRcaService";
26 
27   // Static method descriptors that strictly reflect the proto.
28   private static volatile io.grpc.MethodDescriptor<com.github.xds.service.orca.v3.OrcaLoadReportRequest,
29       com.github.xds.data.orca.v3.OrcaLoadReport> getStreamCoreMetricsMethod;
30 
31   @io.grpc.stub.annotations.RpcMethod(
32       fullMethodName = SERVICE_NAME + '/' + "StreamCoreMetrics",
33       requestType = com.github.xds.service.orca.v3.OrcaLoadReportRequest.class,
34       responseType = com.github.xds.data.orca.v3.OrcaLoadReport.class,
35       methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
36   public static io.grpc.MethodDescriptor<com.github.xds.service.orca.v3.OrcaLoadReportRequest,
getStreamCoreMetricsMethod()37       com.github.xds.data.orca.v3.OrcaLoadReport> getStreamCoreMetricsMethod() {
38     io.grpc.MethodDescriptor<com.github.xds.service.orca.v3.OrcaLoadReportRequest, com.github.xds.data.orca.v3.OrcaLoadReport> getStreamCoreMetricsMethod;
39     if ((getStreamCoreMetricsMethod = OpenRcaServiceGrpc.getStreamCoreMetricsMethod) == null) {
40       synchronized (OpenRcaServiceGrpc.class) {
41         if ((getStreamCoreMetricsMethod = OpenRcaServiceGrpc.getStreamCoreMetricsMethod) == null) {
42           OpenRcaServiceGrpc.getStreamCoreMetricsMethod = getStreamCoreMetricsMethod =
43               io.grpc.MethodDescriptor.<com.github.xds.service.orca.v3.OrcaLoadReportRequest, com.github.xds.data.orca.v3.OrcaLoadReport>newBuilder()
44               .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
45               .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamCoreMetrics"))
46               .setSampledToLocalTracing(true)
47               .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
48                   com.github.xds.service.orca.v3.OrcaLoadReportRequest.getDefaultInstance()))
49               .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
50                   com.github.xds.data.orca.v3.OrcaLoadReport.getDefaultInstance()))
51               .setSchemaDescriptor(new OpenRcaServiceMethodDescriptorSupplier("StreamCoreMetrics"))
52               .build();
53         }
54       }
55     }
56     return getStreamCoreMetricsMethod;
57   }
58 
59   /**
60    * Creates a new async stub that supports all call types for the service
61    */
newStub(io.grpc.Channel channel)62   public static OpenRcaServiceStub newStub(io.grpc.Channel channel) {
63     io.grpc.stub.AbstractStub.StubFactory<OpenRcaServiceStub> factory =
64       new io.grpc.stub.AbstractStub.StubFactory<OpenRcaServiceStub>() {
65         @java.lang.Override
66         public OpenRcaServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
67           return new OpenRcaServiceStub(channel, callOptions);
68         }
69       };
70     return OpenRcaServiceStub.newStub(factory, channel);
71   }
72 
73   /**
74    * Creates a new blocking-style stub that supports unary and streaming output calls on the service
75    */
newBlockingStub( io.grpc.Channel channel)76   public static OpenRcaServiceBlockingStub newBlockingStub(
77       io.grpc.Channel channel) {
78     io.grpc.stub.AbstractStub.StubFactory<OpenRcaServiceBlockingStub> factory =
79       new io.grpc.stub.AbstractStub.StubFactory<OpenRcaServiceBlockingStub>() {
80         @java.lang.Override
81         public OpenRcaServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
82           return new OpenRcaServiceBlockingStub(channel, callOptions);
83         }
84       };
85     return OpenRcaServiceBlockingStub.newStub(factory, channel);
86   }
87 
88   /**
89    * Creates a new ListenableFuture-style stub that supports unary calls on the service
90    */
newFutureStub( io.grpc.Channel channel)91   public static OpenRcaServiceFutureStub newFutureStub(
92       io.grpc.Channel channel) {
93     io.grpc.stub.AbstractStub.StubFactory<OpenRcaServiceFutureStub> factory =
94       new io.grpc.stub.AbstractStub.StubFactory<OpenRcaServiceFutureStub>() {
95         @java.lang.Override
96         public OpenRcaServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
97           return new OpenRcaServiceFutureStub(channel, callOptions);
98         }
99       };
100     return OpenRcaServiceFutureStub.newStub(factory, channel);
101   }
102 
103   /**
104    * <pre>
105    * Out-of-band (OOB) load reporting service for the additional load reporting
106    * agent that does not sit in the request path. Reports are periodically sampled
107    * with sufficient frequency to provide temporal association with requests.
108    * OOB reporting compensates the limitation of in-band reporting in revealing
109    * costs for backends that do not provide a steady stream of telemetry such as
110    * long running stream operations and zero QPS services. This is a server
111    * streaming service, client needs to terminate current RPC and initiate
112    * a new call to change backend reporting frequency.
113    * </pre>
114    */
115   public interface AsyncService {
116 
117     /**
118      */
streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportRequest request, io.grpc.stub.StreamObserver<com.github.xds.data.orca.v3.OrcaLoadReport> responseObserver)119     default void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportRequest request,
120         io.grpc.stub.StreamObserver<com.github.xds.data.orca.v3.OrcaLoadReport> responseObserver) {
121       io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamCoreMetricsMethod(), responseObserver);
122     }
123   }
124 
125   /**
126    * Base class for the server implementation of the service OpenRcaService.
127    * <pre>
128    * Out-of-band (OOB) load reporting service for the additional load reporting
129    * agent that does not sit in the request path. Reports are periodically sampled
130    * with sufficient frequency to provide temporal association with requests.
131    * OOB reporting compensates the limitation of in-band reporting in revealing
132    * costs for backends that do not provide a steady stream of telemetry such as
133    * long running stream operations and zero QPS services. This is a server
134    * streaming service, client needs to terminate current RPC and initiate
135    * a new call to change backend reporting frequency.
136    * </pre>
137    */
138   public static abstract class OpenRcaServiceImplBase
139       implements io.grpc.BindableService, AsyncService {
140 
bindService()141     @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
142       return OpenRcaServiceGrpc.bindService(this);
143     }
144   }
145 
146   /**
147    * A stub to allow clients to do asynchronous rpc calls to service OpenRcaService.
148    * <pre>
149    * Out-of-band (OOB) load reporting service for the additional load reporting
150    * agent that does not sit in the request path. Reports are periodically sampled
151    * with sufficient frequency to provide temporal association with requests.
152    * OOB reporting compensates the limitation of in-band reporting in revealing
153    * costs for backends that do not provide a steady stream of telemetry such as
154    * long running stream operations and zero QPS services. This is a server
155    * streaming service, client needs to terminate current RPC and initiate
156    * a new call to change backend reporting frequency.
157    * </pre>
158    */
159   public static final class OpenRcaServiceStub
160       extends io.grpc.stub.AbstractAsyncStub<OpenRcaServiceStub> {
OpenRcaServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions)161     private OpenRcaServiceStub(
162         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
163       super(channel, callOptions);
164     }
165 
166     @java.lang.Override
build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)167     protected OpenRcaServiceStub build(
168         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
169       return new OpenRcaServiceStub(channel, callOptions);
170     }
171 
172     /**
173      */
streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportRequest request, io.grpc.stub.StreamObserver<com.github.xds.data.orca.v3.OrcaLoadReport> responseObserver)174     public void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportRequest request,
175         io.grpc.stub.StreamObserver<com.github.xds.data.orca.v3.OrcaLoadReport> responseObserver) {
176       io.grpc.stub.ClientCalls.asyncServerStreamingCall(
177           getChannel().newCall(getStreamCoreMetricsMethod(), getCallOptions()), request, responseObserver);
178     }
179   }
180 
181   /**
182    * A stub to allow clients to do synchronous rpc calls to service OpenRcaService.
183    * <pre>
184    * Out-of-band (OOB) load reporting service for the additional load reporting
185    * agent that does not sit in the request path. Reports are periodically sampled
186    * with sufficient frequency to provide temporal association with requests.
187    * OOB reporting compensates the limitation of in-band reporting in revealing
188    * costs for backends that do not provide a steady stream of telemetry such as
189    * long running stream operations and zero QPS services. This is a server
190    * streaming service, client needs to terminate current RPC and initiate
191    * a new call to change backend reporting frequency.
192    * </pre>
193    */
194   public static final class OpenRcaServiceBlockingStub
195       extends io.grpc.stub.AbstractBlockingStub<OpenRcaServiceBlockingStub> {
OpenRcaServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions)196     private OpenRcaServiceBlockingStub(
197         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
198       super(channel, callOptions);
199     }
200 
201     @java.lang.Override
build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)202     protected OpenRcaServiceBlockingStub build(
203         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
204       return new OpenRcaServiceBlockingStub(channel, callOptions);
205     }
206 
207     /**
208      */
streamCoreMetrics( com.github.xds.service.orca.v3.OrcaLoadReportRequest request)209     public java.util.Iterator<com.github.xds.data.orca.v3.OrcaLoadReport> streamCoreMetrics(
210         com.github.xds.service.orca.v3.OrcaLoadReportRequest request) {
211       return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
212           getChannel(), getStreamCoreMetricsMethod(), getCallOptions(), request);
213     }
214   }
215 
216   /**
217    * A stub to allow clients to do ListenableFuture-style rpc calls to service OpenRcaService.
218    * <pre>
219    * Out-of-band (OOB) load reporting service for the additional load reporting
220    * agent that does not sit in the request path. Reports are periodically sampled
221    * with sufficient frequency to provide temporal association with requests.
222    * OOB reporting compensates the limitation of in-band reporting in revealing
223    * costs for backends that do not provide a steady stream of telemetry such as
224    * long running stream operations and zero QPS services. This is a server
225    * streaming service, client needs to terminate current RPC and initiate
226    * a new call to change backend reporting frequency.
227    * </pre>
228    */
229   public static final class OpenRcaServiceFutureStub
230       extends io.grpc.stub.AbstractFutureStub<OpenRcaServiceFutureStub> {
OpenRcaServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions)231     private OpenRcaServiceFutureStub(
232         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
233       super(channel, callOptions);
234     }
235 
236     @java.lang.Override
build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)237     protected OpenRcaServiceFutureStub build(
238         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
239       return new OpenRcaServiceFutureStub(channel, callOptions);
240     }
241   }
242 
243   private static final int METHODID_STREAM_CORE_METRICS = 0;
244 
245   private static final class MethodHandlers<Req, Resp> implements
246       io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
247       io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
248       io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
249       io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
250     private final AsyncService serviceImpl;
251     private final int methodId;
252 
MethodHandlers(AsyncService serviceImpl, int methodId)253     MethodHandlers(AsyncService serviceImpl, int methodId) {
254       this.serviceImpl = serviceImpl;
255       this.methodId = methodId;
256     }
257 
258     @java.lang.Override
259     @java.lang.SuppressWarnings("unchecked")
invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)260     public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
261       switch (methodId) {
262         case METHODID_STREAM_CORE_METRICS:
263           serviceImpl.streamCoreMetrics((com.github.xds.service.orca.v3.OrcaLoadReportRequest) request,
264               (io.grpc.stub.StreamObserver<com.github.xds.data.orca.v3.OrcaLoadReport>) responseObserver);
265           break;
266         default:
267           throw new AssertionError();
268       }
269     }
270 
271     @java.lang.Override
272     @java.lang.SuppressWarnings("unchecked")
invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)273     public io.grpc.stub.StreamObserver<Req> invoke(
274         io.grpc.stub.StreamObserver<Resp> responseObserver) {
275       switch (methodId) {
276         default:
277           throw new AssertionError();
278       }
279     }
280   }
281 
bindService(AsyncService service)282   public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
283     return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
284         .addMethod(
285           getStreamCoreMetricsMethod(),
286           io.grpc.stub.ServerCalls.asyncServerStreamingCall(
287             new MethodHandlers<
288               com.github.xds.service.orca.v3.OrcaLoadReportRequest,
289               com.github.xds.data.orca.v3.OrcaLoadReport>(
290                 service, METHODID_STREAM_CORE_METRICS)))
291         .build();
292   }
293 
294   private static abstract class OpenRcaServiceBaseDescriptorSupplier
295       implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
OpenRcaServiceBaseDescriptorSupplier()296     OpenRcaServiceBaseDescriptorSupplier() {}
297 
298     @java.lang.Override
getFileDescriptor()299     public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
300       return com.github.xds.service.orca.v3.OrcaProto.getDescriptor();
301     }
302 
303     @java.lang.Override
getServiceDescriptor()304     public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
305       return getFileDescriptor().findServiceByName("OpenRcaService");
306     }
307   }
308 
309   private static final class OpenRcaServiceFileDescriptorSupplier
310       extends OpenRcaServiceBaseDescriptorSupplier {
OpenRcaServiceFileDescriptorSupplier()311     OpenRcaServiceFileDescriptorSupplier() {}
312   }
313 
314   private static final class OpenRcaServiceMethodDescriptorSupplier
315       extends OpenRcaServiceBaseDescriptorSupplier
316       implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
317     private final String methodName;
318 
OpenRcaServiceMethodDescriptorSupplier(String methodName)319     OpenRcaServiceMethodDescriptorSupplier(String methodName) {
320       this.methodName = methodName;
321     }
322 
323     @java.lang.Override
getMethodDescriptor()324     public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
325       return getServiceDescriptor().findMethodByName(methodName);
326     }
327   }
328 
329   private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
330 
getServiceDescriptor()331   public static io.grpc.ServiceDescriptor getServiceDescriptor() {
332     io.grpc.ServiceDescriptor result = serviceDescriptor;
333     if (result == null) {
334       synchronized (OpenRcaServiceGrpc.class) {
335         result = serviceDescriptor;
336         if (result == null) {
337           serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
338               .setSchemaDescriptor(new OpenRcaServiceFileDescriptorSupplier())
339               .addMethod(getStreamCoreMetricsMethod())
340               .build();
341         }
342       }
343     }
344     return result;
345   }
346 }
347