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 
272  RawInsertRecordsRequest(const std::string& tableName_, const std::vector<std::vector<uint8_t> >& list_, const std::map<std::string, std::string>& options_):
273  tableName( tableName_ ),
274  list( list_ ),
275  listStr( std::vector<std::string>() ),
276  listEncoding( "binary" ),
277  options( options_ )
278  {
279  }
280 
521  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_):
522  tableName( tableName_ ),
523  list( list_ ),
524  listStr( listStr_ ),
525  listEncoding( listEncoding_ ),
526  options( options_ )
527  {
528  }
529 
536  std::string tableName;
537 
543  std::vector<std::vector<uint8_t> > list;
544 
550  std::vector<std::string> listStr;
551 
562  std::string listEncoding;
563 
717  std::map<std::string, std::string> options;
718  };
719 } // end namespace gpudb
720 
721 namespace avro
722 {
723  template<> struct codec_traits<gpudb::RawInsertRecordsRequest>
724  {
725  static void encode(Encoder& e, const gpudb::RawInsertRecordsRequest& v)
726  {
727  ::avro::encode(e, v.tableName);
728  ::avro::encode(e, v.list);
729  ::avro::encode(e, v.listStr);
730  ::avro::encode(e, v.listEncoding);
731  ::avro::encode(e, v.options);
732  }
733 
734  static void decode(Decoder& d, gpudb::RawInsertRecordsRequest& v)
735  {
736  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
737  {
738  const std::vector<size_t> fo = rd->fieldOrder();
739 
740  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
741  {
742  switch (*it)
743  {
744  case 0:
745  ::avro::decode(d, v.tableName);
746  break;
747 
748  case 1:
749  ::avro::decode(d, v.list);
750  break;
751 
752  case 2:
753  ::avro::decode(d, v.listStr);
754  break;
755 
756  case 3:
757  ::avro::decode(d, v.listEncoding);
758  break;
759 
760  case 4:
761  ::avro::decode(d, v.options);
762  break;
763 
764  default:
765  break;
766  }
767  }
768  }
769  else
770  {
771  ::avro::decode(d, v.tableName);
772  ::avro::decode(d, v.list);
773  ::avro::decode(d, v.listStr);
774  ::avro::decode(d, v.listEncoding);
775  ::avro::decode(d, v.options);
776  }
777  }
778  };
779 } // end namespace avro
780 
781 namespace gpudb
782 {
810  template<typename T> struct InsertRecordsRequest
811  {
816  tableName(std::string()),
817  data(std::vector<T>()),
818  options(std::map<std::string, std::string>())
819  {
820  }
821 
1045  InsertRecordsRequest(const std::string& tableName_, const std::vector<T>& data_, const std::map<std::string, std::string>& options_):
1046  tableName( tableName_ ),
1047  data( data_ ),
1048  options( options_ )
1049  {
1050  }
1051 
1058  std::string tableName;
1059 
1065  std::vector<T> data;
1066 
1220  std::map<std::string, std::string> options;
1221  };
1222 } // end namespace gpudb
1223 
1224 namespace gpudb
1225 {
1232  {
1237  recordIds(std::vector<std::string>()),
1238  countInserted(int32_t()),
1239  countUpdated(int32_t()),
1240  info(std::map<std::string, std::string>())
1241  {
1242  }
1243 
1248  std::vector<std::string> recordIds;
1249 
1253  int32_t countInserted;
1254 
1258  int32_t countUpdated;
1259 
1271  std::map<std::string, std::string> info;
1272  };
1273 } // end namespace gpudb
1274 
1275 namespace avro
1276 {
1277  template<> struct codec_traits<gpudb::InsertRecordsResponse>
1278  {
1279  static void encode(Encoder& e, const gpudb::InsertRecordsResponse& v)
1280  {
1281  ::avro::encode(e, v.recordIds);
1282  ::avro::encode(e, v.countInserted);
1283  ::avro::encode(e, v.countUpdated);
1284  ::avro::encode(e, v.info);
1285  }
1286 
1287  static void decode(Decoder& d, gpudb::InsertRecordsResponse& v)
1288  {
1289  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
1290  {
1291  const std::vector<size_t> fo = rd->fieldOrder();
1292 
1293  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
1294  {
1295  switch (*it)
1296  {
1297  case 0:
1298  ::avro::decode(d, v.recordIds);
1299  break;
1300 
1301  case 1:
1302  ::avro::decode(d, v.countInserted);
1303  break;
1304 
1305  case 2:
1306  ::avro::decode(d, v.countUpdated);
1307  break;
1308 
1309  case 3:
1310  ::avro::decode(d, v.info);
1311  break;
1312 
1313  default:
1314  break;
1315  }
1316  }
1317  }
1318  else
1319  {
1320  ::avro::decode(d, v.recordIds);
1321  ::avro::decode(d, v.countInserted);
1322  ::avro::decode(d, v.countUpdated);
1323  ::avro::decode(d, v.info);
1324  }
1325  }
1326  };
1327 } // end namespace avro
1328 
1329 #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.