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