GPUdb C++ API  Version 6.1.0.0
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 
122  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_):
123  tableName( tableName_ ),
124  expressions( expressions_ ),
125  newValuesMaps( newValuesMaps_ ),
126  recordsToInsert( recordsToInsert_ ),
127  recordsToInsertStr( std::vector<std::string>() ),
128  recordEncoding( "binary" ),
129  options( options_ )
130  {
131  }
132 
215  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_):
216  tableName( tableName_ ),
217  expressions( expressions_ ),
218  newValuesMaps( newValuesMaps_ ),
219  recordsToInsert( recordsToInsert_ ),
220  recordsToInsertStr( recordsToInsertStr_ ),
221  recordEncoding( recordEncoding_ ),
222  options( options_ )
223  {
224  }
225 
226  std::string tableName;
227  std::vector<std::string> expressions;
228  std::vector<std::map<std::string, boost::optional<std::string> > > newValuesMaps;
229  std::vector<std::vector<uint8_t> > recordsToInsert;
230  std::vector<std::string> recordsToInsertStr;
231  std::string recordEncoding;
232  std::map<std::string, std::string> options;
233  };
234 }
235 
236 namespace avro
237 {
238  template<> struct codec_traits<gpudb::RawUpdateRecordsRequest>
239  {
240  static void encode(Encoder& e, const gpudb::RawUpdateRecordsRequest& v)
241  {
242  ::avro::encode(e, v.tableName);
243  ::avro::encode(e, v.expressions);
244  ::avro::encode(e, v.newValuesMaps);
245  ::avro::encode(e, v.recordsToInsert);
246  ::avro::encode(e, v.recordsToInsertStr);
247  ::avro::encode(e, v.recordEncoding);
248  ::avro::encode(e, v.options);
249  }
250 
251  static void decode(Decoder& d, gpudb::RawUpdateRecordsRequest& v)
252  {
253  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
254  {
255  const std::vector<size_t> fo = rd->fieldOrder();
256 
257  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
258  {
259  switch (*it)
260  {
261  case 0:
262  ::avro::decode(d, v.tableName);
263  break;
264 
265  case 1:
266  ::avro::decode(d, v.expressions);
267  break;
268 
269  case 2:
270  ::avro::decode(d, v.newValuesMaps);
271  break;
272 
273  case 3:
274  ::avro::decode(d, v.recordsToInsert);
275  break;
276 
277  case 4:
278  ::avro::decode(d, v.recordsToInsertStr);
279  break;
280 
281  case 5:
282  ::avro::decode(d, v.recordEncoding);
283  break;
284 
285  case 6:
286  ::avro::decode(d, v.options);
287  break;
288 
289  default:
290  break;
291  }
292  }
293  }
294  else
295  {
296  ::avro::decode(d, v.tableName);
297  ::avro::decode(d, v.expressions);
298  ::avro::decode(d, v.newValuesMaps);
299  ::avro::decode(d, v.recordsToInsert);
300  ::avro::decode(d, v.recordsToInsertStr);
301  ::avro::decode(d, v.recordEncoding);
302  ::avro::decode(d, v.options);
303  }
304  }
305  };
306 }
307 
308 namespace gpudb
309 {
310 
339  template<typename T> struct UpdateRecordsRequest
340  {
341 
347  tableName(std::string()),
348  expressions(std::vector<std::string>()),
349  newValuesMaps(std::vector<std::map<std::string, boost::optional<std::string> > >()),
350  data(std::vector<T>()),
351  options(std::map<std::string, std::string>())
352  {
353  }
354 
420  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_):
421  tableName( tableName_ ),
422  expressions( expressions_ ),
423  newValuesMaps( newValuesMaps_ ),
424  data( data_ ),
425  options( options_ )
426  {
427  }
428 
429  std::string tableName;
430  std::vector<std::string> expressions;
431  std::vector<std::map<std::string, boost::optional<std::string> > > newValuesMaps;
432  std::vector<T> data;
433  std::map<std::string, std::string> options;
434  };
435 }
436 
437 namespace gpudb
438 {
439 
466  {
467 
473  countUpdated(int64_t()),
474  countsUpdated(std::vector<int64_t>()),
475  countInserted(int64_t()),
476  countsInserted(std::vector<int64_t>())
477  {
478  }
479 
480  int64_t countUpdated;
481  std::vector<int64_t> countsUpdated;
482  int64_t countInserted;
483  std::vector<int64_t> countsInserted;
484  };
485 }
486 
487 namespace avro
488 {
489  template<> struct codec_traits<gpudb::UpdateRecordsResponse>
490  {
491  static void encode(Encoder& e, const gpudb::UpdateRecordsResponse& v)
492  {
493  ::avro::encode(e, v.countUpdated);
494  ::avro::encode(e, v.countsUpdated);
495  ::avro::encode(e, v.countInserted);
496  ::avro::encode(e, v.countsInserted);
497  }
498 
499  static void decode(Decoder& d, gpudb::UpdateRecordsResponse& v)
500  {
501  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
502  {
503  const std::vector<size_t> fo = rd->fieldOrder();
504 
505  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
506  {
507  switch (*it)
508  {
509  case 0:
510  ::avro::decode(d, v.countUpdated);
511  break;
512 
513  case 1:
514  ::avro::decode(d, v.countsUpdated);
515  break;
516 
517  case 2:
518  ::avro::decode(d, v.countInserted);
519  break;
520 
521  case 3:
522  ::avro::decode(d, v.countsInserted);
523  break;
524 
525  default:
526  break;
527  }
528  }
529  }
530  else
531  {
532  ::avro::decode(d, v.countUpdated);
533  ::avro::decode(d, v.countsUpdated);
534  ::avro::decode(d, v.countInserted);
535  ::avro::decode(d, v.countsInserted);
536  }
537  }
538  };
539 }
540 
541 #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.