GPUdb C++ API  Version 7.2.2.4
update_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 __UPDATE_RECORDS_H__
7 #define __UPDATE_RECORDS_H__
8 
9 namespace gpudb
10 {
47  {
52  tableName(std::string()),
53  expressions(std::vector<std::string>()),
54  newValuesMaps(std::vector<std::map<std::string, boost::optional<std::string> > >()),
55  recordsToInsert(std::vector<std::vector<uint8_t> >()),
56  recordsToInsertStr(std::vector<std::string>()),
57  recordEncoding(std::string("binary")),
58  options(std::map<std::string, std::string>())
59  {
60  }
61 
316  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_):
317  tableName( tableName_ ),
318  expressions( expressions_ ),
319  newValuesMaps( newValuesMaps_ ),
320  recordsToInsert( recordsToInsert_ ),
321  recordsToInsertStr( std::vector<std::string>() ),
322  recordEncoding( "binary" ),
323  options( options_ )
324  {
325  }
326 
601  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_):
602  tableName( tableName_ ),
603  expressions( expressions_ ),
604  newValuesMaps( newValuesMaps_ ),
605  recordsToInsert( recordsToInsert_ ),
606  recordsToInsertStr( recordsToInsertStr_ ),
607  recordEncoding( recordEncoding_ ),
608  options( options_ )
609  {
610  }
611 
619  std::string tableName;
620 
626  std::vector<std::string> expressions;
627 
635  std::vector<std::map<std::string, boost::optional<std::string> > > newValuesMaps;
636 
644  std::vector<std::vector<uint8_t> > recordsToInsert;
645 
651  std::vector<std::string> recordsToInsertStr;
652 
664  std::string recordEncoding;
665 
821  std::map<std::string, std::string> options;
822  };
823 } // end namespace gpudb
824 
825 namespace avro
826 {
827  template<> struct codec_traits<gpudb::RawUpdateRecordsRequest>
828  {
829  static void encode(Encoder& e, const gpudb::RawUpdateRecordsRequest& v)
830  {
831  ::avro::encode(e, v.tableName);
832  ::avro::encode(e, v.expressions);
833  ::avro::encode(e, v.newValuesMaps);
834  ::avro::encode(e, v.recordsToInsert);
835  ::avro::encode(e, v.recordsToInsertStr);
836  ::avro::encode(e, v.recordEncoding);
837  ::avro::encode(e, v.options);
838  }
839 
840  static void decode(Decoder& d, gpudb::RawUpdateRecordsRequest& v)
841  {
842  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
843  {
844  const std::vector<size_t> fo = rd->fieldOrder();
845 
846  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
847  {
848  switch (*it)
849  {
850  case 0:
851  ::avro::decode(d, v.tableName);
852  break;
853 
854  case 1:
855  ::avro::decode(d, v.expressions);
856  break;
857 
858  case 2:
859  ::avro::decode(d, v.newValuesMaps);
860  break;
861 
862  case 3:
863  ::avro::decode(d, v.recordsToInsert);
864  break;
865 
866  case 4:
867  ::avro::decode(d, v.recordsToInsertStr);
868  break;
869 
870  case 5:
871  ::avro::decode(d, v.recordEncoding);
872  break;
873 
874  case 6:
875  ::avro::decode(d, v.options);
876  break;
877 
878  default:
879  break;
880  }
881  }
882  }
883  else
884  {
885  ::avro::decode(d, v.tableName);
886  ::avro::decode(d, v.expressions);
887  ::avro::decode(d, v.newValuesMaps);
888  ::avro::decode(d, v.recordsToInsert);
889  ::avro::decode(d, v.recordsToInsertStr);
890  ::avro::decode(d, v.recordEncoding);
891  ::avro::decode(d, v.options);
892  }
893  }
894  };
895 } // end namespace avro
896 
897 namespace gpudb
898 {
937  template<typename T> struct UpdateRecordsRequest
938  {
943  tableName(std::string()),
944  expressions(std::vector<std::string>()),
945  newValuesMaps(std::vector<std::map<std::string, boost::optional<std::string> > >()),
946  data(std::vector<T>()),
947  options(std::map<std::string, std::string>())
948  {
949  }
950 
1202  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_):
1203  tableName( tableName_ ),
1204  expressions( expressions_ ),
1205  newValuesMaps( newValuesMaps_ ),
1206  data( data_ ),
1207  options( options_ )
1208  {
1209  }
1210 
1218  std::string tableName;
1219 
1225  std::vector<std::string> expressions;
1226 
1234  std::vector<std::map<std::string, boost::optional<std::string> > > newValuesMaps;
1235 
1243  std::vector<T> data;
1244 
1400  std::map<std::string, std::string> options;
1401  };
1402 } // end namespace gpudb
1403 
1404 namespace gpudb
1405 {
1412  {
1417  countUpdated(int64_t()),
1418  countsUpdated(std::vector<int64_t>()),
1419  countInserted(int64_t()),
1420  countsInserted(std::vector<int64_t>()),
1421  info(std::map<std::string, std::string>())
1422  {
1423  }
1424 
1428  int64_t countUpdated;
1429 
1434  std::vector<int64_t> countsUpdated;
1435 
1440  int64_t countInserted;
1441 
1447  std::vector<int64_t> countsInserted;
1448 
1452  std::map<std::string, std::string> info;
1453  };
1454 } // end namespace gpudb
1455 
1456 namespace avro
1457 {
1458  template<> struct codec_traits<gpudb::UpdateRecordsResponse>
1459  {
1460  static void encode(Encoder& e, const gpudb::UpdateRecordsResponse& v)
1461  {
1462  ::avro::encode(e, v.countUpdated);
1463  ::avro::encode(e, v.countsUpdated);
1464  ::avro::encode(e, v.countInserted);
1465  ::avro::encode(e, v.countsInserted);
1466  ::avro::encode(e, v.info);
1467  }
1468 
1469  static void decode(Decoder& d, gpudb::UpdateRecordsResponse& v)
1470  {
1471  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
1472  {
1473  const std::vector<size_t> fo = rd->fieldOrder();
1474 
1475  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
1476  {
1477  switch (*it)
1478  {
1479  case 0:
1480  ::avro::decode(d, v.countUpdated);
1481  break;
1482 
1483  case 1:
1484  ::avro::decode(d, v.countsUpdated);
1485  break;
1486 
1487  case 2:
1488  ::avro::decode(d, v.countInserted);
1489  break;
1490 
1491  case 3:
1492  ::avro::decode(d, v.countsInserted);
1493  break;
1494 
1495  case 4:
1496  ::avro::decode(d, v.info);
1497  break;
1498 
1499  default:
1500  break;
1501  }
1502  }
1503  }
1504  else
1505  {
1506  ::avro::decode(d, v.countUpdated);
1507  ::avro::decode(d, v.countsUpdated);
1508  ::avro::decode(d, v.countInserted);
1509  ::avro::decode(d, v.countsInserted);
1510  ::avro::decode(d, v.info);
1511  }
1512  }
1513  };
1514 } // end namespace avro
1515 
1516 #endif // __UPDATE_RECORDS_H__
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
An optional list of JSON encoded objects to insert, one for each update, to be added if the particula...
int64_t countUpdated
Total number of records updated.
std::map< std::string, std::string > options
Optional parameters.
std::vector< int64_t > countsInserted
Total number of records inserted per predicate in expressions (will be either 0 or 1 for each express...
std::vector< std::vector< uint8_t > > recordsToInsert
An optional list of new binary-avro encoded records to insert, one for each update.
std::vector< int64_t > countsUpdated
Total number of records updated per predicate in expressions.
std::map< std::string, std::string > info
Additional information.
std::vector< std::string > expressions
A list of the actual predicates, one for each update; format should follow the guidelines here.
std::vector< std::string > expressions
A list of the actual predicates, one for each update; format should follow the guidelines here.
std::string recordEncoding
Identifies which of recordsToInsert and recordsToInsertStr should be used.
UpdateRecordsResponse()
Constructs an UpdateRecordsResponse object with default parameters.
A set of results returned by GPUdb::updateRecords.
std::vector< std::map< std::string, boost::optional< std::string > > > newValuesMaps
List of new values for the matching records.
int64_t countInserted
Total number of records inserted (due to expressions not matching any existing records).
A set of parameters for GPUdb::updateRecordsRaw.
std::vector< T > data
An optional list of new binary-avro encoded records to insert, one for each update.
std::vector< std::map< std::string, boost::optional< std::string > > > newValuesMaps
List of new values for the matching records.
A set of parameters for GPUdb::updateRecords.
UpdateRecordsRequest()
Constructs an UpdateRecordsRequest object with default parameters.
std::map< std::string, std::string > options
Optional parameters.
std::string tableName
Name of table to be updated, in [ schema_name. ]table_name format, using standard name resolution rul...
RawUpdateRecordsRequest()
Constructs a RawUpdateRecordsRequest object with default parameters.
std::string tableName
Name of table to be updated, in [ schema_name. ]table_name format, using standard name resolution rul...