Server related classes

Server related classes

Functions

Properties

gpointer stream Write / Construct Only
GArrowRecordBatchReader * reader Read / Write / Construct Only
gpointer handler Write / Construct Only
gpointer reader Write / Construct Only
gpointer sender Write / Construct Only
gpointer call-context Write / Construct Only
GAFlightServerAuthHandler * auth-handler Read / Write
GAFlightLocation * location Read / Write / Construct Only

Types and Values

Object Hierarchy

    GInterface
    ╰── GAFlightServable
    GObject
    ├── GAFlightRecordBatchReader
       ╰── GAFlightMessageReader
    ├── GAFlightDataStream
       ╰── GAFlightRecordBatchStream
    ├── GAFlightServer
    ├── GAFlightServerAuthHandler
       ╰── GAFlightServerCustomAuthHandler
    ├── GAFlightServerAuthReader
    ├── GAFlightServerAuthSender
    ├── GAFlightServerCallContext
    ╰── GAFlightServerOptions

Prerequisites

GAFlightServable requires GObject.

Implemented Interfaces

GAFlightServer implements GAFlightServable.

Known Implementations

GAFlightServable is implemented by GAFlightServer.

Includes

#include <arrow-flight-glib/arrow-flight-glib.h>

Description

GAFlightDataStream is a class for producing a sequence of IPC payloads to be sent in FlightData protobuf messages. Generally, this is not used directly. Generally, GAFlightRecordBatchStream is used instead.

