GPUdb C++ API  Version 7.0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
update_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 __UPDATE_RECORDS_H__
7 #define __UPDATE_RECORDS_H__
8 
9 namespace gpudb
10 {
11 
44  {
45 
51  tableName(std::string()),
52  expressions(std::vector<std::string>()),
53  newValuesMaps(std::vector<std::map<std::string, boost::optional<std::string> > >()),
54  recordsToInsert(std::vector<std::vector<uint8_t> >()),
55  recordsToInsertStr(std::vector<std::string>()),
56  recordEncoding(std::string("binary")),
57  options(std::map<std::string, std::string>())
58  {
59  }
60 
184  RawUpdateRecordsRequest(const std::string& tableName_, const std::vector<std::string>& expressions_, const std::vector<std::map<std::string, boost::optional<std::string> > >& newValuesMaps_, const std::vector<std::vector<uint8_t> >& recordsToInsert_, const std::map<std::string, std::string>& options_):
185  tableName( tableName_ ),
186  expressions( expressions_ ),
187  newValuesMaps( newValuesMaps_ ),
188  recordsToInsert( recordsToInsert_ ),
189  recordsToInsertStr( std::vector<std::string>() ),
190  recordEncoding( "binary" ),
191  options( options_ )
192  {
193  }
194 
333  RawUpdateRecordsRequest(const std::string& tableName_, const std::vector<std::string>& expressions_, const std::vector<std::map<std::string, boost::optional<std::string> > >& newValuesMaps_, const std::vector<std::vector<uint8_t> >& recordsToInsert_, const std::vector<std::string>& recordsToInsertStr_, const std::string& recordEncoding_, const std::map<std::string, std::string>& options_):
334  tableName( tableName_ ),
335  expressions( expressions_ ),
336  newValuesMaps( newValuesMaps_ ),
337  recordsToInsert( recordsToInsert_ ),
338  recordsToInsertStr( recordsToInsertStr_ ),
339  recordEncoding( recordEncoding_ ),
340  options( options_ )
341  {
342  }
343 
344  std::string tableName;
345  std::vector<std::string> expressions;
346  std::vector<std::map<std::string, boost::optional<std::string> > > newValuesMaps;
347  std::vector<std::vector<uint8_t> > recordsToInsert;
348  std::vector<std::string> recordsToInsertStr;
349  std::string recordEncoding;
350  std::map<std::string, std::string> options;
351  };
352 }
353 
354 namespace avro
355 {
356  template<> struct codec_traits<gpudb::RawUpdateRecordsRequest>
357  {
358  static void encode(Encoder& e, const gpudb::RawUpdateRecordsRequest& v)
359  {
360  ::avro::encode(e, v.tableName);
361  ::avro::encode(e, v.expressions);
362  ::avro::encode(e, v.newValuesMaps);
363  ::avro::encode(e, v.recordsToInsert);
364  ::avro::encode(e, v.recordsToInsertStr);
365  ::avro::encode(e, v.recordEncoding);
366  ::avro::encode(e, v.options);
367  }
368 
369  static void decode(Decoder& d, gpudb::RawUpdateRecordsRequest& v)
370  {
371  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
372  {
373  const std::vector<size_t> fo = rd->fieldOrder();
374 
375  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
376  {
377  switch (*it)
378  {
379  case 0:
380  ::avro::decode(d, v.tableName);
381  break;
382 
383  case 1:
384  ::avro::decode(d, v.expressions);
385  break;
386 
387  case 2:
388  ::avro::decode(d, v.newValuesMaps);
389  break;
390 
391  case 3:
392  ::avro::decode(d, v.recordsToInsert);
393  break;
394 
395  case 4:
396  ::avro::decode(d, v.recordsToInsertStr);
397  break;
398 
399  case 5:
400  ::avro::decode(d, v.recordEncoding);
401  break;
402 
403  case 6:
404  ::avro::decode(d, v.options);
405  break;
406 
407  default:
408  break;
409  }
410  }
411  }
412  else
413  {
414  ::avro::decode(d, v.tableName);
415  ::avro::decode(d, v.expressions);
416  ::avro::decode(d, v.newValuesMaps);
417  ::avro::decode(d, v.recordsToInsert);
418  ::avro::decode(d, v.recordsToInsertStr);
419  ::avro::decode(d, v.recordEncoding);
420  ::avro::decode(d, v.options);
421  }
422  }
423  };
424 }
425 
426 namespace gpudb
427 {
428 
463  template<typename T> struct UpdateRecordsRequest
464  {
465 
471  tableName(std::string()),
472  expressions(std::vector<std::string>()),
473  newValuesMaps(std::vector<std::map<std::string, boost::optional<std::string> > >()),
474  data(std::vector<T>()),
475  options(std::map<std::string, std::string>())
476  {
477  }
478 
600  UpdateRecordsRequest(const std::string& tableName_, const std::vector<std::string>& expressions_, const std::vector<std::map<std::string, boost::optional<std::string> > >& newValuesMaps_, const std::vector<T>& data_, const std::map<std::string, std::string>& options_):
601  tableName( tableName_ ),
602  expressions( expressions_ ),
603  newValuesMaps( newValuesMaps_ ),
604  data( data_ ),
605  options( options_ )
606  {
607  }
608 
609  std::string tableName;
610  std::vector<std::string> expressions;
611  std::vector<std::map<std::string, boost::optional<std::string> > > newValuesMaps;
612  std::vector<T> data;
613  std::map<std::string, std::string> options;
614  };
615 }
616 
617 namespace gpudb
618 {
619 
652  {
653 
659  countUpdated(int64_t()),
660  countsUpdated(std::vector<int64_t>()),
661  countInserted(int64_t()),
662  countsInserted(std::vector<int64_t>()),
663  info(std::map<std::string, std::string>())
664  {
665  }
666 
667  int64_t countUpdated;
668  std::vector<int64_t> countsUpdated;
669  int64_t countInserted;
670  std::vector<int64_t> countsInserted;
671  std::map<std::string, std::string> info;
672  };
673 }
674 
675 namespace avro
676 {
677  template<> struct codec_traits<gpudb::UpdateRecordsResponse>
678  {
679  static void encode(Encoder& e, const gpudb::UpdateRecordsResponse& v)
680  {
681  ::avro::encode(e, v.countUpdated);
682  ::avro::encode(e, v.countsUpdated);
683  ::avro::encode(e, v.countInserted);
684  ::avro::encode(e, v.countsInserted);
685  ::avro::encode(e, v.info);
686  }
687 
688  static void decode(Decoder& d, gpudb::UpdateRecordsResponse& v)
689  {
690  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
691  {
692  const std::vector<size_t> fo = rd->fieldOrder();
693 
694  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
695  {
696  switch (*it)
697  {
698  case 0:
699  ::avro::decode(d, v.countUpdated);
700  break;
701 
702  case 1:
703  ::avro::decode(d, v.countsUpdated);
704  break;
705 
706  case 2:
707  ::avro::decode(d, v.countInserted);
708  break;
709 
710  case 3:
711  ::avro::decode(d, v.countsInserted);
712  break;
713 
714  case 4:
715  ::avro::decode(d, v.info);
716  break;
717 
718  default:
719  break;
720  }
721  }
722  }
723  else
724  {
725  ::avro::decode(d, v.countUpdated);
726  ::avro::decode(d, v.countsUpdated);
727  ::avro::decode(d, v.countInserted);
728  ::avro::decode(d, v.countsInserted);
729  ::avro::decode(d, v.info);
730  }
731  }
732  };
733 }
734 
735 #endif
UpdateRecordsRequest(const std::string &tableName_, const std::vector< std::string > &expressions_, const std::vector< std::map< std::string, boost::optional< std::string > > > &newValuesMaps_, const std::vector< T > &data_, const std::map< std::string, std::string > &options_)
Constructs an UpdateRecordsRequest object with the specified parameters.
RawUpdateRecordsRequest(const std::string &tableName_, const std::vector< std::string > &expressions_, const std::vector< std::map< std::string, boost::optional< std::string > > > &newValuesMaps_, const std::vector< std::vector< uint8_t > > &recordsToInsert_, const std::map< std::string, std::string > &options_)
Constructs a RawUpdateRecordsRequest object with the specified parameters.
RawUpdateRecordsRequest(const std::string &tableName_, const std::vector< std::string > &expressions_, const std::vector< std::map< std::string, boost::optional< std::string > > > &newValuesMaps_, const std::vector< std::vector< uint8_t > > &recordsToInsert_, const std::vector< std::string > &recordsToInsertStr_, const std::string &recordEncoding_, const std::map< std::string, std::string > &options_)
Constructs a RawUpdateRecordsRequest object with the specified parameters.
std::vector< std::string > recordsToInsertStr
std::map< std::string, std::string > options
std::vector< int64_t > countsInserted
std::vector< std::vector< uint8_t > > recordsToInsert
std::vector< int64_t > countsUpdated
std::map< std::string, std::string > info
std::vector< std::string > expressions
std::vector< std::string > expressions
UpdateRecordsResponse()
Constructs an UpdateRecordsResponse object with default parameter values.
A set of output parameters for const.
std::vector< std::map< std::string, boost::optional< std::string > > > newValuesMaps
A set of input parameters for const.
std::vector< std::map< std::string, boost::optional< std::string > > > newValuesMaps
A set of input parameters for const.
UpdateRecordsRequest()
Constructs an UpdateRecordsRequest object with default parameter values.
std::map< std::string, std::string > options
RawUpdateRecordsRequest()
Constructs a RawUpdateRecordsRequest object with default parameter values.