GPUdb C++ API  Version 7.2.2.4
insert_records.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __INSERT_RECORDS_H__
7 #define __INSERT_RECORDS_H__
8 
9 namespace gpudb
10 {
36  {
41  tableName(std::string()),
42  list(std::vector<std::vector<uint8_t> >()),
43  listStr(std::vector<std::string>()),
44  listEncoding(std::string("binary")),
45  options(std::map<std::string, std::string>())
46  {
47  }
48 
260  RawInsertRecordsRequest(const std::string& tableName_, const std::vector<std::vector<uint8_t> >& list_, const std::map<std::string, std::string>& options_):
261  tableName( tableName_ ),
262  list( list_ ),
263  listStr( std::vector<std::string>() ),
264  listEncoding( "binary" ),
265  options( options_ )
266  {
267  }
268 
497  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_):
498  tableName( tableName_ ),
499  list( list_ ),
500  listStr( listStr_ ),
501  listEncoding( listEncoding_ ),
502  options( options_ )
503  {
504  }
505 
512  std::string tableName;
513 
519  std::vector<std::vector<uint8_t> > list;
520 
526  std::vector<std::string> listStr;
527 
538  std::string listEncoding;
539 
685  std::map<std::string, std::string> options;
686  };
687 } // end namespace gpudb
688 
689 namespace avro
690 {
691  template<> struct codec_traits<gpudb::RawInsertRecordsRequest>
692  {
693  static void encode(Encoder& e, const gpudb::RawInsertRecordsRequest& v)
694  {
695  ::avro::encode(e, v.tableName);
696  ::avro::encode(e, v.list);
697  ::avro::encode(e, v.listStr);
698  ::avro::encode(e, v.listEncoding);
699  ::avro::encode(e, v.options);
700  }
701 
702  static void decode(Decoder& d, gpudb::RawInsertRecordsRequest& v)
703  {
704  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
705  {
706  const std::vector<size_t> fo = rd->fieldOrder();
707 
708  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
709  {
710  switch (*it)
711  {
712  case 0:
713  ::avro::decode(d, v.tableName);
714  break;
715 
716  case 1:
717  ::avro::decode(d, v.list);
718  break;
719 
720  case 2:
721  ::avro::decode(d, v.listStr);
722  break;
723 
724  case 3:
725  ::avro::decode(d, v.listEncoding);
726  break;
727 
728  case 4:
729  ::avro::decode(d, v.options);
730  break;
731 
732  default:
733  break;
734  }
735  }
736  }
737  else
738  {
739  ::avro::decode(d, v.tableName);
740  ::avro::decode(d, v.list);
741  ::avro::decode(d, v.listStr);
742  ::avro::decode(d, v.listEncoding);
743  ::avro::decode(d, v.options);
744  }
745  }
746  };
747 } // end namespace avro
748 
749 namespace gpudb
750 {
778  template<typename T> struct InsertRecordsRequest
779  {
784  tableName(std::string()),
785  data(std::vector<T>()),
786  options(std::map<std::string, std::string>())
787  {
788  }
789 
1001  InsertRecordsRequest(const std::string& tableName_, const std::vector<T>& data_, const std::map<std::string, std::string>& options_):
1002  tableName( tableName_ ),
1003  data( data_ ),
1004  options( options_ )
1005  {
1006  }
1007 
1014  std::string tableName;
1015 
1021  std::vector<T> data;
1022 
1168  std::map<std::string, std::string> options;
1169  };
1170 } // end namespace gpudb
1171 
1172 namespace gpudb
1173 {
1180  {
1185  recordIds(std::vector<std::string>()),
1186  countInserted(int32_t()),
1187  countUpdated(int32_t()),
1188  info(std::map<std::string, std::string>())
1189  {
1190  }
1191 
1196  std::vector<std::string> recordIds;
1197 
1201  int32_t countInserted;
1202 
1206  int32_t countUpdated;
1207 
1219  std::map<std::string, std::string> info;
1220  };
1221 } // end namespace gpudb
1222 
1223 namespace avro
1224 {
1225  template<> struct codec_traits<gpudb::InsertRecordsResponse>
1226  {
1227  static void encode(Encoder& e, const gpudb::InsertRecordsResponse& v)
1228  {
1229  ::avro::encode(e, v.recordIds);
1230  ::avro::encode(e, v.countInserted);
1231  ::avro::encode(e, v.countUpdated);
1232  ::avro::encode(e, v.info);
1233  }
1234 
1235  static void decode(Decoder& d, gpudb::InsertRecordsResponse& v)
1236  {
1237  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
1238  {
1239  const std::vector<size_t> fo = rd->fieldOrder();
1240 
1241  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
1242  {
1243  switch (*it)
1244  {
1245  case 0:
1246  ::avro::decode(d, v.recordIds);
1247  break;
1248 
1249  case 1:
1250  ::avro::decode(d, v.countInserted);
1251  break;
1252 
1253  case 2:
1254  ::avro::decode(d, v.countUpdated);
1255  break;
1256 
1257  case 3:
1258  ::avro::decode(d, v.info);
1259  break;
1260 
1261  default:
1262  break;
1263  }
1264  }
1265  }
1266  else
1267  {
1268  ::avro::decode(d, v.recordIds);
1269  ::avro::decode(d, v.countInserted);
1270  ::avro::decode(d, v.countUpdated);
1271  ::avro::decode(d, v.info);
1272  }
1273  }
1274  };
1275 } // end namespace avro
1276 
1277 #endif // __INSERT_RECORDS_H__
RawInsertRecordsRequest()
Constructs a RawInsertRecordsRequest object with default parameters.
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 results returned by GPUdb::insertRecords.
std::vector< std::string > listStr
An array of JSON encoded data for the records to be added.
std::vector< std::string > recordIds
An array containing the IDs with which the added records are identified internally.
InsertRecordsRequest()
Constructs an InsertRecordsRequest object with default parameters.
std::string tableName
Name of table to which the records are to be added, in [ schema_name. ]table_name format,...
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.
int32_t countInserted
The number of records inserted.
std::string listEncoding
The encoding of the records to be inserted.
InsertRecordsResponse()
Constructs an InsertRecordsResponse object with default parameters.
std::map< std::string, std::string > options
Optional parameters.
std::map< std::string, std::string > info
Additional information.
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.
int32_t countUpdated
The number of records updated.
A set of parameters for GPUdb::insertRecords.
std::vector< std::vector< uint8_t > > list
An array of binary-encoded data for the records to be added.
std::vector< T > data
An array of binary-encoded data for the records to be added.
std::string tableName
Name of table to which the records are to be added, in [ schema_name. ]table_name format,...
std::map< std::string, std::string > options
Optional parameters.
A set of parameters for GPUdb::insertRecordsRaw.