Skip to content

Commit c4cc8a1

Browse files
committed
Add Trace Service generated grpc java files.
1 parent e330632 commit c4cc8a1

File tree

6 files changed

+1572
-0
lines changed

6 files changed

+1572
-0
lines changed
Lines changed: 364 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,364 @@
1+
package io.opentelemetry.proto.collector.logs.v1;
2+
3+
import static io.grpc.MethodDescriptor.generateFullMethodName;
4+
5+
/**
6+
* <pre>
7+
* Service that can be used to push logs between one Application instrumented with
8+
* OpenTelemetry and an collector, or between an collector and a central collector (in this
9+
* case logs are sent/received to/from multiple Applications).
10+
* </pre>
11+
*/
12+
@io.grpc.stub.annotations.GrpcGenerated
13+
public final class LogsServiceGrpc {
14+
15+
private LogsServiceGrpc() {}
16+
17+
public static final java.lang.String SERVICE_NAME = "opentelemetry.proto.collector.logs.v1.LogsService";
18+
19+
// Static method descriptors that strictly reflect the proto.
20+
private static volatile io.grpc.MethodDescriptor<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,
21+
io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse> getExportMethod;
22+
23+
@io.grpc.stub.annotations.RpcMethod(
24+
fullMethodName = SERVICE_NAME + '/' + "Export",
25+
requestType = io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.class,
26+
responseType = io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.class,
27+
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
28+
public static io.grpc.MethodDescriptor<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,
29+
io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse> getExportMethod() {
30+
io.grpc.MethodDescriptor<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest, io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse> getExportMethod;
31+
if ((getExportMethod = LogsServiceGrpc.getExportMethod) == null) {
32+
synchronized (LogsServiceGrpc.class) {
33+
if ((getExportMethod = LogsServiceGrpc.getExportMethod) == null) {
34+
LogsServiceGrpc.getExportMethod = getExportMethod =
35+
io.grpc.MethodDescriptor.<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest, io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse>newBuilder()
36+
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
37+
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Export"))
38+
.setSampledToLocalTracing(true)
39+
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
40+
io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.getDefaultInstance()))
41+
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
42+
io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.getDefaultInstance()))
43+
.setSchemaDescriptor(new LogsServiceMethodDescriptorSupplier("Export"))
44+
.build();
45+
}
46+
}
47+
}
48+
return getExportMethod;
49+
}
50+
51+
/**
52+
* Creates a new async stub that supports all call types for the service
53+
*/
54+
public static LogsServiceStub newStub(io.grpc.Channel channel) {
55+
io.grpc.stub.AbstractStub.StubFactory<LogsServiceStub> factory =
56+
new io.grpc.stub.AbstractStub.StubFactory<LogsServiceStub>() {
57+
@java.lang.Override
58+
public LogsServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
59+
return new LogsServiceStub(channel, callOptions);
60+
}
61+
};
62+
return LogsServiceStub.newStub(factory, channel);
63+
}
64+
65+
/**
66+
* Creates a new blocking-style stub that supports all types of calls on the service
67+
*/
68+
public static LogsServiceBlockingV2Stub newBlockingV2Stub(
69+
io.grpc.Channel channel) {
70+
io.grpc.stub.AbstractStub.StubFactory<LogsServiceBlockingV2Stub> factory =
71+
new io.grpc.stub.AbstractStub.StubFactory<LogsServiceBlockingV2Stub>() {
72+
@java.lang.Override
73+
public LogsServiceBlockingV2Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
74+
return new LogsServiceBlockingV2Stub(channel, callOptions);
75+
}
76+
};
77+
return LogsServiceBlockingV2Stub.newStub(factory, channel);
78+
}
79+
80+
/**
81+
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
82+
*/
83+
public static LogsServiceBlockingStub newBlockingStub(
84+
io.grpc.Channel channel) {
85+
io.grpc.stub.AbstractStub.StubFactory<LogsServiceBlockingStub> factory =
86+
new io.grpc.stub.AbstractStub.StubFactory<LogsServiceBlockingStub>() {
87+
@java.lang.Override
88+
public LogsServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
89+
return new LogsServiceBlockingStub(channel, callOptions);
90+
}
91+
};
92+
return LogsServiceBlockingStub.newStub(factory, channel);
93+
}
94+
95+
/**
96+
* Creates a new ListenableFuture-style stub that supports unary calls on the service
97+
*/
98+
public static LogsServiceFutureStub newFutureStub(
99+
io.grpc.Channel channel) {
100+
io.grpc.stub.AbstractStub.StubFactory<LogsServiceFutureStub> factory =
101+
new io.grpc.stub.AbstractStub.StubFactory<LogsServiceFutureStub>() {
102+
@java.lang.Override
103+
public LogsServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
104+
return new LogsServiceFutureStub(channel, callOptions);
105+
}
106+
};
107+
return LogsServiceFutureStub.newStub(factory, channel);
108+
}
109+
110+
/**
111+
* <pre>
112+
* Service that can be used to push logs between one Application instrumented with
113+
* OpenTelemetry and an collector, or between an collector and a central collector (in this
114+
* case logs are sent/received to/from multiple Applications).
115+
* </pre>
116+
*/
117+
public interface AsyncService {
118+
119+
/**
120+
*/
121+
default void export(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request,
122+
io.grpc.stub.StreamObserver<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse> responseObserver) {
123+
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExportMethod(), responseObserver);
124+
}
125+
}
126+
127+
/**
128+
* Base class for the server implementation of the service LogsService.
129+
* <pre>
130+
* Service that can be used to push logs between one Application instrumented with
131+
* OpenTelemetry and an collector, or between an collector and a central collector (in this
132+
* case logs are sent/received to/from multiple Applications).
133+
* </pre>
134+
*/
135+
public static abstract class LogsServiceImplBase
136+
implements io.grpc.BindableService, AsyncService {
137+
138+
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
139+
return LogsServiceGrpc.bindService(this);
140+
}
141+
}
142+
143+
/**
144+
* A stub to allow clients to do asynchronous rpc calls to service LogsService.
145+
* <pre>
146+
* Service that can be used to push logs between one Application instrumented with
147+
* OpenTelemetry and an collector, or between an collector and a central collector (in this
148+
* case logs are sent/received to/from multiple Applications).
149+
* </pre>
150+
*/
151+
public static final class LogsServiceStub
152+
extends io.grpc.stub.AbstractAsyncStub<LogsServiceStub> {
153+
private LogsServiceStub(
154+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
155+
super(channel, callOptions);
156+
}
157+
158+
@java.lang.Override
159+
protected LogsServiceStub build(
160+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
161+
return new LogsServiceStub(channel, callOptions);
162+
}
163+
164+
/**
165+
*/
166+
public void export(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request,
167+
io.grpc.stub.StreamObserver<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse> responseObserver) {
168+
io.grpc.stub.ClientCalls.asyncUnaryCall(
169+
getChannel().newCall(getExportMethod(), getCallOptions()), request, responseObserver);
170+
}
171+
}
172+
173+
/**
174+
* A stub to allow clients to do synchronous rpc calls to service LogsService.
175+
* <pre>
176+
* Service that can be used to push logs between one Application instrumented with
177+
* OpenTelemetry and an collector, or between an collector and a central collector (in this
178+
* case logs are sent/received to/from multiple Applications).
179+
* </pre>
180+
*/
181+
public static final class LogsServiceBlockingV2Stub
182+
extends io.grpc.stub.AbstractBlockingStub<LogsServiceBlockingV2Stub> {
183+
private LogsServiceBlockingV2Stub(
184+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
185+
super(channel, callOptions);
186+
}
187+
188+
@java.lang.Override
189+
protected LogsServiceBlockingV2Stub build(
190+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
191+
return new LogsServiceBlockingV2Stub(channel, callOptions);
192+
}
193+
194+
/**
195+
*/
196+
public io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse export(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request) throws io.grpc.StatusException {
197+
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
198+
getChannel(), getExportMethod(), getCallOptions(), request);
199+
}
200+
}
201+
202+
/**
203+
* A stub to allow clients to do limited synchronous rpc calls to service LogsService.
204+
* <pre>
205+
* Service that can be used to push logs between one Application instrumented with
206+
* OpenTelemetry and an collector, or between an collector and a central collector (in this
207+
* case logs are sent/received to/from multiple Applications).
208+
* </pre>
209+
*/
210+
public static final class LogsServiceBlockingStub
211+
extends io.grpc.stub.AbstractBlockingStub<LogsServiceBlockingStub> {
212+
private LogsServiceBlockingStub(
213+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
214+
super(channel, callOptions);
215+
}
216+
217+
@java.lang.Override
218+
protected LogsServiceBlockingStub build(
219+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
220+
return new LogsServiceBlockingStub(channel, callOptions);
221+
}
222+
223+
/**
224+
*/
225+
public io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse export(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request) {
226+
return io.grpc.stub.ClientCalls.blockingUnaryCall(
227+
getChannel(), getExportMethod(), getCallOptions(), request);
228+
}
229+
}
230+
231+
/**
232+
* A stub to allow clients to do ListenableFuture-style rpc calls to service LogsService.
233+
* <pre>
234+
* Service that can be used to push logs between one Application instrumented with
235+
* OpenTelemetry and an collector, or between an collector and a central collector (in this
236+
* case logs are sent/received to/from multiple Applications).
237+
* </pre>
238+
*/
239+
public static final class LogsServiceFutureStub
240+
extends io.grpc.stub.AbstractFutureStub<LogsServiceFutureStub> {
241+
private LogsServiceFutureStub(
242+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
243+
super(channel, callOptions);
244+
}
245+
246+
@java.lang.Override
247+
protected LogsServiceFutureStub build(
248+
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
249+
return new LogsServiceFutureStub(channel, callOptions);
250+
}
251+
252+
/**
253+
*/
254+
public com.google.common.util.concurrent.ListenableFuture<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse> export(
255+
io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest request) {
256+
return io.grpc.stub.ClientCalls.futureUnaryCall(
257+
getChannel().newCall(getExportMethod(), getCallOptions()), request);
258+
}
259+
}
260+
261+
private static final int METHODID_EXPORT = 0;
262+
263+
private static final class MethodHandlers<Req, Resp> implements
264+
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
265+
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
266+
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
267+
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
268+
private final AsyncService serviceImpl;
269+
private final int methodId;
270+
271+
MethodHandlers(AsyncService serviceImpl, int methodId) {
272+
this.serviceImpl = serviceImpl;
273+
this.methodId = methodId;
274+
}
275+
276+
@java.lang.Override
277+
@java.lang.SuppressWarnings("unchecked")
278+
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
279+
switch (methodId) {
280+
case METHODID_EXPORT:
281+
serviceImpl.export((io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) request,
282+
(io.grpc.stub.StreamObserver<io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse>) responseObserver);
283+
break;
284+
default:
285+
throw new AssertionError();
286+
}
287+
}
288+
289+
@java.lang.Override
290+
@java.lang.SuppressWarnings("unchecked")
291+
public io.grpc.stub.StreamObserver<Req> invoke(
292+
io.grpc.stub.StreamObserver<Resp> responseObserver) {
293+
switch (methodId) {
294+
default:
295+
throw new AssertionError();
296+
}
297+
}
298+
}
299+
300+
public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
301+
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
302+
.addMethod(
303+
getExportMethod(),
304+
io.grpc.stub.ServerCalls.asyncUnaryCall(
305+
new MethodHandlers<
306+
io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,
307+
io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse>(
308+
service, METHODID_EXPORT)))
309+
.build();
310+
}
311+
312+
private static abstract class LogsServiceBaseDescriptorSupplier
313+
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
314+
LogsServiceBaseDescriptorSupplier() {}
315+
316+
@java.lang.Override
317+
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
318+
return io.opentelemetry.proto.collector.logs.v1.LogsServiceProto.getDescriptor();
319+
}
320+
321+
@java.lang.Override
322+
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
323+
return getFileDescriptor().findServiceByName("LogsService");
324+
}
325+
}
326+
327+
private static final class LogsServiceFileDescriptorSupplier
328+
extends LogsServiceBaseDescriptorSupplier {
329+
LogsServiceFileDescriptorSupplier() {}
330+
}
331+
332+
private static final class LogsServiceMethodDescriptorSupplier
333+
extends LogsServiceBaseDescriptorSupplier
334+
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
335+
private final java.lang.String methodName;
336+
337+
LogsServiceMethodDescriptorSupplier(java.lang.String methodName) {
338+
this.methodName = methodName;
339+
}
340+
341+
@java.lang.Override
342+
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
343+
return getServiceDescriptor().findMethodByName(methodName);
344+
}
345+
}
346+
347+
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
348+
349+
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
350+
io.grpc.ServiceDescriptor result = serviceDescriptor;
351+
if (result == null) {
352+
synchronized (LogsServiceGrpc.class) {
353+
result = serviceDescriptor;
354+
if (result == null) {
355+
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
356+
.setSchemaDescriptor(new LogsServiceFileDescriptorSupplier())
357+
.addMethod(getExportMethod())
358+
.build();
359+
}
360+
}
361+
}
362+
return result;
363+
}
364+
}

0 commit comments

Comments
 (0)