GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
get_records_by_column.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 __GET_RECORDS_BY_COLUMN_H__
7 #define __GET_RECORDS_BY_COLUMN_H__
8 
9 #include "../GenericRecord.hpp"
10 
11 namespace gpudb
12 {
13 
37  {
38 
44  tableName(std::string()),
45  columnNames(std::vector<std::string>()),
46  offset(int64_t()),
47  limit(int64_t()),
48  encoding(std::string("binary")),
49  options(std::map<std::string, std::string>())
50  {
51  }
52 
104  GetRecordsByColumnRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
105  tableName( tableName_ ),
106  columnNames( columnNames_ ),
107  offset( offset_ ),
108  limit( limit_ ),
109  encoding( "binary" ),
110  options( options_ )
111  {
112  }
113 
172  GetRecordsByColumnRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const int64_t offset_, const int64_t limit_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
173  tableName( tableName_ ),
174  columnNames( columnNames_ ),
175  offset( offset_ ),
176  limit( limit_ ),
177  encoding( encoding_ ),
178  options( options_ )
179  {
180  }
181 
182  std::string tableName;
183  std::vector<std::string> columnNames;
184  int64_t offset;
185  int64_t limit;
186  std::string encoding;
187  std::map<std::string, std::string> options;
188  };
189 }
190 
191 namespace avro
192 {
193  template<> struct codec_traits<gpudb::GetRecordsByColumnRequest>
194  {
195  static void encode(Encoder& e, const gpudb::GetRecordsByColumnRequest& v)
196  {
197  ::avro::encode(e, v.tableName);
198  ::avro::encode(e, v.columnNames);
199  ::avro::encode(e, v.offset);
200  ::avro::encode(e, v.limit);
201  ::avro::encode(e, v.encoding);
202  ::avro::encode(e, v.options);
203  }
204 
205  static void decode(Decoder& d, gpudb::GetRecordsByColumnRequest& v)
206  {
207  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
208  {
209  const std::vector<size_t> fo = rd->fieldOrder();
210 
211  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
212  {
213  switch (*it)
214  {
215  case 0:
216  ::avro::decode(d, v.tableName);
217  break;
218 
219  case 1:
220  ::avro::decode(d, v.columnNames);
221  break;
222 
223  case 2:
224  ::avro::decode(d, v.offset);
225  break;
226 
227  case 3:
228  ::avro::decode(d, v.limit);
229  break;
230 
231  case 4:
232  ::avro::decode(d, v.encoding);
233  break;
234 
235  case 5:
236  ::avro::decode(d, v.options);
237  break;
238 
239  default:
240  break;
241  }
242  }
243  }
244  else
245  {
246  ::avro::decode(d, v.tableName);
247  ::avro::decode(d, v.columnNames);
248  ::avro::decode(d, v.offset);
249  ::avro::decode(d, v.limit);
250  ::avro::decode(d, v.encoding);
251  ::avro::decode(d, v.options);
252  }
253  }
254  };
255 }
256 
257 namespace gpudb
258 {
259 
283  {
284 
290  tableName(std::string()),
291  responseSchemaStr(std::string()),
292  binaryEncodedResponse(std::vector<uint8_t>()),
293  jsonEncodedResponse(std::string()),
294  totalNumberOfRecords(int64_t()),
295  hasMoreRecords(bool())
296  {
297  }
298 
299  std::string tableName;
300  std::string responseSchemaStr;
301  std::vector<uint8_t> binaryEncodedResponse;
302  std::string jsonEncodedResponse;
305  };
306 }
307 
308 namespace avro
309 {
310  template<> struct codec_traits<gpudb::RawGetRecordsByColumnResponse>
311  {
312  static void encode(Encoder& e, const gpudb::RawGetRecordsByColumnResponse& v)
313  {
314  ::avro::encode(e, v.tableName);
315  ::avro::encode(e, v.responseSchemaStr);
316  ::avro::encode(e, v.binaryEncodedResponse);
317  ::avro::encode(e, v.jsonEncodedResponse);
318  ::avro::encode(e, v.totalNumberOfRecords);
319  ::avro::encode(e, v.hasMoreRecords);
320  }
321 
322  static void decode(Decoder& d, gpudb::RawGetRecordsByColumnResponse& v)
323  {
324  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
325  {
326  const std::vector<size_t> fo = rd->fieldOrder();
327 
328  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
329  {
330  switch (*it)
331  {
332  case 0:
333  ::avro::decode(d, v.tableName);
334  break;
335 
336  case 1:
337  ::avro::decode(d, v.responseSchemaStr);
338  break;
339 
340  case 2:
341  ::avro::decode(d, v.binaryEncodedResponse);
342  break;
343 
344  case 3:
345  ::avro::decode(d, v.jsonEncodedResponse);
346  break;
347 
348  case 4:
349  ::avro::decode(d, v.totalNumberOfRecords);
350  break;
351 
352  case 5:
353  ::avro::decode(d, v.hasMoreRecords);
354  break;
355 
356  default:
357  break;
358  }
359  }
360  }
361  else
362  {
363  ::avro::decode(d, v.tableName);
364  ::avro::decode(d, v.responseSchemaStr);
365  ::avro::decode(d, v.binaryEncodedResponse);
366  ::avro::decode(d, v.jsonEncodedResponse);
367  ::avro::decode(d, v.totalNumberOfRecords);
368  ::avro::decode(d, v.hasMoreRecords);
369  }
370  }
371  };
372 }
373 
374 namespace gpudb
375 {
376 
400  {
401 
407  tableName(std::string()),
408  responseSchemaStr(std::string()),
409  data(std::vector<gpudb::GenericRecord>()),
410  totalNumberOfRecords(int64_t()),
411  hasMoreRecords(bool())
412  {
413  }
414 
415  std::string tableName;
416  std::string responseSchemaStr;
417  std::vector<gpudb::GenericRecord> data;
420  };
421 }
422 
423 #endif
A set of output parameters for const.
GetRecordsByColumnRequest()
Constructs a GetRecordsByColumnRequest object with default parameter values.
GetRecordsByColumnRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsByColumnRequest object with the specified parameters.
std::vector< gpudb::GenericRecord > data
GetRecordsByColumnResponse()
Constructs a GetRecordsByColumnResponse object with default parameter values.
GetRecordsByColumnRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const int64_t offset_, const int64_t limit_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsByColumnRequest object with the specified parameters.
A set of output parameters for const.
RawGetRecordsByColumnResponse()
Constructs a RawGetRecordsByColumnResponse object with default parameter values.
std::vector< std::string > columnNames
A set of input parameters for const.
std::map< std::string, std::string > options