GPUdb C++ API  Version 6.2.0.3
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 
38  {
39 
45  tableName(std::string()),
46  expressions(std::vector<std::string>()),
47  newValuesMaps(std::vector<std::map<std::string, boost::optional<std::string> > >()),
48  recordsToInsert(std::vector<std::vector<uint8_t> >()),
49  recordsToInsertStr(std::vector<std::string>()),
50  recordEncoding(std::string("binary")),
51  options(std::map<std::string, std::string>())
52  {
53  }
54 
137  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_):
138  tableName( tableName_ ),
139  expressions( expressions_ ),
140  newValuesMaps( newValuesMaps_ ),
141  recordsToInsert( recordsToInsert_ ),
142  recordsToInsertStr( std::vector<std::string>() ),
143  recordEncoding( "binary" ),
144  options( options_ )
145  {
146  }
147 
245  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_):
246  tableName( tableName_ ),
247  expressions( expressions_ ),
248  newValuesMaps( newValuesMaps_ ),
249  recordsToInsert( recordsToInsert_ ),
250  recordsToInsertStr( recordsToInsertStr_ ),
251  recordEncoding( recordEncoding_ ),
252  options( options_ )
253  {
254  }
255 
256  std::string tableName;
257  std::vector<std::string> expressions;
258  std::vector<std::map<std::string, boost::optional<std::string> > > newValuesMaps;
259  std::vector<std::vector<uint8_t> > recordsToInsert;
260  std::vector<std::string> recordsToInsertStr;
261  std::string recordEncoding;
262  std::map<std::string, std::string> options;
263  };
264 }
265 
266 namespace avro
267 {
268  template<> struct codec_traits<gpudb::RawUpdateRecordsRequest>
269  {
270  static void encode(Encoder& e, const gpudb::RawUpdateRecordsRequest& v)
271  {
272  ::avro::encode(e, v.tableName);
273  ::avro::encode(e, v.expressions);
274  ::avro::encode(e, v.newValuesMaps);
275  ::avro::encode(e, v.recordsToInsert);
276  ::avro::encode(e, v.recordsToInsertStr);
277  ::avro::encode(e, v.recordEncoding);
278  ::avro::encode(e, v.options);
279  }
280 
281  static void decode(Decoder& d, gpudb::RawUpdateRecordsRequest& v)
282  {
283  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
284  {
285  const std::vector<size_t> fo = rd->fieldOrder();
286 
287  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
288  {
289  switch (*it)
290  {
291  case 0:
292  ::avro::decode(d, v.tableName);
293  break;
294 
295  case 1:
296  ::avro::decode(d, v.expressions);
297  break;
298 
299  case 2:
300  ::avro::decode(d, v.newValuesMaps);
301  break;
302 
303  case 3:
304  ::avro::decode(d, v.recordsToInsert);
305  break;
306 
307  case 4:
308  ::avro::decode(d, v.recordsToInsertStr);
309  break;
310 
311  case 5:
312  ::avro::decode(d, v.recordEncoding);
313  break;
314 
315  case 6:
316  ::avro::decode(d, v.options);
317  break;
318 
319  default:
320  break;
321  }
322  }
323  }
324  else
325  {
326  ::avro::decode(d, v.tableName);
327  ::avro::decode(d, v.expressions);
328  ::avro::decode(d, v.newValuesMaps);
329  ::avro::decode(d, v.recordsToInsert);
330  ::avro::decode(d, v.recordsToInsertStr);
331  ::avro::decode(d, v.recordEncoding);
332  ::avro::decode(d, v.options);
333  }
334  }
335  };
336 }
337 
338 namespace gpudb
339 {
340 
369  template<typename T> struct UpdateRecordsRequest
370  {
371 
377  tableName(std::string()),
378  expressions(std::vector<std::string>()),
379  newValuesMaps(std::vector<std::map<std::string, boost::optional<std::string> > >()),
380  data(std::vector<T>()),
381  options(std::map<std::string, std::string>())
382  {
383  }
384 
465  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_):
466  tableName( tableName_ ),
467  expressions( expressions_ ),
468  newValuesMaps( newValuesMaps_ ),
469  data( data_ ),
470  options( options_ )
471  {
472  }
473 
474  std::string tableName;
475  std::vector<std::string> expressions;
476  std::vector<std::map<std::string, boost::optional<std::string> > > newValuesMaps;
477  std::vector<T> data;
478  std::map<std::string, std::string> options;
479  };
480 }
481 
482 namespace gpudb
483 {
484 
511  {
512 
518  countUpdated(int64_t()),
519  countsUpdated(std::vector<int64_t>()),
520  countInserted(int64_t()),
521  countsInserted(std::vector<int64_t>())
522  {
523  }
524 
525  int64_t countUpdated;
526  std::vector<int64_t> countsUpdated;
527  int64_t countInserted;
528  std::vector<int64_t> countsInserted;
529  };
530 }
531 
532 namespace avro
533 {
534  template<> struct codec_traits<gpudb::UpdateRecordsResponse>
535  {
536  static void encode(Encoder& e, const gpudb::UpdateRecordsResponse& v)
537  {
538  ::avro::encode(e, v.countUpdated);
539  ::avro::encode(e, v.countsUpdated);
540  ::avro::encode(e, v.countInserted);
541  ::avro::encode(e, v.countsInserted);
542  }
543 
544  static void decode(Decoder& d, gpudb::UpdateRecordsResponse& v)
545  {
546  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
547  {
548  const std::vector<size_t> fo = rd->fieldOrder();
549 
550  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
551  {
552  switch (*it)
553  {
554  case 0:
555  ::avro::decode(d, v.countUpdated);
556  break;
557 
558  case 1:
559  ::avro::decode(d, v.countsUpdated);
560  break;
561 
562  case 2:
563  ::avro::decode(d, v.countInserted);
564  break;
565 
566  case 3:
567  ::avro::decode(d, v.countsInserted);
568  break;
569 
570  default:
571  break;
572  }
573  }
574  }
575  else
576  {
577  ::avro::decode(d, v.countUpdated);
578  ::avro::decode(d, v.countsUpdated);
579  ::avro::decode(d, v.countInserted);
580  ::avro::decode(d, v.countsInserted);
581  }
582  }
583  };
584 }
585 
586 #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::vector< std::string > expressions
std::vector< std::string > expressions
UpdateRecordsResponse()
Constructs an UpdateRecordsResponse object with default parameter values.
A set of output parameters for updateRecordsRaw(const RawUpdateRecordsRequest&) const.
std::vector< std::map< std::string, boost::optional< std::string > > > newValuesMaps
A set of input parameters for updateRecordsRaw(const RawUpdateRecordsRequest&) const.
std::vector< std::map< std::string, boost::optional< std::string > > > newValuesMaps
A set of input parameters for updateRecordsRaw(const RawUpdateRecordsRequest&) 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.