]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/go/arrow/flight/Flight_grpc.pb.go
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / go / arrow / flight / Flight_grpc.pb.go
1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
3 package flight
4
5 import (
6 context "context"
7 grpc "google.golang.org/grpc"
8 codes "google.golang.org/grpc/codes"
9 status "google.golang.org/grpc/status"
10 )
11
12 // This is a compile-time assertion to ensure that this generated file
13 // is compatible with the grpc package it is being compiled against.
14 const _ = grpc.SupportPackageIsVersion7
15
16 // FlightServiceClient is the client API for FlightService service.
17 //
18 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
19 type FlightServiceClient interface {
20 //
21 // Handshake between client and server. Depending on the server, the
22 // handshake may be required to determine the token that should be used for
23 // future operations. Both request and response are streams to allow multiple
24 // round-trips depending on auth mechanism.
25 Handshake(ctx context.Context, opts ...grpc.CallOption) (FlightService_HandshakeClient, error)
26 //
27 // Get a list of available streams given a particular criteria. Most flight
28 // services will expose one or more streams that are readily available for
29 // retrieval. This api allows listing the streams available for
30 // consumption. A user can also provide a criteria. The criteria can limit
31 // the subset of streams that can be listed via this interface. Each flight
32 // service allows its own definition of how to consume criteria.
33 ListFlights(ctx context.Context, in *Criteria, opts ...grpc.CallOption) (FlightService_ListFlightsClient, error)
34 //
35 // For a given FlightDescriptor, get information about how the flight can be
36 // consumed. This is a useful interface if the consumer of the interface
37 // already can identify the specific flight to consume. This interface can
38 // also allow a consumer to generate a flight stream through a specified
39 // descriptor. For example, a flight descriptor might be something that
40 // includes a SQL statement or a Pickled Python operation that will be
41 // executed. In those cases, the descriptor will not be previously available
42 // within the list of available streams provided by ListFlights but will be
43 // available for consumption for the duration defined by the specific flight
44 // service.
45 GetFlightInfo(ctx context.Context, in *FlightDescriptor, opts ...grpc.CallOption) (*FlightInfo, error)
46 //
47 // For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
48 // This is used when a consumer needs the Schema of flight stream. Similar to
49 // GetFlightInfo this interface may generate a new flight that was not previously
50 // available in ListFlights.
51 GetSchema(ctx context.Context, in *FlightDescriptor, opts ...grpc.CallOption) (*SchemaResult, error)
52 //
53 // Retrieve a single stream associated with a particular descriptor
54 // associated with the referenced ticket. A Flight can be composed of one or
55 // more streams where each stream can be retrieved using a separate opaque
56 // ticket that the flight service uses for managing a collection of streams.
57 DoGet(ctx context.Context, in *Ticket, opts ...grpc.CallOption) (FlightService_DoGetClient, error)
58 //
59 // Push a stream to the flight service associated with a particular
60 // flight stream. This allows a client of a flight service to upload a stream
61 // of data. Depending on the particular flight service, a client consumer
62 // could be allowed to upload a single stream per descriptor or an unlimited
63 // number. In the latter, the service might implement a 'seal' action that
64 // can be applied to a descriptor once all streams are uploaded.
65 DoPut(ctx context.Context, opts ...grpc.CallOption) (FlightService_DoPutClient, error)
66 //
67 // Open a bidirectional data channel for a given descriptor. This
68 // allows clients to send and receive arbitrary Arrow data and
69 // application-specific metadata in a single logical stream. In
70 // contrast to DoGet/DoPut, this is more suited for clients
71 // offloading computation (rather than storage) to a Flight service.
72 DoExchange(ctx context.Context, opts ...grpc.CallOption) (FlightService_DoExchangeClient, error)
73 //
74 // Flight services can support an arbitrary number of simple actions in
75 // addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut
76 // operations that are potentially available. DoAction allows a flight client
77 // to do a specific action against a flight service. An action includes
78 // opaque request and response objects that are specific to the type action
79 // being undertaken.
80 DoAction(ctx context.Context, in *Action, opts ...grpc.CallOption) (FlightService_DoActionClient, error)
81 //
82 // A flight service exposes all of the available action types that it has
83 // along with descriptions. This allows different flight consumers to
84 // understand the capabilities of the flight service.
85 ListActions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (FlightService_ListActionsClient, error)
86 }
87
88 type flightServiceClient struct {
89 cc grpc.ClientConnInterface
90 }
91
92 func NewFlightServiceClient(cc grpc.ClientConnInterface) FlightServiceClient {
93 return &flightServiceClient{cc}
94 }
95
96 var flightServiceHandshakeStreamDesc = &grpc.StreamDesc{
97 StreamName: "Handshake",
98 ServerStreams: true,
99 ClientStreams: true,
100 }
101
102 func (c *flightServiceClient) Handshake(ctx context.Context, opts ...grpc.CallOption) (FlightService_HandshakeClient, error) {
103 stream, err := c.cc.NewStream(ctx, flightServiceHandshakeStreamDesc, "/arrow.flight.protocol.FlightService/Handshake", opts...)
104 if err != nil {
105 return nil, err
106 }
107 x := &flightServiceHandshakeClient{stream}
108 return x, nil
109 }
110
111 type FlightService_HandshakeClient interface {
112 Send(*HandshakeRequest) error
113 Recv() (*HandshakeResponse, error)
114 grpc.ClientStream
115 }
116
117 type flightServiceHandshakeClient struct {
118 grpc.ClientStream
119 }
120
121 func (x *flightServiceHandshakeClient) Send(m *HandshakeRequest) error {
122 return x.ClientStream.SendMsg(m)
123 }
124
125 func (x *flightServiceHandshakeClient) Recv() (*HandshakeResponse, error) {
126 m := new(HandshakeResponse)
127 if err := x.ClientStream.RecvMsg(m); err != nil {
128 return nil, err
129 }
130 return m, nil
131 }
132
133 var flightServiceListFlightsStreamDesc = &grpc.StreamDesc{
134 StreamName: "ListFlights",
135 ServerStreams: true,
136 }
137
138 func (c *flightServiceClient) ListFlights(ctx context.Context, in *Criteria, opts ...grpc.CallOption) (FlightService_ListFlightsClient, error) {
139 stream, err := c.cc.NewStream(ctx, flightServiceListFlightsStreamDesc, "/arrow.flight.protocol.FlightService/ListFlights", opts...)
140 if err != nil {
141 return nil, err
142 }
143 x := &flightServiceListFlightsClient{stream}
144 if err := x.ClientStream.SendMsg(in); err != nil {
145 return nil, err
146 }
147 if err := x.ClientStream.CloseSend(); err != nil {
148 return nil, err
149 }
150 return x, nil
151 }
152
153 type FlightService_ListFlightsClient interface {
154 Recv() (*FlightInfo, error)
155 grpc.ClientStream
156 }
157
158 type flightServiceListFlightsClient struct {
159 grpc.ClientStream
160 }
161
162 func (x *flightServiceListFlightsClient) Recv() (*FlightInfo, error) {
163 m := new(FlightInfo)
164 if err := x.ClientStream.RecvMsg(m); err != nil {
165 return nil, err
166 }
167 return m, nil
168 }
169
170 var flightServiceGetFlightInfoStreamDesc = &grpc.StreamDesc{
171 StreamName: "GetFlightInfo",
172 }
173
174 func (c *flightServiceClient) GetFlightInfo(ctx context.Context, in *FlightDescriptor, opts ...grpc.CallOption) (*FlightInfo, error) {
175 out := new(FlightInfo)
176 err := c.cc.Invoke(ctx, "/arrow.flight.protocol.FlightService/GetFlightInfo", in, out, opts...)
177 if err != nil {
178 return nil, err
179 }
180 return out, nil
181 }
182
183 var flightServiceGetSchemaStreamDesc = &grpc.StreamDesc{
184 StreamName: "GetSchema",
185 }
186
187 func (c *flightServiceClient) GetSchema(ctx context.Context, in *FlightDescriptor, opts ...grpc.CallOption) (*SchemaResult, error) {
188 out := new(SchemaResult)
189 err := c.cc.Invoke(ctx, "/arrow.flight.protocol.FlightService/GetSchema", in, out, opts...)
190 if err != nil {
191 return nil, err
192 }
193 return out, nil
194 }
195
196 var flightServiceDoGetStreamDesc = &grpc.StreamDesc{
197 StreamName: "DoGet",
198 ServerStreams: true,
199 }
200
201 func (c *flightServiceClient) DoGet(ctx context.Context, in *Ticket, opts ...grpc.CallOption) (FlightService_DoGetClient, error) {
202 stream, err := c.cc.NewStream(ctx, flightServiceDoGetStreamDesc, "/arrow.flight.protocol.FlightService/DoGet", opts...)
203 if err != nil {
204 return nil, err
205 }
206 x := &flightServiceDoGetClient{stream}
207 if err := x.ClientStream.SendMsg(in); err != nil {
208 return nil, err
209 }
210 if err := x.ClientStream.CloseSend(); err != nil {
211 return nil, err
212 }
213 return x, nil
214 }
215
216 type FlightService_DoGetClient interface {
217 Recv() (*FlightData, error)
218 grpc.ClientStream
219 }
220
221 type flightServiceDoGetClient struct {
222 grpc.ClientStream
223 }
224
225 func (x *flightServiceDoGetClient) Recv() (*FlightData, error) {
226 m := new(FlightData)
227 if err := x.ClientStream.RecvMsg(m); err != nil {
228 return nil, err
229 }
230 return m, nil
231 }
232
233 var flightServiceDoPutStreamDesc = &grpc.StreamDesc{
234 StreamName: "DoPut",
235 ServerStreams: true,
236 ClientStreams: true,
237 }
238
239 func (c *flightServiceClient) DoPut(ctx context.Context, opts ...grpc.CallOption) (FlightService_DoPutClient, error) {
240 stream, err := c.cc.NewStream(ctx, flightServiceDoPutStreamDesc, "/arrow.flight.protocol.FlightService/DoPut", opts...)
241 if err != nil {
242 return nil, err
243 }
244 x := &flightServiceDoPutClient{stream}
245 return x, nil
246 }
247
248 type FlightService_DoPutClient interface {
249 Send(*FlightData) error
250 Recv() (*PutResult, error)
251 grpc.ClientStream
252 }
253
254 type flightServiceDoPutClient struct {
255 grpc.ClientStream
256 }
257
258 func (x *flightServiceDoPutClient) Send(m *FlightData) error {
259 return x.ClientStream.SendMsg(m)
260 }
261
262 func (x *flightServiceDoPutClient) Recv() (*PutResult, error) {
263 m := new(PutResult)
264 if err := x.ClientStream.RecvMsg(m); err != nil {
265 return nil, err
266 }
267 return m, nil
268 }
269
270 var flightServiceDoExchangeStreamDesc = &grpc.StreamDesc{
271 StreamName: "DoExchange",
272 ServerStreams: true,
273 ClientStreams: true,
274 }
275
276 func (c *flightServiceClient) DoExchange(ctx context.Context, opts ...grpc.CallOption) (FlightService_DoExchangeClient, error) {
277 stream, err := c.cc.NewStream(ctx, flightServiceDoExchangeStreamDesc, "/arrow.flight.protocol.FlightService/DoExchange", opts...)
278 if err != nil {
279 return nil, err
280 }
281 x := &flightServiceDoExchangeClient{stream}
282 return x, nil
283 }
284
285 type FlightService_DoExchangeClient interface {
286 Send(*FlightData) error
287 Recv() (*FlightData, error)
288 grpc.ClientStream
289 }
290
291 type flightServiceDoExchangeClient struct {
292 grpc.ClientStream
293 }
294
295 func (x *flightServiceDoExchangeClient) Send(m *FlightData) error {
296 return x.ClientStream.SendMsg(m)
297 }
298
299 func (x *flightServiceDoExchangeClient) Recv() (*FlightData, error) {
300 m := new(FlightData)
301 if err := x.ClientStream.RecvMsg(m); err != nil {
302 return nil, err
303 }
304 return m, nil
305 }
306
307 var flightServiceDoActionStreamDesc = &grpc.StreamDesc{
308 StreamName: "DoAction",
309 ServerStreams: true,
310 }
311
312 func (c *flightServiceClient) DoAction(ctx context.Context, in *Action, opts ...grpc.CallOption) (FlightService_DoActionClient, error) {
313 stream, err := c.cc.NewStream(ctx, flightServiceDoActionStreamDesc, "/arrow.flight.protocol.FlightService/DoAction", opts...)
314 if err != nil {
315 return nil, err
316 }
317 x := &flightServiceDoActionClient{stream}
318 if err := x.ClientStream.SendMsg(in); err != nil {
319 return nil, err
320 }
321 if err := x.ClientStream.CloseSend(); err != nil {
322 return nil, err
323 }
324 return x, nil
325 }
326
327 type FlightService_DoActionClient interface {
328 Recv() (*Result, error)
329 grpc.ClientStream
330 }
331
332 type flightServiceDoActionClient struct {
333 grpc.ClientStream
334 }
335
336 func (x *flightServiceDoActionClient) Recv() (*Result, error) {
337 m := new(Result)
338 if err := x.ClientStream.RecvMsg(m); err != nil {
339 return nil, err
340 }
341 return m, nil
342 }
343
344 var flightServiceListActionsStreamDesc = &grpc.StreamDesc{
345 StreamName: "ListActions",
346 ServerStreams: true,
347 }
348
349 func (c *flightServiceClient) ListActions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (FlightService_ListActionsClient, error) {
350 stream, err := c.cc.NewStream(ctx, flightServiceListActionsStreamDesc, "/arrow.flight.protocol.FlightService/ListActions", opts...)
351 if err != nil {
352 return nil, err
353 }
354 x := &flightServiceListActionsClient{stream}
355 if err := x.ClientStream.SendMsg(in); err != nil {
356 return nil, err
357 }
358 if err := x.ClientStream.CloseSend(); err != nil {
359 return nil, err
360 }
361 return x, nil
362 }
363
364 type FlightService_ListActionsClient interface {
365 Recv() (*ActionType, error)
366 grpc.ClientStream
367 }
368
369 type flightServiceListActionsClient struct {
370 grpc.ClientStream
371 }
372
373 func (x *flightServiceListActionsClient) Recv() (*ActionType, error) {
374 m := new(ActionType)
375 if err := x.ClientStream.RecvMsg(m); err != nil {
376 return nil, err
377 }
378 return m, nil
379 }
380
381 // FlightServiceService is the service API for FlightService service.
382 // Fields should be assigned to their respective handler implementations only before
383 // RegisterFlightServiceService is called. Any unassigned fields will result in the
384 // handler for that method returning an Unimplemented error.
385 type FlightServiceService struct {
386 //
387 // Handshake between client and server. Depending on the server, the
388 // handshake may be required to determine the token that should be used for
389 // future operations. Both request and response are streams to allow multiple
390 // round-trips depending on auth mechanism.
391 Handshake func(FlightService_HandshakeServer) error
392 //
393 // Get a list of available streams given a particular criteria. Most flight
394 // services will expose one or more streams that are readily available for
395 // retrieval. This api allows listing the streams available for
396 // consumption. A user can also provide a criteria. The criteria can limit
397 // the subset of streams that can be listed via this interface. Each flight
398 // service allows its own definition of how to consume criteria.
399 ListFlights func(*Criteria, FlightService_ListFlightsServer) error
400 //
401 // For a given FlightDescriptor, get information about how the flight can be
402 // consumed. This is a useful interface if the consumer of the interface
403 // already can identify the specific flight to consume. This interface can
404 // also allow a consumer to generate a flight stream through a specified
405 // descriptor. For example, a flight descriptor might be something that
406 // includes a SQL statement or a Pickled Python operation that will be
407 // executed. In those cases, the descriptor will not be previously available
408 // within the list of available streams provided by ListFlights but will be
409 // available for consumption for the duration defined by the specific flight
410 // service.
411 GetFlightInfo func(context.Context, *FlightDescriptor) (*FlightInfo, error)
412 //
413 // For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
414 // This is used when a consumer needs the Schema of flight stream. Similar to
415 // GetFlightInfo this interface may generate a new flight that was not previously
416 // available in ListFlights.
417 GetSchema func(context.Context, *FlightDescriptor) (*SchemaResult, error)
418 //
419 // Retrieve a single stream associated with a particular descriptor
420 // associated with the referenced ticket. A Flight can be composed of one or
421 // more streams where each stream can be retrieved using a separate opaque
422 // ticket that the flight service uses for managing a collection of streams.
423 DoGet func(*Ticket, FlightService_DoGetServer) error
424 //
425 // Push a stream to the flight service associated with a particular
426 // flight stream. This allows a client of a flight service to upload a stream
427 // of data. Depending on the particular flight service, a client consumer
428 // could be allowed to upload a single stream per descriptor or an unlimited
429 // number. In the latter, the service might implement a 'seal' action that
430 // can be applied to a descriptor once all streams are uploaded.
431 DoPut func(FlightService_DoPutServer) error
432 //
433 // Open a bidirectional data channel for a given descriptor. This
434 // allows clients to send and receive arbitrary Arrow data and
435 // application-specific metadata in a single logical stream. In
436 // contrast to DoGet/DoPut, this is more suited for clients
437 // offloading computation (rather than storage) to a Flight service.
438 DoExchange func(FlightService_DoExchangeServer) error
439 //
440 // Flight services can support an arbitrary number of simple actions in
441 // addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut
442 // operations that are potentially available. DoAction allows a flight client
443 // to do a specific action against a flight service. An action includes
444 // opaque request and response objects that are specific to the type action
445 // being undertaken.
446 DoAction func(*Action, FlightService_DoActionServer) error
447 //
448 // A flight service exposes all of the available action types that it has
449 // along with descriptions. This allows different flight consumers to
450 // understand the capabilities of the flight service.
451 ListActions func(*Empty, FlightService_ListActionsServer) error
452 }
453
454 func (s *FlightServiceService) handshake(_ interface{}, stream grpc.ServerStream) error {
455 return s.Handshake(&flightServiceHandshakeServer{stream})
456 }
457 func (s *FlightServiceService) listFlights(_ interface{}, stream grpc.ServerStream) error {
458 m := new(Criteria)
459 if err := stream.RecvMsg(m); err != nil {
460 return err
461 }
462 return s.ListFlights(m, &flightServiceListFlightsServer{stream})
463 }
464 func (s *FlightServiceService) getFlightInfo(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
465 in := new(FlightDescriptor)
466 if err := dec(in); err != nil {
467 return nil, err
468 }
469 if interceptor == nil {
470 return s.GetFlightInfo(ctx, in)
471 }
472 info := &grpc.UnaryServerInfo{
473 Server: s,
474 FullMethod: "/arrow.flight.protocol.FlightService/GetFlightInfo",
475 }
476 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
477 return s.GetFlightInfo(ctx, req.(*FlightDescriptor))
478 }
479 return interceptor(ctx, in, info, handler)
480 }
481 func (s *FlightServiceService) getSchema(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
482 in := new(FlightDescriptor)
483 if err := dec(in); err != nil {
484 return nil, err
485 }
486 if interceptor == nil {
487 return s.GetSchema(ctx, in)
488 }
489 info := &grpc.UnaryServerInfo{
490 Server: s,
491 FullMethod: "/arrow.flight.protocol.FlightService/GetSchema",
492 }
493 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
494 return s.GetSchema(ctx, req.(*FlightDescriptor))
495 }
496 return interceptor(ctx, in, info, handler)
497 }
498 func (s *FlightServiceService) doGet(_ interface{}, stream grpc.ServerStream) error {
499 m := new(Ticket)
500 if err := stream.RecvMsg(m); err != nil {
501 return err
502 }
503 return s.DoGet(m, &flightServiceDoGetServer{stream})
504 }
505 func (s *FlightServiceService) doPut(_ interface{}, stream grpc.ServerStream) error {
506 return s.DoPut(&flightServiceDoPutServer{stream})
507 }
508 func (s *FlightServiceService) doExchange(_ interface{}, stream grpc.ServerStream) error {
509 return s.DoExchange(&flightServiceDoExchangeServer{stream})
510 }
511 func (s *FlightServiceService) doAction(_ interface{}, stream grpc.ServerStream) error {
512 m := new(Action)
513 if err := stream.RecvMsg(m); err != nil {
514 return err
515 }
516 return s.DoAction(m, &flightServiceDoActionServer{stream})
517 }
518 func (s *FlightServiceService) listActions(_ interface{}, stream grpc.ServerStream) error {
519 m := new(Empty)
520 if err := stream.RecvMsg(m); err != nil {
521 return err
522 }
523 return s.ListActions(m, &flightServiceListActionsServer{stream})
524 }
525
526 type FlightService_HandshakeServer interface {
527 Send(*HandshakeResponse) error
528 Recv() (*HandshakeRequest, error)
529 grpc.ServerStream
530 }
531
532 type flightServiceHandshakeServer struct {
533 grpc.ServerStream
534 }
535
536 func (x *flightServiceHandshakeServer) Send(m *HandshakeResponse) error {
537 return x.ServerStream.SendMsg(m)
538 }
539
540 func (x *flightServiceHandshakeServer) Recv() (*HandshakeRequest, error) {
541 m := new(HandshakeRequest)
542 if err := x.ServerStream.RecvMsg(m); err != nil {
543 return nil, err
544 }
545 return m, nil
546 }
547
548 type FlightService_ListFlightsServer interface {
549 Send(*FlightInfo) error
550 grpc.ServerStream
551 }
552
553 type flightServiceListFlightsServer struct {
554 grpc.ServerStream
555 }
556
557 func (x *flightServiceListFlightsServer) Send(m *FlightInfo) error {
558 return x.ServerStream.SendMsg(m)
559 }
560
561 type FlightService_DoGetServer interface {
562 Send(*FlightData) error
563 grpc.ServerStream
564 }
565
566 type flightServiceDoGetServer struct {
567 grpc.ServerStream
568 }
569
570 func (x *flightServiceDoGetServer) Send(m *FlightData) error {
571 return x.ServerStream.SendMsg(m)
572 }
573
574 type FlightService_DoPutServer interface {
575 Send(*PutResult) error
576 Recv() (*FlightData, error)
577 grpc.ServerStream
578 }
579
580 type flightServiceDoPutServer struct {
581 grpc.ServerStream
582 }
583
584 func (x *flightServiceDoPutServer) Send(m *PutResult) error {
585 return x.ServerStream.SendMsg(m)
586 }
587
588 func (x *flightServiceDoPutServer) Recv() (*FlightData, error) {
589 m := new(FlightData)
590 if err := x.ServerStream.RecvMsg(m); err != nil {
591 return nil, err
592 }
593 return m, nil
594 }
595
596 type FlightService_DoExchangeServer interface {
597 Send(*FlightData) error
598 Recv() (*FlightData, error)
599 grpc.ServerStream
600 }
601
602 type flightServiceDoExchangeServer struct {
603 grpc.ServerStream
604 }
605
606 func (x *flightServiceDoExchangeServer) Send(m *FlightData) error {
607 return x.ServerStream.SendMsg(m)
608 }
609
610 func (x *flightServiceDoExchangeServer) Recv() (*FlightData, error) {
611 m := new(FlightData)
612 if err := x.ServerStream.RecvMsg(m); err != nil {
613 return nil, err
614 }
615 return m, nil
616 }
617
618 type FlightService_DoActionServer interface {
619 Send(*Result) error
620 grpc.ServerStream
621 }
622
623 type flightServiceDoActionServer struct {
624 grpc.ServerStream
625 }
626
627 func (x *flightServiceDoActionServer) Send(m *Result) error {
628 return x.ServerStream.SendMsg(m)
629 }
630
631 type FlightService_ListActionsServer interface {
632 Send(*ActionType) error
633 grpc.ServerStream
634 }
635
636 type flightServiceListActionsServer struct {
637 grpc.ServerStream
638 }
639
640 func (x *flightServiceListActionsServer) Send(m *ActionType) error {
641 return x.ServerStream.SendMsg(m)
642 }
643
644 // RegisterFlightServiceService registers a service implementation with a gRPC server.
645 func RegisterFlightServiceService(s grpc.ServiceRegistrar, srv *FlightServiceService) {
646 srvCopy := *srv
647 if srvCopy.Handshake == nil {
648 srvCopy.Handshake = func(FlightService_HandshakeServer) error {
649 return status.Errorf(codes.Unimplemented, "method Handshake not implemented")
650 }
651 }
652 if srvCopy.ListFlights == nil {
653 srvCopy.ListFlights = func(*Criteria, FlightService_ListFlightsServer) error {
654 return status.Errorf(codes.Unimplemented, "method ListFlights not implemented")
655 }
656 }
657 if srvCopy.GetFlightInfo == nil {
658 srvCopy.GetFlightInfo = func(context.Context, *FlightDescriptor) (*FlightInfo, error) {
659 return nil, status.Errorf(codes.Unimplemented, "method GetFlightInfo not implemented")
660 }
661 }
662 if srvCopy.GetSchema == nil {
663 srvCopy.GetSchema = func(context.Context, *FlightDescriptor) (*SchemaResult, error) {
664 return nil, status.Errorf(codes.Unimplemented, "method GetSchema not implemented")
665 }
666 }
667 if srvCopy.DoGet == nil {
668 srvCopy.DoGet = func(*Ticket, FlightService_DoGetServer) error {
669 return status.Errorf(codes.Unimplemented, "method DoGet not implemented")
670 }
671 }
672 if srvCopy.DoPut == nil {
673 srvCopy.DoPut = func(FlightService_DoPutServer) error {
674 return status.Errorf(codes.Unimplemented, "method DoPut not implemented")
675 }
676 }
677 if srvCopy.DoExchange == nil {
678 srvCopy.DoExchange = func(FlightService_DoExchangeServer) error {
679 return status.Errorf(codes.Unimplemented, "method DoExchange not implemented")
680 }
681 }
682 if srvCopy.DoAction == nil {
683 srvCopy.DoAction = func(*Action, FlightService_DoActionServer) error {
684 return status.Errorf(codes.Unimplemented, "method DoAction not implemented")
685 }
686 }
687 if srvCopy.ListActions == nil {
688 srvCopy.ListActions = func(*Empty, FlightService_ListActionsServer) error {
689 return status.Errorf(codes.Unimplemented, "method ListActions not implemented")
690 }
691 }
692 sd := grpc.ServiceDesc{
693 ServiceName: "arrow.flight.protocol.FlightService",
694 Methods: []grpc.MethodDesc{
695 {
696 MethodName: "GetFlightInfo",
697 Handler: srvCopy.getFlightInfo,
698 },
699 {
700 MethodName: "GetSchema",
701 Handler: srvCopy.getSchema,
702 },
703 },
704 Streams: []grpc.StreamDesc{
705 {
706 StreamName: "Handshake",
707 Handler: srvCopy.handshake,
708 ServerStreams: true,
709 ClientStreams: true,
710 },
711 {
712 StreamName: "ListFlights",
713 Handler: srvCopy.listFlights,
714 ServerStreams: true,
715 },
716 {
717 StreamName: "DoGet",
718 Handler: srvCopy.doGet,
719 ServerStreams: true,
720 },
721 {
722 StreamName: "DoPut",
723 Handler: srvCopy.doPut,
724 ServerStreams: true,
725 ClientStreams: true,
726 },
727 {
728 StreamName: "DoExchange",
729 Handler: srvCopy.doExchange,
730 ServerStreams: true,
731 ClientStreams: true,
732 },
733 {
734 StreamName: "DoAction",
735 Handler: srvCopy.doAction,
736 ServerStreams: true,
737 },
738 {
739 StreamName: "ListActions",
740 Handler: srvCopy.listActions,
741 ServerStreams: true,
742 },
743 },
744 Metadata: "Flight.proto",
745 }
746
747 s.RegisterService(&sd, nil)
748 }
749
750 // NewFlightServiceService creates a new FlightServiceService containing the
751 // implemented methods of the FlightService service in s. Any unimplemented
752 // methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
753 // This includes situations where the method handler is misspelled or has the wrong
754 // signature. For this reason, this function should be used with great care and
755 // is not recommended to be used by most users.
756 func NewFlightServiceService(s interface{}) *FlightServiceService {
757 ns := &FlightServiceService{}
758 if h, ok := s.(interface {
759 Handshake(FlightService_HandshakeServer) error
760 }); ok {
761 ns.Handshake = h.Handshake
762 }
763 if h, ok := s.(interface {
764 ListFlights(*Criteria, FlightService_ListFlightsServer) error
765 }); ok {
766 ns.ListFlights = h.ListFlights
767 }
768 if h, ok := s.(interface {
769 GetFlightInfo(context.Context, *FlightDescriptor) (*FlightInfo, error)
770 }); ok {
771 ns.GetFlightInfo = h.GetFlightInfo
772 }
773 if h, ok := s.(interface {
774 GetSchema(context.Context, *FlightDescriptor) (*SchemaResult, error)
775 }); ok {
776 ns.GetSchema = h.GetSchema
777 }
778 if h, ok := s.(interface {
779 DoGet(*Ticket, FlightService_DoGetServer) error
780 }); ok {
781 ns.DoGet = h.DoGet
782 }
783 if h, ok := s.(interface {
784 DoPut(FlightService_DoPutServer) error
785 }); ok {
786 ns.DoPut = h.DoPut
787 }
788 if h, ok := s.(interface {
789 DoExchange(FlightService_DoExchangeServer) error
790 }); ok {
791 ns.DoExchange = h.DoExchange
792 }
793 if h, ok := s.(interface {
794 DoAction(*Action, FlightService_DoActionServer) error
795 }); ok {
796 ns.DoAction = h.DoAction
797 }
798 if h, ok := s.(interface {
799 ListActions(*Empty, FlightService_ListActionsServer) error
800 }); ok {
801 ns.ListActions = h.ListActions
802 }
803 return ns
804 }
805
806 // UnstableFlightServiceService is the service API for FlightService service.
807 // New methods may be added to this interface if they are added to the service
808 // definition, which is not a backward-compatible change. For this reason,
809 // use of this type is not recommended.
810 type UnstableFlightServiceService interface {
811 //
812 // Handshake between client and server. Depending on the server, the
813 // handshake may be required to determine the token that should be used for
814 // future operations. Both request and response are streams to allow multiple
815 // round-trips depending on auth mechanism.
816 Handshake(FlightService_HandshakeServer) error
817 //
818 // Get a list of available streams given a particular criteria. Most flight
819 // services will expose one or more streams that are readily available for
820 // retrieval. This api allows listing the streams available for
821 // consumption. A user can also provide a criteria. The criteria can limit
822 // the subset of streams that can be listed via this interface. Each flight
823 // service allows its own definition of how to consume criteria.
824 ListFlights(*Criteria, FlightService_ListFlightsServer) error
825 //
826 // For a given FlightDescriptor, get information about how the flight can be
827 // consumed. This is a useful interface if the consumer of the interface
828 // already can identify the specific flight to consume. This interface can
829 // also allow a consumer to generate a flight stream through a specified
830 // descriptor. For example, a flight descriptor might be something that
831 // includes a SQL statement or a Pickled Python operation that will be
832 // executed. In those cases, the descriptor will not be previously available
833 // within the list of available streams provided by ListFlights but will be
834 // available for consumption for the duration defined by the specific flight
835 // service.
836 GetFlightInfo(context.Context, *FlightDescriptor) (*FlightInfo, error)
837 //
838 // For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
839 // This is used when a consumer needs the Schema of flight stream. Similar to
840 // GetFlightInfo this interface may generate a new flight that was not previously
841 // available in ListFlights.
842 GetSchema(context.Context, *FlightDescriptor) (*SchemaResult, error)
843 //
844 // Retrieve a single stream associated with a particular descriptor
845 // associated with the referenced ticket. A Flight can be composed of one or
846 // more streams where each stream can be retrieved using a separate opaque
847 // ticket that the flight service uses for managing a collection of streams.
848 DoGet(*Ticket, FlightService_DoGetServer) error
849 //
850 // Push a stream to the flight service associated with a particular
851 // flight stream. This allows a client of a flight service to upload a stream
852 // of data. Depending on the particular flight service, a client consumer
853 // could be allowed to upload a single stream per descriptor or an unlimited
854 // number. In the latter, the service might implement a 'seal' action that
855 // can be applied to a descriptor once all streams are uploaded.
856 DoPut(FlightService_DoPutServer) error
857 //
858 // Open a bidirectional data channel for a given descriptor. This
859 // allows clients to send and receive arbitrary Arrow data and
860 // application-specific metadata in a single logical stream. In
861 // contrast to DoGet/DoPut, this is more suited for clients
862 // offloading computation (rather than storage) to a Flight service.
863 DoExchange(FlightService_DoExchangeServer) error
864 //
865 // Flight services can support an arbitrary number of simple actions in
866 // addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut
867 // operations that are potentially available. DoAction allows a flight client
868 // to do a specific action against a flight service. An action includes
869 // opaque request and response objects that are specific to the type action
870 // being undertaken.
871 DoAction(*Action, FlightService_DoActionServer) error
872 //
873 // A flight service exposes all of the available action types that it has
874 // along with descriptions. This allows different flight consumers to
875 // understand the capabilities of the flight service.
876 ListActions(*Empty, FlightService_ListActionsServer) error
877 }