GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
31  {
32 
37  tableName(std::string()),
38  offset(int64_t()),
39  limit(int64_t()),
40  encoding(std::string("binary")),
41  options(std::map<std::string, std::string>())
42  {
43  }
44 
110  GetRecordsRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
111  tableName( tableName_ ),
112  offset( offset_ ),
113  limit( limit_ ),
114  encoding( "binary" ),
115  options( options_ )
116  {
117  }
118 
193  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_):
194  tableName( tableName_ ),
195  offset( offset_ ),
196  limit( limit_ ),
197  encoding( encoding_ ),
198  options( options_ )
199  {
200  }
201 
202  std::string tableName;
203  int64_t offset;
204  int64_t limit;
205  std::string encoding;
206  std::map<std::string, std::string> options;
207  };
208 }
209 
210 namespace avro
211 {
212  template<> struct codec_traits<gpudb::GetRecordsRequest>
213  {
214  static void encode(Encoder& e, const gpudb::GetRecordsRequest& v)
215  {
216  ::avro::encode(e, v.tableName);
217  ::avro::encode(e, v.offset);
218  ::avro::encode(e, v.limit);
219  ::avro::encode(e, v.encoding);
220  ::avro::encode(e, v.options);
221  }
222 
223  static void decode(Decoder& d, gpudb::GetRecordsRequest& v)
224  {
225  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
226  {
227  const std::vector<size_t> fo = rd->fieldOrder();
228 
229  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
230  {
231  switch (*it)
232  {
233  case 0:
234  ::avro::decode(d, v.tableName);
235  break;
236 
237  case 1:
238  ::avro::decode(d, v.offset);
239  break;
240 
241  case 2:
242  ::avro::decode(d, v.limit);
243  break;
244 
245  case 3:
246  ::avro::decode(d, v.encoding);
247  break;
248 
249  case 4:
250  ::avro::decode(d, v.options);
251  break;
252 
253  default:
254  break;
255  }
256  }
257  }
258  else
259  {
260  ::avro::decode(d, v.tableName);
261  ::avro::decode(d, v.offset);
262  ::avro::decode(d, v.limit);
263  ::avro::decode(d, v.encoding);
264  ::avro::decode(d, v.options);
265  }
266  }
267  };
268 }
269 
270 namespace gpudb
271 {
272 
292  {
293 
299  tableName(std::string()),
300  typeName(std::string()),
301  typeSchema(std::string()),
302  recordsBinary(std::vector<std::vector<uint8_t> >()),
303  recordsJson(std::vector<std::string>()),
304  totalNumberOfRecords(int64_t()),
305  hasMoreRecords(bool()),
306  info(std::map<std::string, std::string>())
307  {
308  }
309 
310  std::string tableName;
311  std::string typeName;
312  std::string typeSchema;
313  std::vector<std::vector<uint8_t> > recordsBinary;
314  std::vector<std::string> recordsJson;
317  std::map<std::string, std::string> info;
318  };
319 }
320 
321 namespace avro
322 {
323  template<> struct codec_traits<gpudb::RawGetRecordsResponse>
324  {
325  static void encode(Encoder& e, const gpudb::RawGetRecordsResponse& v)
326  {
327  ::avro::encode(e, v.tableName);
328  ::avro::encode(e, v.typeName);
329  ::avro::encode(e, v.typeSchema);
330  ::avro::encode(e, v.recordsBinary);
331  ::avro::encode(e, v.recordsJson);
332  ::avro::encode(e, v.totalNumberOfRecords);
333  ::avro::encode(e, v.hasMoreRecords);
334  ::avro::encode(e, v.info);
335  }
336 
337  static void decode(Decoder& d, gpudb::RawGetRecordsResponse& v)
338  {
339  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
340  {
341  const std::vector<size_t> fo = rd->fieldOrder();
342 
343  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
344  {
345  switch (*it)
346  {
347  case 0:
348  ::avro::decode(d, v.tableName);
349  break;
350 
351  case 1:
352  ::avro::decode(d, v.typeName);
353  break;
354 
355  case 2:
356  ::avro::decode(d, v.typeSchema);
357  break;
358 
359  case 3:
360  ::avro::decode(d, v.recordsBinary);
361  break;
362 
363  case 4:
364  ::avro::decode(d, v.recordsJson);
365  break;
366 
367  case 5:
368  ::avro::decode(d, v.totalNumberOfRecords);
369  break;
370 
371  case 6:
372  ::avro::decode(d, v.hasMoreRecords);
373  break;
374 
375  case 7:
376  ::avro::decode(d, v.info);
377  break;
378 
379  default:
380  break;
381  }
382  }
383  }
384  else
385  {
386  ::avro::decode(d, v.tableName);
387  ::avro::decode(d, v.typeName);
388  ::avro::decode(d, v.typeSchema);
389  ::avro::decode(d, v.recordsBinary);
390  ::avro::decode(d, v.recordsJson);
391  ::avro::decode(d, v.totalNumberOfRecords);
392  ::avro::decode(d, v.hasMoreRecords);
393  ::avro::decode(d, v.info);
394  }
395  }
396  };
397 }
398 
399 namespace gpudb
400 {
401 
423  template<typename T> struct GetRecordsResponse
424  {
425 
431  tableName(std::string()),
432  typeName(std::string()),
433  typeSchema(std::string()),
434  data(std::vector<T>()),
435  totalNumberOfRecords(int64_t()),
436  hasMoreRecords(bool()),
437  info(std::map<std::string, std::string>())
438  {
439  }
440 
441  std::string tableName;
442  std::string typeName;
443  std::string typeSchema;
444  std::vector<T> data;
447  std::map<std::string, std::string> info;
448  };
449 }
450 
451 #endif
std::vector< T > data
Definition: get_records.h:444
GetRecordsRequest()
Constructs a GetRecordsRequest object with default parameter values.
Definition: get_records.h:36
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:193
RawGetRecordsResponse()
Constructs a RawGetRecordsResponse object with default parameter values.
Definition: get_records.h:298
A set of output parameters for const.
Definition: get_records.h:291
A set of output parameters for const.
Definition: get_records.h:423
GetRecordsResponse()
Constructs a GetRecordsResponse object with default parameter values.
Definition: get_records.h:430
std::vector< std::string > recordsJson
Definition: get_records.h:314
std::map< std::string, std::string > info
Definition: get_records.h:317
A set of input parameters for const.
Definition: get_records.h:30
std::map< std::string, std::string > options
Definition: get_records.h:206
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:110
std::vector< std::vector< uint8_t > > recordsBinary
Definition: get_records.h:313
std::map< std::string, std::string > info
Definition: get_records.h:447