GPUdb C++ API  Version 5.2.0.0
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 
32  {
33 
38  tableName(std::string()),
39  offset(int64_t()),
40  limit(int64_t()),
41  encoding(std::string("binary")),
42  options(std::map<std::string, std::string>())
43  {
44  }
45 
77  GetRecordsRequest(const std::string& tableName, const int64_t offset, const int64_t limit, const std::map<std::string, std::string>& options):
78  tableName(tableName),
79  offset(offset),
80  limit(limit),
81  encoding("binary"),
82  options(options)
83  {
84  }
85 
120  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):
121  tableName(tableName),
122  offset(offset),
123  limit(limit),
124  encoding(encoding),
125  options(options)
126  {
127  }
128 
129  std::string tableName;
130  int64_t offset;
131  int64_t limit;
132  std::string encoding;
133  std::map<std::string, std::string> options;
134  };
135 }
136 
137 namespace avro
138 {
139  template<> struct codec_traits<gpudb::GetRecordsRequest>
140  {
141  static void encode(Encoder& e, const gpudb::GetRecordsRequest& v)
142  {
143  ::avro::encode(e, v.tableName);
144  ::avro::encode(e, v.offset);
145  ::avro::encode(e, v.limit);
146  ::avro::encode(e, v.encoding);
147  ::avro::encode(e, v.options);
148  }
149 
150  static void decode(Decoder& d, gpudb::GetRecordsRequest& v)
151  {
152  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
153  {
154  const std::vector<size_t> fo = rd->fieldOrder();
155 
156  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
157  {
158  switch (*it)
159  {
160  case 0:
161  ::avro::decode(d, v.tableName);
162  break;
163 
164  case 1:
165  ::avro::decode(d, v.offset);
166  break;
167 
168  case 2:
169  ::avro::decode(d, v.limit);
170  break;
171 
172  case 3:
173  ::avro::decode(d, v.encoding);
174  break;
175 
176  case 4:
177  ::avro::decode(d, v.options);
178  break;
179 
180  default:
181  break;
182  }
183  }
184  }
185  else
186  {
187  ::avro::decode(d, v.tableName);
188  ::avro::decode(d, v.offset);
189  ::avro::decode(d, v.limit);
190  ::avro::decode(d, v.encoding);
191  ::avro::decode(d, v.options);
192  }
193  }
194  };
195 }
196 
197 namespace gpudb
198 {
199 
220  {
221 
227  tableName(std::string()),
228  typeName(std::string()),
229  typeSchema(std::string()),
230  recordsBinary(std::vector<std::vector<uint8_t> >()),
231  recordsJson(std::vector<std::string>()),
232  totalNumberOfRecords(int64_t()),
233  hasMoreRecords(bool())
234  {
235  }
236 
237  std::string tableName;
238  std::string typeName;
239  std::string typeSchema;
240  std::vector<std::vector<uint8_t> > recordsBinary;
241  std::vector<std::string> recordsJson;
244  };
245 }
246 
247 namespace avro
248 {
249  template<> struct codec_traits<gpudb::RawGetRecordsResponse>
250  {
251  static void encode(Encoder& e, const gpudb::RawGetRecordsResponse& v)
252  {
253  ::avro::encode(e, v.tableName);
254  ::avro::encode(e, v.typeName);
255  ::avro::encode(e, v.typeSchema);
256  ::avro::encode(e, v.recordsBinary);
257  ::avro::encode(e, v.recordsJson);
258  ::avro::encode(e, v.totalNumberOfRecords);
259  ::avro::encode(e, v.hasMoreRecords);
260  }
261 
262  static void decode(Decoder& d, gpudb::RawGetRecordsResponse& v)
263  {
264  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
265  {
266  const std::vector<size_t> fo = rd->fieldOrder();
267 
268  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
269  {
270  switch (*it)
271  {
272  case 0:
273  ::avro::decode(d, v.tableName);
274  break;
275 
276  case 1:
277  ::avro::decode(d, v.typeName);
278  break;
279 
280  case 2:
281  ::avro::decode(d, v.typeSchema);
282  break;
283 
284  case 3:
285  ::avro::decode(d, v.recordsBinary);
286  break;
287 
288  case 4:
289  ::avro::decode(d, v.recordsJson);
290  break;
291 
292  case 5:
293  ::avro::decode(d, v.totalNumberOfRecords);
294  break;
295 
296  case 6:
297  ::avro::decode(d, v.hasMoreRecords);
298  break;
299 
300  default:
301  break;
302  }
303  }
304  }
305  else
306  {
307  ::avro::decode(d, v.tableName);
308  ::avro::decode(d, v.typeName);
309  ::avro::decode(d, v.typeSchema);
310  ::avro::decode(d, v.recordsBinary);
311  ::avro::decode(d, v.recordsJson);
312  ::avro::decode(d, v.totalNumberOfRecords);
313  ::avro::decode(d, v.hasMoreRecords);
314  }
315  }
316  };
317 }
318 
319 namespace gpudb
320 {
321 
344  template<typename T> struct GetRecordsResponse
345  {
346 
352  tableName(std::string()),
353  typeName(std::string()),
354  typeSchema(std::string()),
355  data(std::vector<T>()),
356  totalNumberOfRecords(int64_t()),
357  hasMoreRecords(bool())
358  {
359  }
360 
361  std::string tableName;
362  std::string typeName;
363  std::string typeSchema;
364  std::vector<T> data;
367  };
368 }
369 
370 #endif
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:120
std::vector< T > data
Definition: get_records.h:364
GetRecordsRequest()
Constructs a GetRecordsRequest object with default parameter values.
Definition: get_records.h:37
RawGetRecordsResponse()
Constructs a RawGetRecordsResponse object with default parameter values.
Definition: get_records.h:226
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:77
A set of output parameters for getRecordsRaw(const GetRecordsRequest&) const.
Definition: get_records.h:219
A set of output parameters for getRecords(const GetRecordsRequest&) const.
Definition: get_records.h:344
GetRecordsResponse()
Constructs a GetRecordsResponse object with default parameter values.
Definition: get_records.h:351
std::vector< std::string > recordsJson
Definition: get_records.h:241
A set of input parameters for getRecordsRaw(const GetRecordsRequest&) const.
Definition: get_records.h:31
std::map< std::string, std::string > options
Definition: get_records.h:133
std::vector< std::vector< uint8_t > > recordsBinary
Definition: get_records.h:240