GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 
98  RawInsertRecordsRequest(const std::string& tableName_, const std::vector<std::vector<uint8_t> >& list_, const std::map<std::string, std::string>& options_):
99  tableName( tableName_ ),
100  list( list_ ),
101  listStr( std::vector<std::string>() ),
102  listEncoding( "binary" ),
103  options( options_ )
104  {
105  }
106 
163  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_):
164  tableName( tableName_ ),
165  list( list_ ),
166  listStr( listStr_ ),
167  listEncoding( listEncoding_ ),
168  options( options_ )
169  {
170  }
171 
172  std::string tableName;
173  std::vector<std::vector<uint8_t> > list;
174  std::vector<std::string> listStr;
175  std::string listEncoding;
176  std::map<std::string, std::string> options;
177  };
178 }
179 
180 namespace avro
181 {
182  template<> struct codec_traits<gpudb::RawInsertRecordsRequest>
183  {
184  static void encode(Encoder& e, const gpudb::RawInsertRecordsRequest& v)
185  {
186  ::avro::encode(e, v.tableName);
187  ::avro::encode(e, v.list);
188  ::avro::encode(e, v.listStr);
189  ::avro::encode(e, v.listEncoding);
190  ::avro::encode(e, v.options);
191  }
192 
193  static void decode(Decoder& d, gpudb::RawInsertRecordsRequest& v)
194  {
195  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
196  {
197  const std::vector<size_t> fo = rd->fieldOrder();
198 
199  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
200  {
201  switch (*it)
202  {
203  case 0:
204  ::avro::decode(d, v.tableName);
205  break;
206 
207  case 1:
208  ::avro::decode(d, v.list);
209  break;
210 
211  case 2:
212  ::avro::decode(d, v.listStr);
213  break;
214 
215  case 3:
216  ::avro::decode(d, v.listEncoding);
217  break;
218 
219  case 4:
220  ::avro::decode(d, v.options);
221  break;
222 
223  default:
224  break;
225  }
226  }
227  }
228  else
229  {
230  ::avro::decode(d, v.tableName);
231  ::avro::decode(d, v.list);
232  ::avro::decode(d, v.listStr);
233  ::avro::decode(d, v.listEncoding);
234  ::avro::decode(d, v.options);
235  }
236  }
237  };
238 }
239 
240 namespace gpudb
241 {
242 
270  template<typename T> struct InsertRecordsRequest
271  {
272 
278  tableName(std::string()),
279  data(std::vector<T>()),
280  options(std::map<std::string, std::string>())
281  {
282  }
283 
330  InsertRecordsRequest(const std::string& tableName_, const std::vector<T>& data_, const std::map<std::string, std::string>& options_):
331  tableName( tableName_ ),
332  data( data_ ),
333  options( options_ )
334  {
335  }
336 
337  std::string tableName;
338  std::vector<T> data;
339  std::map<std::string, std::string> options;
340  };
341 }
342 
343 namespace gpudb
344 {
345 
371  {
372 
378  recordIds(std::vector<std::string>()),
379  countInserted(int32_t()),
380  countUpdated(int32_t())
381  {
382  }
383 
384  std::vector<std::string> recordIds;
385  int32_t countInserted;
386  int32_t countUpdated;
387  };
388 }
389 
390 namespace avro
391 {
392  template<> struct codec_traits<gpudb::InsertRecordsResponse>
393  {
394  static void encode(Encoder& e, const gpudb::InsertRecordsResponse& v)
395  {
396  ::avro::encode(e, v.recordIds);
397  ::avro::encode(e, v.countInserted);
398  ::avro::encode(e, v.countUpdated);
399  }
400 
401  static void decode(Decoder& d, gpudb::InsertRecordsResponse& v)
402  {
403  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
404  {
405  const std::vector<size_t> fo = rd->fieldOrder();
406 
407  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
408  {
409  switch (*it)
410  {
411  case 0:
412  ::avro::decode(d, v.recordIds);
413  break;
414 
415  case 1:
416  ::avro::decode(d, v.countInserted);
417  break;
418 
419  case 2:
420  ::avro::decode(d, v.countUpdated);
421  break;
422 
423  default:
424  break;
425  }
426  }
427  }
428  else
429  {
430  ::avro::decode(d, v.recordIds);
431  ::avro::decode(d, v.countInserted);
432  ::avro::decode(d, v.countUpdated);
433  }
434  }
435  };
436 }
437 
438 #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
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.