GPUdb C++ API  Version 6.1.0.0
get_records.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the GPUdb schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __GET_RECORDS_H__
7 #define __GET_RECORDS_H__
8 
9 namespace gpudb
10 {
11 
29  {
30 
35  tableName(std::string()),
36  offset(int64_t()),
37  limit(int64_t()),
38  encoding(std::string("binary")),
39  options(std::map<std::string, std::string>())
40  {
41  }
42 
95  GetRecordsRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
96  tableName( tableName_ ),
97  offset( offset_ ),
98  limit( limit_ ),
99  encoding( "binary" ),
100  options( options_ )
101  {
102  }
103 
163  GetRecordsRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
164  tableName( tableName_ ),
165  offset( offset_ ),
166  limit( limit_ ),
167  encoding( encoding_ ),
168  options( options_ )
169  {
170  }
171 
172  std::string tableName;
173  int64_t offset;
174  int64_t limit;
175  std::string encoding;
176  std::map<std::string, std::string> options;
177  };
178 }
179 
180 namespace avro
181 {
182  template<> struct codec_traits<gpudb::GetRecordsRequest>
183  {
184  static void encode(Encoder& e, const gpudb::GetRecordsRequest& v)
185  {
186  ::avro::encode(e, v.tableName);
187  ::avro::encode(e, v.offset);
188  ::avro::encode(e, v.limit);
189  ::avro::encode(e, v.encoding);
190  ::avro::encode(e, v.options);
191  }
192 
193  static void decode(Decoder& d, gpudb::GetRecordsRequest& v)
194  {
195  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
196  {
197  const std::vector<size_t> fo = rd->fieldOrder();
198 
199  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
200  {
201  switch (*it)
202  {
203  case 0:
204  ::avro::decode(d, v.tableName);
205  break;
206 
207  case 1:
208  ::avro::decode(d, v.offset);
209  break;
210 
211  case 2:
212  ::avro::decode(d, v.limit);
213  break;
214 
215  case 3:
216  ::avro::decode(d, v.encoding);
217  break;
218 
219  case 4:
220  ::avro::decode(d, v.options);
221  break;
222 
223  default:
224  break;
225  }
226  }
227  }
228  else
229  {
230  ::avro::decode(d, v.tableName);
231  ::avro::decode(d, v.offset);
232  ::avro::decode(d, v.limit);
233  ::avro::decode(d, v.encoding);
234  ::avro::decode(d, v.options);
235  }
236  }
237  };
238 }
239 
240 namespace gpudb
241 {
242 
260  {
261 
267  tableName(std::string()),
268  typeName(std::string()),
269  typeSchema(std::string()),
270  recordsBinary(std::vector<std::vector<uint8_t> >()),
271  recordsJson(std::vector<std::string>()),
272  totalNumberOfRecords(int64_t()),
273  hasMoreRecords(bool())
274  {
275  }
276 
277  std::string tableName;
278  std::string typeName;
279  std::string typeSchema;
280  std::vector<std::vector<uint8_t> > recordsBinary;
281  std::vector<std::string> recordsJson;
284  };
285 }
286 
287 namespace avro
288 {
289  template<> struct codec_traits<gpudb::RawGetRecordsResponse>
290  {
291  static void encode(Encoder& e, const gpudb::RawGetRecordsResponse& v)
292  {
293  ::avro::encode(e, v.tableName);
294  ::avro::encode(e, v.typeName);
295  ::avro::encode(e, v.typeSchema);
296  ::avro::encode(e, v.recordsBinary);
297  ::avro::encode(e, v.recordsJson);
298  ::avro::encode(e, v.totalNumberOfRecords);
299  ::avro::encode(e, v.hasMoreRecords);
300  }
301 
302  static void decode(Decoder& d, gpudb::RawGetRecordsResponse& v)
303  {
304  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
305  {
306  const std::vector<size_t> fo = rd->fieldOrder();
307 
308  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
309  {
310  switch (*it)
311  {
312  case 0:
313  ::avro::decode(d, v.tableName);
314  break;
315 
316  case 1:
317  ::avro::decode(d, v.typeName);
318  break;
319 
320  case 2:
321  ::avro::decode(d, v.typeSchema);
322  break;
323 
324  case 3:
325  ::avro::decode(d, v.recordsBinary);
326  break;
327 
328  case 4:
329  ::avro::decode(d, v.recordsJson);
330  break;
331 
332  case 5:
333  ::avro::decode(d, v.totalNumberOfRecords);
334  break;
335 
336  case 6:
337  ::avro::decode(d, v.hasMoreRecords);
338  break;
339 
340  default:
341  break;
342  }
343  }
344  }
345  else
346  {
347  ::avro::decode(d, v.tableName);
348  ::avro::decode(d, v.typeName);
349  ::avro::decode(d, v.typeSchema);
350  ::avro::decode(d, v.recordsBinary);
351  ::avro::decode(d, v.recordsJson);
352  ::avro::decode(d, v.totalNumberOfRecords);
353  ::avro::decode(d, v.hasMoreRecords);
354  }
355  }
356  };
357 }
358 
359 namespace gpudb
360 {
361 
381  template<typename T> struct GetRecordsResponse
382  {
383 
389  tableName(std::string()),
390  typeName(std::string()),
391  typeSchema(std::string()),
392  data(std::vector<T>()),
393  totalNumberOfRecords(int64_t()),
394  hasMoreRecords(bool())
395  {
396  }
397 
398  std::string tableName;
399  std::string typeName;
400  std::string typeSchema;
401  std::vector<T> data;
404  };
405 }
406 
407 #endif
std::vector< T > data
Definition: get_records.h:401
GetRecordsRequest()
Constructs a GetRecordsRequest object with default parameter values.
Definition: get_records.h:34
GetRecordsRequest(const std::string &tableName_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsRequest object with the specified parameters.
Definition: get_records.h:163
RawGetRecordsResponse()
Constructs a RawGetRecordsResponse object with default parameter values.
Definition: get_records.h:266
A set of output parameters for getRecordsRaw(const GetRecordsRequest&) const.
Definition: get_records.h:259
A set of output parameters for getRecords(const GetRecordsRequest&) const.
Definition: get_records.h:381
GetRecordsResponse()
Constructs a GetRecordsResponse object with default parameter values.
Definition: get_records.h:388
std::vector< std::string > recordsJson
Definition: get_records.h:281
A set of input parameters for getRecordsRaw(const GetRecordsRequest&) const.
Definition: get_records.h:28
std::map< std::string, std::string > options
Definition: get_records.h:176
GetRecordsRequest(const std::string &tableName_, const int64_t offset_, const int64_t limit_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsRequest object with the specified parameters.
Definition: get_records.h:95
std::vector< std::vector< uint8_t > > recordsBinary
Definition: get_records.h:280