GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
insert_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 __INSERT_RECORDS_H__
7 #define __INSERT_RECORDS_H__
8 
9 namespace gpudb
10 {
11 
38  {
39 
45  tableName(std::string()),
46  list(std::vector<std::vector<uint8_t> >()),
47  listStr(std::vector<std::string>()),
48  listEncoding(std::string("binary")),
49  options(std::map<std::string, std::string>())
50  {
51  }
52 
198  RawInsertRecordsRequest(const std::string& tableName_, const std::vector<std::vector<uint8_t> >& list_, const std::map<std::string, std::string>& options_):
199  tableName( tableName_ ),
200  list( list_ ),
201  listStr( std::vector<std::string>() ),
202  listEncoding( "binary" ),
203  options( options_ )
204  {
205  }
206 
364  RawInsertRecordsRequest(const std::string& tableName_, const std::vector<std::vector<uint8_t> >& list_, const std::vector<std::string>& listStr_, const std::string& listEncoding_, const std::map<std::string, std::string>& options_):
365  tableName( tableName_ ),
366  list( list_ ),
367  listStr( listStr_ ),
368  listEncoding( listEncoding_ ),
369  options( options_ )
370  {
371  }
372 
373  std::string tableName;
374  std::vector<std::vector<uint8_t> > list;
375  std::vector<std::string> listStr;
376  std::string listEncoding;
377  std::map<std::string, std::string> options;
378  };
379 }
380 
381 namespace avro
382 {
383  template<> struct codec_traits<gpudb::RawInsertRecordsRequest>
384  {
385  static void encode(Encoder& e, const gpudb::RawInsertRecordsRequest& v)
386  {
387  ::avro::encode(e, v.tableName);
388  ::avro::encode(e, v.list);
389  ::avro::encode(e, v.listStr);
390  ::avro::encode(e, v.listEncoding);
391  ::avro::encode(e, v.options);
392  }
393 
394  static void decode(Decoder& d, gpudb::RawInsertRecordsRequest& v)
395  {
396  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
397  {
398  const std::vector<size_t> fo = rd->fieldOrder();
399 
400  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
401  {
402  switch (*it)
403  {
404  case 0:
405  ::avro::decode(d, v.tableName);
406  break;
407 
408  case 1:
409  ::avro::decode(d, v.list);
410  break;
411 
412  case 2:
413  ::avro::decode(d, v.listStr);
414  break;
415 
416  case 3:
417  ::avro::decode(d, v.listEncoding);
418  break;
419 
420  case 4:
421  ::avro::decode(d, v.options);
422  break;
423 
424  default:
425  break;
426  }
427  }
428  }
429  else
430  {
431  ::avro::decode(d, v.tableName);
432  ::avro::decode(d, v.list);
433  ::avro::decode(d, v.listStr);
434  ::avro::decode(d, v.listEncoding);
435  ::avro::decode(d, v.options);
436  }
437  }
438  };
439 }
440 
441 namespace gpudb
442 {
443 
472  template<typename T> struct InsertRecordsRequest
473  {
474 
480  tableName(std::string()),
481  data(std::vector<T>()),
482  options(std::map<std::string, std::string>())
483  {
484  }
485 
631  InsertRecordsRequest(const std::string& tableName_, const std::vector<T>& data_, const std::map<std::string, std::string>& options_):
632  tableName( tableName_ ),
633  data( data_ ),
634  options( options_ )
635  {
636  }
637 
638  std::string tableName;
639  std::vector<T> data;
640  std::map<std::string, std::string> options;
641  };
642 }
643 
644 namespace gpudb
645 {
646 
673  {
674 
680  recordIds(std::vector<std::string>()),
681  countInserted(int32_t()),
682  countUpdated(int32_t()),
683  info(std::map<std::string, std::string>())
684  {
685  }
686 
687  std::vector<std::string> recordIds;
688  int32_t countInserted;
689  int32_t countUpdated;
690  std::map<std::string, std::string> info;
691  };
692 }
693 
694 namespace avro
695 {
696  template<> struct codec_traits<gpudb::InsertRecordsResponse>
697  {
698  static void encode(Encoder& e, const gpudb::InsertRecordsResponse& v)
699  {
700  ::avro::encode(e, v.recordIds);
701  ::avro::encode(e, v.countInserted);
702  ::avro::encode(e, v.countUpdated);
703  ::avro::encode(e, v.info);
704  }
705 
706  static void decode(Decoder& d, gpudb::InsertRecordsResponse& v)
707  {
708  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
709  {
710  const std::vector<size_t> fo = rd->fieldOrder();
711 
712  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
713  {
714  switch (*it)
715  {
716  case 0:
717  ::avro::decode(d, v.recordIds);
718  break;
719 
720  case 1:
721  ::avro::decode(d, v.countInserted);
722  break;
723 
724  case 2:
725  ::avro::decode(d, v.countUpdated);
726  break;
727 
728  case 3:
729  ::avro::decode(d, v.info);
730  break;
731 
732  default:
733  break;
734  }
735  }
736  }
737  else
738  {
739  ::avro::decode(d, v.recordIds);
740  ::avro::decode(d, v.countInserted);
741  ::avro::decode(d, v.countUpdated);
742  ::avro::decode(d, v.info);
743  }
744  }
745  };
746 }
747 
748 #endif
RawInsertRecordsRequest()
Constructs a RawInsertRecordsRequest object with default parameter values.
InsertRecordsRequest(const std::string &tableName_, const std::vector< T > &data_, const std::map< std::string, std::string > &options_)
Constructs an InsertRecordsRequest object with the specified parameters.
A set of output parameters for const.
std::vector< std::string > listStr
std::vector< std::string > recordIds
InsertRecordsRequest()
Constructs an InsertRecordsRequest object with default parameter values.
RawInsertRecordsRequest(const std::string &tableName_, const std::vector< std::vector< uint8_t > > &list_, const std::vector< std::string > &listStr_, const std::string &listEncoding_, const std::map< std::string, std::string > &options_)
Constructs a RawInsertRecordsRequest object with the specified parameters.
InsertRecordsResponse()
Constructs an InsertRecordsResponse object with default parameter values.
std::map< std::string, std::string > options
std::map< std::string, std::string > info
RawInsertRecordsRequest(const std::string &tableName_, const std::vector< std::vector< uint8_t > > &list_, const std::map< std::string, std::string > &options_)
Constructs a RawInsertRecordsRequest object with the specified parameters.
A set of input parameters for const.
std::vector< std::vector< uint8_t > > list
std::map< std::string, std::string > options
A set of input parameters for const.