summaryrefslogtreecommitdiffstats
path: root/src/arrow/c_glib/arrow-flight-glib/common.h
blob: 368fb665b47edb880176b5496962c70238a64f97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

#pragma once

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

G_BEGIN_DECLS


#define GAFLIGHT_TYPE_CRITERIA (gaflight_criteria_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightCriteria,
                         gaflight_criteria,
                         GAFLIGHT,
                         CRITERIA,
                         GObject)
struct _GAFlightCriteriaClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GAFlightCriteria *
gaflight_criteria_new(GBytes *expression);


#define GAFLIGHT_TYPE_LOCATION (gaflight_location_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightLocation,
                         gaflight_location,
                         GAFLIGHT,
                         LOCATION,
                         GObject)
struct _GAFlightLocationClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GAFlightLocation *
gaflight_location_new(const gchar *uri,
                      GError **error);

GARROW_AVAILABLE_IN_5_0
gchar *
gaflight_location_to_string(GAFlightLocation *location);

GARROW_AVAILABLE_IN_5_0
gchar *
gaflight_location_get_scheme(GAFlightLocation *location);

GARROW_AVAILABLE_IN_5_0
gboolean
gaflight_location_equal(GAFlightLocation *location,
                        GAFlightLocation *other_location);


#define GAFLIGHT_TYPE_DESCRIPTOR (gaflight_descriptor_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightDescriptor,
                         gaflight_descriptor,
                         GAFLIGHT,
                         DESCRIPTOR,
                         GObject)
struct _GAFlightDescriptorClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
gchar *
gaflight_descriptor_to_string(GAFlightDescriptor *descriptor);

GARROW_AVAILABLE_IN_5_0
gboolean
gaflight_descriptor_equal(GAFlightDescriptor *descriptor,
                          GAFlightDescriptor *other_descriptor);


#define GAFLIGHT_TYPE_PATH_DESCRIPTOR (gaflight_path_descriptor_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightPathDescriptor,
                         gaflight_path_descriptor,
                         GAFLIGHT,
                         PATH_DESCRIPTOR,
                         GAFlightDescriptor)
struct _GAFlightPathDescriptorClass
{
  GAFlightDescriptorClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GAFlightPathDescriptor *
gaflight_path_descriptor_new(const gchar **paths,
                             gsize n_paths);

GARROW_AVAILABLE_IN_5_0
gchar **
gaflight_path_descriptor_get_paths(GAFlightPathDescriptor *descriptor);


#define GAFLIGHT_TYPE_COMMAND_DESCRIPTOR (gaflight_command_descriptor_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightCommandDescriptor,
                         gaflight_command_descriptor,
                         GAFLIGHT,
                         COMMAND_DESCRIPTOR,
                         GAFlightDescriptor)
struct _GAFlightCommandDescriptorClass
{
  GAFlightDescriptorClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GAFlightCommandDescriptor *
gaflight_command_descriptor_new(const gchar *command);

GARROW_AVAILABLE_IN_5_0
gchar *
gaflight_command_descriptor_get_command(GAFlightCommandDescriptor *descriptor);


#define GAFLIGHT_TYPE_TICKET (gaflight_ticket_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightTicket,
                         gaflight_ticket,
                         GAFLIGHT,
                         TICKET,
                         GObject)
struct _GAFlightTicketClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GAFlightTicket *
gaflight_ticket_new(GBytes *data);

GARROW_AVAILABLE_IN_5_0
gboolean
gaflight_ticket_equal(GAFlightTicket *ticket,
                      GAFlightTicket *other_ticket);


#define GAFLIGHT_TYPE_ENDPOINT (gaflight_endpoint_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightEndpoint,
                         gaflight_endpoint,
                         GAFLIGHT,
                         ENDPOINT,
                         GObject)
struct _GAFlightEndpointClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GAFlightEndpoint *
gaflight_endpoint_new(GAFlightTicket *ticket,
                      GList *locations);

GARROW_AVAILABLE_IN_5_0
gboolean
gaflight_endpoint_equal(GAFlightEndpoint *endpoint,
                        GAFlightEndpoint *other_endpoint);

GARROW_AVAILABLE_IN_5_0
GList *
gaflight_endpoint_get_locations(GAFlightEndpoint *endpoint);


#define GAFLIGHT_TYPE_INFO (gaflight_info_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightInfo,
                         gaflight_info,
                         GAFLIGHT,
                         INFO,
                         GObject)
struct _GAFlightInfoClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GAFlightInfo *
gaflight_info_new(GArrowSchema *schema,
                  GAFlightDescriptor *descriptor,
                  GList *endpoints,
                  gint64 total_records,
                  gint64 total_bytes,
                  GError **error);

GARROW_AVAILABLE_IN_5_0
gboolean
gaflight_info_equal(GAFlightInfo *info,
                    GAFlightInfo *other_info);

GARROW_AVAILABLE_IN_5_0
GArrowSchema *
gaflight_info_get_schema(GAFlightInfo *info,
                         GArrowReadOptions *options,
                         GError **error);
GARROW_AVAILABLE_IN_5_0
GAFlightDescriptor *
gaflight_info_get_descriptor(GAFlightInfo *info);
GARROW_AVAILABLE_IN_5_0
GList *
gaflight_info_get_endpoints(GAFlightInfo *info);
GARROW_AVAILABLE_IN_5_0
gint64
gaflight_info_get_total_records(GAFlightInfo *info);
GARROW_AVAILABLE_IN_5_0
gint64
gaflight_info_get_total_bytes(GAFlightInfo *info);


#define GAFLIGHT_TYPE_STREAM_CHUNK (gaflight_stream_chunk_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightStreamChunk,
                         gaflight_stream_chunk,
                         GAFLIGHT,
                         STREAM_CHUNK,
                         GObject)
struct _GAFlightStreamChunkClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_6_0
GArrowRecordBatch *
gaflight_stream_chunk_get_data(GAFlightStreamChunk *chunk);
GARROW_AVAILABLE_IN_6_0
GArrowBuffer *
gaflight_stream_chunk_get_metadata(GAFlightStreamChunk *chunk);


#define GAFLIGHT_TYPE_RECORD_BATCH_READER       \
  (gaflight_record_batch_reader_get_type())
G_DECLARE_DERIVABLE_TYPE(GAFlightRecordBatchReader,
                         gaflight_record_batch_reader,
                         GAFLIGHT,
                         RECORD_BATCH_READER,
                         GObject)
struct _GAFlightRecordBatchReaderClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_6_0
GAFlightStreamChunk *
gaflight_record_batch_reader_read_next(GAFlightRecordBatchReader *reader,
                                       GError **error);

GARROW_AVAILABLE_IN_6_0
GArrowTable *
gaflight_record_batch_reader_read_all(GAFlightRecordBatchReader *reader,
                                      GError **error);


G_END_DECLS