GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
get_records.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_H__
7 #define __GET_RECORDS_H__
8 
9 namespace gpudb
10 {
11 
29  {
30 
35  tableName(std::string()),
36  offset(int64_t()),
37  limit(int64_t()),
38  encoding(std::string("binary")),
39  options(std::map<std::string, std::string>())
40  {
41  }
42 
88  GetRecordsRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
89  tableName( tableName_ ),
90  offset( offset_ ),
91  limit( limit_ ),
92  encoding( "binary" ),
93  options( options_ )
94  {
95  }
96 
147  GetRecordsRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
148  tableName( tableName_ ),
149  offset( offset_ ),
150  limit( limit_ ),
151  encoding( encoding_ ),
152  options( options_ )
153  {
154  }
155 
156  std::string tableName;
157  int64_t offset;
158  int64_t limit;
159  std::string encoding;
160  std::map<std::string, std::string> options;
161  };
162 }
163 
164 namespace avro
165 {
166  template<> struct codec_traits<gpudb::GetRecordsRequest>
167  {
168  static void encode(Encoder& e, const gpudb::GetRecordsRequest& v)
169  {
170  ::avro::encode(e, v.tableName);
171  ::avro::encode(e, v.offset);
172  ::avro::encode(e, v.limit);
173  ::avro::encode(e, v.encoding);
174  ::avro::encode(e, v.options);
175  }
176 
177  static void decode(Decoder& d, gpudb::GetRecordsRequest& v)
178  {
179  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
180  {
181  const std::vector<size_t> fo = rd->fieldOrder();
182 
183  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
184  {
185  switch (*it)
186  {
187  case 0:
188  ::avro::decode(d, v.tableName);
189  break;
190 
191  case 1:
192  ::avro::decode(d, v.offset);
193  break;
194 
195  case 2:
196  ::avro::decode(d, v.limit);
197  break;
198 
199  case 3:
200  ::avro::decode(d, v.encoding);
201  break;
202 
203  case 4:
204  ::avro::decode(d, v.options);
205  break;
206 
207  default:
208  break;
209  }
210  }
211  }
212  else
213  {
214  ::avro::decode(d, v.tableName);
215  ::avro::decode(d, v.offset);
216  ::avro::decode(d, v.limit);
217  ::avro::decode(d, v.encoding);
218  ::avro::decode(d, v.options);
219  }
220  }
221  };
222 }
223 
224 namespace gpudb
225 {
226 
244  {
245 
251  tableName(std::string()),
252  typeName(std::string()),
253  typeSchema(std::string()),
254  recordsBinary(std::vector<std::vector<uint8_t> >()),
255  recordsJson(std::vector<std::string>()),
256  totalNumberOfRecords(int64_t()),
257  hasMoreRecords(bool())
258  {
259  }
260 
261  std::string tableName;
262  std::string typeName;
263  std::string typeSchema;
264  std::vector<std::vector<uint8_t> > recordsBinary;
265  std::vector<std::string> recordsJson;
268  };
269 }
270 
271 namespace avro
272 {
273  template<> struct codec_traits<gpudb::RawGetRecordsResponse>
274  {
275  static void encode(Encoder& e, const gpudb::RawGetRecordsResponse& v)
276  {
277  ::avro::encode(e, v.tableName);
278  ::avro::encode(e, v.typeName);
279  ::avro::encode(e, v.typeSchema);
280  ::avro::encode(e, v.recordsBinary);
281  ::avro::encode(e, v.recordsJson);
282  ::avro::encode(e, v.totalNumberOfRecords);
283  ::avro::encode(e, v.hasMoreRecords);
284  }
285 
286  static void decode(Decoder& d, gpudb::RawGetRecordsResponse& v)
287  {
288  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
289  {
290  const std::vector<size_t> fo = rd->fieldOrder();
291 
292  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
293  {
294  switch (*it)
295  {
296  case 0:
297  ::avro::decode(d, v.tableName);
298  break;
299 
300  case 1:
301  ::avro::decode(d, v.typeName);
302  break;
303 
304  case 2:
305  ::avro::decode(d, v.typeSchema);
306  break;
307 
308  case 3:
309  ::avro::decode(d, v.recordsBinary);
310  break;
311 
312  case 4:
313  ::avro::decode(d, v.recordsJson);
314  break;
315 
316  case 5:
317  ::avro::decode(d, v.totalNumberOfRecords);
318  break;
319 
320  case 6:
321  ::avro::decode(d, v.hasMoreRecords);
322  break;
323 
324  default:
325  break;
326  }
327  }
328  }
329  else
330  {
331  ::avro::decode(d, v.tableName);
332  ::avro::decode(d, v.typeName);
333  ::avro::decode(d, v.typeSchema);
334  ::avro::decode(d, v.recordsBinary);
335  ::avro::decode(d, v.recordsJson);
336  ::avro::decode(d, v.totalNumberOfRecords);
337  ::avro::decode(d, v.hasMoreRecords);
338  }
339  }
340  };
341 }
342 
343 namespace gpudb
344 {
345 
365  template<typename T> struct GetRecordsResponse
366  {
367 
373  tableName(std::string()),
374  typeName(std::string()),
375  typeSchema(std::string()),
376  data(std::vector<T>()),
377  totalNumberOfRecords(int64_t()),
378  hasMoreRecords(bool())
379  {
380  }
381 
382  std::string tableName;
383  std::string typeName;
384  std::string typeSchema;
385  std::vector<T> data;
388  };
389 }
390 
391 #endif
std::vector< T > data
Definition: get_records.h:385
GetRecordsRequest()
Constructs a GetRecordsRequest object with default parameter values.
Definition: get_records.h:34
GetRecordsRequest(const std::string &tableName_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsRequest object with the specified parameters.
Definition: get_records.h:147
RawGetRecordsResponse()
Constructs a RawGetRecordsResponse object with default parameter values.
Definition: get_records.h:250
A set of output parameters for const.
Definition: get_records.h:243
A set of output parameters for const.
Definition: get_records.h:365
GetRecordsResponse()
Constructs a GetRecordsResponse object with default parameter values.
Definition: get_records.h:372
std::vector< std::string > recordsJson
Definition: get_records.h:265
A set of input parameters for const.
Definition: get_records.h:28
std::map< std::string, std::string > options
Definition: get_records.h:160
GetRecordsRequest(const std::string &tableName_, const int64_t offset_, const int64_t limit_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsRequest object with the specified parameters.
Definition: get_records.h:88
std::vector< std::vector< uint8_t > > recordsBinary
Definition: get_records.h:264