GAFlightRecordBatchStream is a class for producing a sequence of IPC payloads to be sent in FlightData protobuf messages by GArrowRecordBatchReader`.

GAFlightMessageReader is a class for IPC payloads uploaded by a client. Also allows reading application-defined metadata via the Flight protocol.

GAFlightServerAuthSender is a class for sending messages to the client during an authentication handshake.

GAFlightServerAuthReader is a class for reading messages from the client during an authentication handshake.

GAFlightServerAuthHandler is an abstract class to implement authentication for a Flight service.

GAFlightServerOptions is a class for options of each server.

GAFlightServerCallContext is a class for context of each server call.

GAFlightServer is a class to develop an Apache Arrow Flight server.

Functions

gaflight_record_batch_stream_new ()

GAFlightRecordBatchStream *
gaflight_record_batch_stream_new (GArrowRecordBatchReader *reader,
                                  GArrowWriteOptions *options);

Parameters

reader

A GArrowRecordBatchReader to be read.

 

options

A GArrowWriteOptions for writing record batches to a client.

[nullable]

Returns

The newly created GAFlightRecordBatchStream.

Since: 6.0.0

gaflight_message_reader_get_descriptor ()

GAFlightDescriptor *
gaflight_message_reader_get_descriptor
                               (GAFlightMessageReader *reader);

Parameters

reader

A GAFlightMessageReader.

 

Returns

The descriptor for this upload.

[transfer full]

Since: 14.0.0

gaflight_server_call_context_foreach_incoming_header ()

void
gaflight_server_call_context_foreach_incoming_header
                               (GAFlightServerCallContext *context,
                                GAFlightHeaderFunc func,
                                gpointer user_data);

Iterates over all incoming headers.

Parameters

context

A GAFlightServerCallContext.

 

func

The user's callback function.

[scope call]

user_data

Data for func .

[closure]

Since: 14.0.0

gaflight_server_auth_sender_write ()

gboolean
gaflight_server_auth_sender_write (GAFlightServerAuthSender *sender,
                                   GBytes *message,
                                   GError **error);

Writes a message to the client.

Parameters

sender

A GAFlightServerAuthSender.

 

message

A GBytes to be sent.

 

error

Return location for a GError or NULL.

[nullable]

Returns

TRUE on success, FALSE on error.

Since: 12.0.0

gaflight_server_auth_reader_read ()

GBytes *
gaflight_server_auth_reader_read (GAFlightServerAuthReader *reader,
                                  GError **error);

Reads a message from the client.

Parameters

reader

A GAFlightServerAuthReader.

 

error

Return location for a GError or NULL.

[nullable]

Returns

Read data as GBytes on success, NULL on error.

[nullable][transfer full]

Since: 12.0.0

gaflight_server_custom_auth_handler_authenticate ()

void
gaflight_server_custom_auth_handler_authenticate
                               (GAFlightServerCustomAuthHandler *handler,
                                GAFlightServerCallContext *context,
                                GAFlightServerAuthSender *sender,
                                GAFlightServerAuthReader *reader,
                                GError **error);

Authenticates the client on initial connection. The server can send and read responses from the client at any time.

Parameters

handler

A GAFlightServerCustomAuthHandler.

 

context

A GAFlightServerCallContext.

 

sender

A GAFlightServerAuthSender.

 

reader

A GAFlightServerAuthReader.

 

error

Return location for a GError or NULL.

[nullable]

Since: 12.0.0

gaflight_server_custom_auth_handler_is_valid ()

GBytes *
gaflight_server_custom_auth_handler_is_valid
                               (GAFlightServerCustomAuthHandler *handler,
                                GAFlightServerCallContext *context,
                                GBytes *token,
                                GError **error);

Validates a per-call client token.

Parameters

handler

A GAFlightServerCustomAuthHandler.

 

context

A GAFlightServerCallContext.

 

token

The client token. May be the empty string if the client does not provide a token.

 

error

Return location for a GError or NULL.

[nullable]

Returns

The identity of the peer, if this authentication method supports it.

[nullable][transfer full]

Since: 12.0.0

gaflight_server_options_new ()

GAFlightServerOptions *
gaflight_server_options_new (GAFlightLocation *location);

Parameters

location

A GAFlightLocation to be listened.

 

Returns

The newly created options for a server.

Since: 5.0.0

gaflight_server_listen ()

gboolean
gaflight_server_listen (GAFlightServer *server,
                        GAFlightServerOptions *options,
                        GError **error);

Parameters

server

A GAFlightServer.

 

options

A GAFlightServerOptions.

 

error

Return location for a GError or NULL.

[nullable]

Returns

TRUE on success, FALSE on error.

Since: 5.0.0

gaflight_server_get_port ()

gint
gaflight_server_get_port (GAFlightServer *server);

gaflight_server_shutdown ()

gboolean
gaflight_server_shutdown (GAFlightServer *server,
                          GError **error);

Shuts down the serve. This function can be called from signal handler or another thread.

Parameters

server

A GAFlightServer.

 

error

Return location for a GError or NULL.

[nullable]

Returns

TRUE on success, FALSE on error.

Since: 5.0.0

gaflight_server_wait ()

gboolean
gaflight_server_wait (GAFlightServer *server,
                      GError **error);

gaflight_server_list_flights ()

GList *
gaflight_server_list_flights (GAFlightServer *server,
                              GAFlightServerCallContext *context,
                              GAFlightCriteria *criteria,
                              GError **error);

Parameters

server

A GAFlightServer.

 

context

A GAFlightServerCallContext.

 

criteria

A GAFlightCriteria.

[nullable]

error

Return location for a GError or NULL.

[nullable]

Returns

GList of GAFlightInfo on success, NULL on error.

[element-type GAFlightInfo][transfer full]

Since: 5.0.0

gaflight_server_get_flight_info ()

GAFlightInfo *
gaflight_server_get_flight_info (GAFlightServer *server,
                                 GAFlightServerCallContext *context,
                                 GAFlightDescriptor *request,
                                 GError **error);

Parameters

server

A GAFlightServer.

 

context

A GAFlightServerCallContext.

 

request

A GAFlightDescriptor.

 

error

Return location for a GError or NULL.

[nullable]

Returns

A GAFlightInfo on success, NULL on error.

[transfer full]

Since: 9.0.0

gaflight_server_do_get ()

GAFlightDataStream *
gaflight_server_do_get (GAFlightServer *server,
                        GAFlightServerCallContext *context,
                        GAFlightTicket *ticket,
                        GError **error);

Parameters

server

A GAFlightServer.

 

context

A GAFlightServerCallContext.

 

ticket

A GAFlightTicket.

 

error

Return location for a GError or NULL.

[nullable]

Returns

GAFlightDataStream on success, NULL on error.

[transfer full]

Since: 6.0.0

Types and Values

GAFLIGHT_TYPE_DATA_STREAM

#define             GAFLIGHT_TYPE_DATA_STREAM

struct GAFlightDataStreamClass

struct GAFlightDataStreamClass {
  GObjectClass parent_class;
};

GAFLIGHT_TYPE_RECORD_BATCH_STREAM

#define             GAFLIGHT_TYPE_RECORD_BATCH_STREAM

struct GAFlightRecordBatchStreamClass

struct GAFlightRecordBatchStreamClass {
  GAFlightDataStreamClass parent_class;
};

GAFLIGHT_TYPE_MESSAGE_READER

#define             GAFLIGHT_TYPE_MESSAGE_READER

struct GAFlightMessageReaderClass

struct GAFlightMessageReaderClass {
  GAFlightRecordBatchReaderClass parent_class;
};

GAFLIGHT_TYPE_SERVER_CALL_CONTEXT

#define             GAFLIGHT_TYPE_SERVER_CALL_CONTEXT

struct GAFlightServerCallContextClass

struct GAFlightServerCallContextClass {
  GObjectClass parent_class;
};

GAFLIGHT_TYPE_SERVER_AUTH_SENDER

#define             GAFLIGHT_TYPE_SERVER_AUTH_SENDER

struct GAFlightServerAuthSenderClass

struct GAFlightServerAuthSenderClass {
  GObjectClass parent_class;
};

GAFLIGHT_TYPE_SERVER_AUTH_READER

#define             GAFLIGHT_TYPE_SERVER_AUTH_READER

struct GAFlightServerAuthReaderClass

struct GAFlightServerAuthReaderClass {
  GObjectClass parent_class;
};

GAFLIGHT_TYPE_SERVER_AUTH_HANDLER

#define             GAFLIGHT_TYPE_SERVER_AUTH_HANDLER

struct GAFlightServerAuthHandlerClass

struct GAFlightServerAuthHandlerClass {
  GObjectClass parent_class;
};

GAFLIGHT_TYPE_SERVER_CUSTOM_AUTH_HANDLER

#define             GAFLIGHT_TYPE_SERVER_CUSTOM_AUTH_HANDLER

struct GAFlightServerCustomAuthHandlerClass

struct GAFlightServerCustomAuthHandlerClass {
  GAFlightServerAuthHandlerClass parent_class;

  void (*authenticate)(GAFlightServerCustomAuthHandler *handler,
                       GAFlightServerCallContext *context,
                       GAFlightServerAuthSender *sender,
                       GAFlightServerAuthReader *reader,
                       GError **error);
  GBytes *(*is_valid)(GAFlightServerCustomAuthHandler *handler,
                      GAFlightServerCallContext *context,
                      GBytes *token,
                      GError **error);
};

Members

authenticate ()

Authenticates the client on initial connection. The server can send and read responses from the client at any time.

 

is_valid ()

Validates a per-call client token.

 

Since: 12.0.0

GAFLIGHT_TYPE_SERVER_OPTIONS

#define GAFLIGHT_TYPE_SERVER_OPTIONS (gaflight_server_options_get_type())

struct GAFlightServerOptionsClass

struct GAFlightServerOptionsClass {
  GObjectClass parent_class;
};

GAFLIGHT_TYPE_SERVABLE

#define GAFLIGHT_TYPE_SERVABLE (gaflight_servable_get_type())

GAFLIGHT_TYPE_SERVER

#define GAFLIGHT_TYPE_SERVER (gaflight_server_get_type())

struct GAFlightServerClass

struct GAFlightServerClass {
  GObjectClass parent_class;

  GList *(*list_flights)(GAFlightServer *server,
                         GAFlightServerCallContext *context,
                         GAFlightCriteria *criteria,
                         GError **error);
  GAFlightInfo *(*get_flight_info)(GAFlightServer *server,
                                   GAFlightServerCallContext *context,
                                   GAFlightDescriptor *request,
                                   GError **error);
  GAFlightDataStream *(*do_get)(GAFlightServer *server,
                                GAFlightServerCallContext *context,
                                GAFlightTicket *ticket,
                                GError **error);
};

Members

list_flights ()

A virtual function to implement ListFlights API.

 

get_flight_info ()

   

do_get ()

A virtual function to implement DoGet API.

 

Since: 5.0.0

GAFlightDataStream

typedef struct _GAFlightDataStream GAFlightDataStream;

GAFlightMessageReader

typedef struct _GAFlightMessageReader GAFlightMessageReader;

GAFlightRecordBatchStream

typedef struct _GAFlightRecordBatchStream GAFlightRecordBatchStream;

GAFlightServable

typedef struct _GAFlightServable GAFlightServable;

GAFlightServableInterface

typedef struct _GAFlightServableInterface GAFlightServableInterface;

GAFlightServer

typedef struct _GAFlightServer GAFlightServer;

GAFlightServerAuthHandler

typedef struct _GAFlightServerAuthHandler GAFlightServerAuthHandler;

GAFlightServerAuthReader

typedef struct _GAFlightServerAuthReader GAFlightServerAuthReader;

GAFlightServerAuthSender

typedef struct _GAFlightServerAuthSender GAFlightServerAuthSender;

GAFlightServerCallContext

typedef struct _GAFlightServerCallContext GAFlightServerCallContext;

GAFlightServerCustomAuthHandler

typedef struct _GAFlightServerCustomAuthHandler GAFlightServerCustomAuthHandler;

GAFlightServerOptions

typedef struct _GAFlightServerOptions GAFlightServerOptions;

Property Details

The “stream” property

  “stream”                   gpointer

The raw arrow::flight::FlightDataStream *.

Owner: GAFlightDataStream

Flags: Write / Construct Only

The “reader” property

  “reader”                   GArrowRecordBatchReader *

The reader that produces record batches.

Owner: GAFlightRecordBatchStream

Flags: Read / Write / Construct Only

Since: 6.0.0

The “handler” property

  “handler”                  gpointer

The raw std::shared_ptr<arrow::flight::ServerAuthHandler>.

Owner: GAFlightServerAuthHandler

Flags: Write / Construct Only

The “reader” property

  “reader”                   gpointer

The raw arrow::flight::ServerAuthReader *.

Owner: GAFlightServerAuthReader

Flags: Write / Construct Only

The “sender” property

  “sender”                   gpointer

The raw arrow::flight::ServerAuthSender *.

Owner: GAFlightServerAuthSender

Flags: Write / Construct Only

The “call-context” property

  “call-context”             gpointer

The raw arrow::flight::ServerCallContext.

Owner: GAFlightServerCallContext

Flags: Write / Construct Only

The “auth-handler” property

  “auth-handler”             GAFlightServerAuthHandler *

The authentication handler.

Owner: GAFlightServerOptions

Flags: Read / Write

Since: 12.0.0

The “location” property

  “location”                 GAFlightLocation *

The location to be listened.

Owner: GAFlightServerOptions

Flags: Read / Write / Construct Only

Since: 5.0.0