GPUdb C++ API  Version 5.2.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 
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 
88  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):
89  tableName(tableName),
90  columnNames(columnNames),
91  offset(offset),
92  limit(limit),
93  encoding("binary"),
94  options(options)
95  {
96  }
97 
137  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):
138  tableName(tableName),
139  columnNames(columnNames),
140  offset(offset),
141  limit(limit),
142  encoding(encoding),
143  options(options)
144  {
145  }
146 
147  std::string tableName;
148  std::vector<std::string> columnNames;
149  int64_t offset;
150  int64_t limit;
151  std::string encoding;
152  std::map<std::string, std::string> options;
153  };
154 }
155 
156 namespace avro
157 {
158  template<> struct codec_traits<gpudb::GetRecordsByColumnRequest>
159  {
160  static void encode(Encoder& e, const gpudb::GetRecordsByColumnRequest& v)
161  {
162  ::avro::encode(e, v.tableName);
163  ::avro::encode(e, v.columnNames);
164  ::avro::encode(e, v.offset);
165  ::avro::encode(e, v.limit);
166  ::avro::encode(e, v.encoding);
167  ::avro::encode(e, v.options);
168  }
169 
170  static void decode(Decoder& d, gpudb::GetRecordsByColumnRequest& v)
171  {
172  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
173  {
174  const std::vector<size_t> fo = rd->fieldOrder();
175 
176  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
177  {
178  switch (*it)
179  {
180  case 0:
181  ::avro::decode(d, v.tableName);
182  break;
183 
184  case 1:
185  ::avro::decode(d, v.columnNames);
186  break;
187 
188  case 2:
189  ::avro::decode(d, v.offset);
190  break;
191 
192  case 3:
193  ::avro::decode(d, v.limit);
194  break;
195 
196  case 4:
197  ::avro::decode(d, v.encoding);
198  break;
199 
200  case 5:
201  ::avro::decode(d, v.options);
202  break;
203 
204  default:
205  break;
206  }
207  }
208  }
209  else
210  {
211  ::avro::decode(d, v.tableName);
212  ::avro::decode(d, v.columnNames);
213  ::avro::decode(d, v.offset);
214  ::avro::decode(d, v.limit);
215  ::avro::decode(d, v.encoding);
216  ::avro::decode(d, v.options);
217  }
218  }
219  };
220 }
221 
222 namespace gpudb
223 {
224 
248  {
249 
255  tableName(std::string()),
256  responseSchemaStr(std::string()),
257  binaryEncodedResponse(std::vector<uint8_t>()),
258  jsonEncodedResponse(std::string()),
259  totalNumberOfRecords(int64_t()),
260  hasMoreRecords(bool())
261  {
262  }
263 
264  std::string tableName;
265  std::string responseSchemaStr;
266  std::vector<uint8_t> binaryEncodedResponse;
267  std::string jsonEncodedResponse;
270  };
271 }
272 
273 namespace avro
274 {
275  template<> struct codec_traits<gpudb::RawGetRecordsByColumnResponse>
276  {
277  static void encode(Encoder& e, const gpudb::RawGetRecordsByColumnResponse& v)
278  {
279  ::avro::encode(e, v.tableName);
280  ::avro::encode(e, v.responseSchemaStr);
281  ::avro::encode(e, v.binaryEncodedResponse);
282  ::avro::encode(e, v.jsonEncodedResponse);
283  ::avro::encode(e, v.totalNumberOfRecords);
284  ::avro::encode(e, v.hasMoreRecords);
285  }
286 
287  static void decode(Decoder& d, gpudb::RawGetRecordsByColumnResponse& v)
288  {
289  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
290  {
291  const std::vector<size_t> fo = rd->fieldOrder();
292 
293  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
294  {
295  switch (*it)
296  {
297  case 0:
298  ::avro::decode(d, v.tableName);
299  break;
300 
301  case 1:
302  ::avro::decode(d, v.responseSchemaStr);
303  break;
304 
305  case 2:
306  ::avro::decode(d, v.binaryEncodedResponse);
307  break;
308 
309  case 3:
310  ::avro::decode(d, v.jsonEncodedResponse);
311  break;
312 
313  case 4:
314  ::avro::decode(d, v.totalNumberOfRecords);
315  break;
316 
317  case 5:
318  ::avro::decode(d, v.hasMoreRecords);
319  break;
320 
321  default:
322  break;
323  }
324  }
325  }
326  else
327  {
328  ::avro::decode(d, v.tableName);
329  ::avro::decode(d, v.responseSchemaStr);
330  ::avro::decode(d, v.binaryEncodedResponse);
331  ::avro::decode(d, v.jsonEncodedResponse);
332  ::avro::decode(d, v.totalNumberOfRecords);
333  ::avro::decode(d, v.hasMoreRecords);
334  }
335  }
336  };
337 }
338 
339 namespace gpudb
340 {
341 
365  {
366 
372  tableName(std::string()),
373  responseSchemaStr(std::string()),
374  data(std::vector<gpudb::GenericRecord>()),
375  totalNumberOfRecords(int64_t()),
376  hasMoreRecords(bool())
377  {
378  }
379 
380  std::string tableName;
381  std::string responseSchemaStr;
382  std::vector<gpudb::GenericRecord> data;
385  };
386 }
387 
388 #endif
A set of output parameters for getRecordsByColumn(const GetRecordsByColumnRequest&) const...
GetRecordsByColumnRequest()
Constructs a GetRecordsByColumnRequest object with default parameter values.
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
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.
A set of input parameters for getRecordsByColumnRaw(const GetRecordsByColumnRequest&) const...
std::map< std::string, std::string > options