GPUdb C++ API  Version 6.1.0.0
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 
37  {
38 
44  tableName(std::string()),
45  list(std::vector<std::vector<uint8_t> >()),
46  listStr(std::vector<std::string>()),
47  listEncoding(std::string("binary")),
48  options(std::map<std::string, std::string>())
49  {
50  }
51 
102  RawInsertRecordsRequest(const std::string& tableName_, const std::vector<std::vector<uint8_t> >& list_, const std::map<std::string, std::string>& options_):
103  tableName( tableName_ ),
104  list( list_ ),
105  listStr( std::vector<std::string>() ),
106  listEncoding( "binary" ),
107  options( options_ )
108  {
109  }
110 
173  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_):
174  tableName( tableName_ ),
175  list( list_ ),
176  listStr( listStr_ ),
177  listEncoding( listEncoding_ ),
178  options( options_ )
179  {
180  }
181 
182  std::string tableName;
183  std::vector<std::vector<uint8_t> > list;
184  std::vector<std::string> listStr;
185  std::string listEncoding;
186  std::map<std::string, std::string> options;
187  };
188 }
189 
190 namespace avro
191 {
192  template<> struct codec_traits<gpudb::RawInsertRecordsRequest>
193  {
194  static void encode(Encoder& e, const gpudb::RawInsertRecordsRequest& v)
195  {
196  ::avro::encode(e, v.tableName);
197  ::avro::encode(e, v.list);
198  ::avro::encode(e, v.listStr);
199  ::avro::encode(e, v.listEncoding);
200  ::avro::encode(e, v.options);
201  }
202 
203  static void decode(Decoder& d, gpudb::RawInsertRecordsRequest& v)
204  {
205  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
206  {
207  const std::vector<size_t> fo = rd->fieldOrder();
208 
209  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
210  {
211  switch (*it)
212  {
213  case 0:
214  ::avro::decode(d, v.tableName);
215  break;
216 
217  case 1:
218  ::avro::decode(d, v.list);
219  break;
220 
221  case 2:
222  ::avro::decode(d, v.listStr);
223  break;
224 
225  case 3:
226  ::avro::decode(d, v.listEncoding);
227  break;
228 
229  case 4:
230  ::avro::decode(d, v.options);
231  break;
232 
233  default:
234  break;
235  }
236  }
237  }
238  else
239  {
240  ::avro::decode(d, v.tableName);
241  ::avro::decode(d, v.list);
242  ::avro::decode(d, v.listStr);
243  ::avro::decode(d, v.listEncoding);
244  ::avro::decode(d, v.options);
245  }
246  }
247  };
248 }
249 
250 namespace gpudb
251 {
252 
280  template<typename T> struct InsertRecordsRequest
281  {
282 
288  tableName(std::string()),
289  data(std::vector<T>()),
290  options(std::map<std::string, std::string>())
291  {
292  }
293 
344  InsertRecordsRequest(const std::string& tableName_, const std::vector<T>& data_, const std::map<std::string, std::string>& options_):
345  tableName( tableName_ ),
346  data( data_ ),
347  options( options_ )
348  {
349  }
350 
351  std::string tableName;
352  std::vector<T> data;
353  std::map<std::string, std::string> options;
354  };
355 }
356 
357 namespace gpudb
358 {
359 
385  {
386 
392  recordIds(std::vector<std::string>()),
393  countInserted(int32_t()),
394  countUpdated(int32_t())
395  {
396  }
397 
398  std::vector<std::string> recordIds;
399  int32_t countInserted;
400  int32_t countUpdated;
401  };
402 }
403 
404 namespace avro
405 {
406  template<> struct codec_traits<gpudb::InsertRecordsResponse>
407  {
408  static void encode(Encoder& e, const gpudb::InsertRecordsResponse& v)
409  {
410  ::avro::encode(e, v.recordIds);
411  ::avro::encode(e, v.countInserted);
412  ::avro::encode(e, v.countUpdated);
413  }
414 
415  static void decode(Decoder& d, gpudb::InsertRecordsResponse& v)
416  {
417  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
418  {
419  const std::vector<size_t> fo = rd->fieldOrder();
420 
421  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
422  {
423  switch (*it)
424  {
425  case 0:
426  ::avro::decode(d, v.recordIds);
427  break;
428 
429  case 1:
430  ::avro::decode(d, v.countInserted);
431  break;
432 
433  case 2:
434  ::avro::decode(d, v.countUpdated);
435  break;
436 
437  default:
438  break;
439  }
440  }
441  }
442  else
443  {
444  ::avro::decode(d, v.recordIds);
445  ::avro::decode(d, v.countInserted);
446  ::avro::decode(d, v.countUpdated);
447  }
448  }
449  };
450 }
451 
452 #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 insertRecordsRaw(const RawInsertRecordsRequest&) 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
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 insertRecordsRaw(const RawInsertRecordsRequest&) const.
std::vector< std::vector< uint8_t > > list
std::map< std::string, std::string > options
A set of input parameters for insertRecordsRaw(const RawInsertRecordsRequest&) const.