GPUdb C++ API  Version 7.0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
merge_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 __MERGE_RECORDS_H__
7 #define __MERGE_RECORDS_H__
8 
9 namespace gpudb
10 {
11 
33  {
34 
40  tableName(std::string()),
41  sourceTableNames(std::vector<std::string>()),
42  fieldMaps(std::vector<std::map<std::string, std::string> >()),
43  options(std::map<std::string, std::string>())
44  {
45  }
46 
123  MergeRecordsRequest(const std::string& tableName_, const std::vector<std::string>& sourceTableNames_, const std::vector<std::map<std::string, std::string> >& fieldMaps_, const std::map<std::string, std::string>& options_):
124  tableName( tableName_ ),
125  sourceTableNames( sourceTableNames_ ),
126  fieldMaps( fieldMaps_ ),
127  options( options_ )
128  {
129  }
130 
131  std::string tableName;
132  std::vector<std::string> sourceTableNames;
133  std::vector<std::map<std::string, std::string> > fieldMaps;
134  std::map<std::string, std::string> options;
135  };
136 }
137 
138 namespace avro
139 {
140  template<> struct codec_traits<gpudb::MergeRecordsRequest>
141  {
142  static void encode(Encoder& e, const gpudb::MergeRecordsRequest& v)
143  {
144  ::avro::encode(e, v.tableName);
145  ::avro::encode(e, v.sourceTableNames);
146  ::avro::encode(e, v.fieldMaps);
147  ::avro::encode(e, v.options);
148  }
149 
150  static void decode(Decoder& d, gpudb::MergeRecordsRequest& 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.sourceTableNames);
166  break;
167 
168  case 2:
169  ::avro::decode(d, v.fieldMaps);
170  break;
171 
172  case 3:
173  ::avro::decode(d, v.options);
174  break;
175 
176  default:
177  break;
178  }
179  }
180  }
181  else
182  {
183  ::avro::decode(d, v.tableName);
184  ::avro::decode(d, v.sourceTableNames);
185  ::avro::decode(d, v.fieldMaps);
186  ::avro::decode(d, v.options);
187  }
188  }
189  };
190 }
191 
192 namespace gpudb
193 {
194 
216  {
217 
223  tableName(std::string()),
224  info(std::map<std::string, std::string>())
225  {
226  }
227 
228  std::string tableName;
229  std::map<std::string, std::string> info;
230  };
231 }
232 
233 namespace avro
234 {
235  template<> struct codec_traits<gpudb::MergeRecordsResponse>
236  {
237  static void encode(Encoder& e, const gpudb::MergeRecordsResponse& v)
238  {
239  ::avro::encode(e, v.tableName);
240  ::avro::encode(e, v.info);
241  }
242 
243  static void decode(Decoder& d, gpudb::MergeRecordsResponse& v)
244  {
245  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
246  {
247  const std::vector<size_t> fo = rd->fieldOrder();
248 
249  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
250  {
251  switch (*it)
252  {
253  case 0:
254  ::avro::decode(d, v.tableName);
255  break;
256 
257  case 1:
258  ::avro::decode(d, v.info);
259  break;
260 
261  default:
262  break;
263  }
264  }
265  }
266  else
267  {
268  ::avro::decode(d, v.tableName);
269  ::avro::decode(d, v.info);
270  }
271  }
272  };
273 }
274 
275 #endif
MergeRecordsRequest(const std::string &tableName_, const std::vector< std::string > &sourceTableNames_, const std::vector< std::map< std::string, std::string > > &fieldMaps_, const std::map< std::string, std::string > &options_)
Constructs a MergeRecordsRequest object with the specified parameters.
std::map< std::string, std::string > options
MergeRecordsRequest()
Constructs a MergeRecordsRequest object with default parameter values.
Definition: merge_records.h:39
A set of output parameters for const.
std::vector< std::string > sourceTableNames
A set of input parameters for const.
Definition: merge_records.h:32
std::vector< std::map< std::string, std::string > > fieldMaps
std::map< std::string, std::string > info
MergeRecordsResponse()
Constructs a MergeRecordsResponse object with default parameter values.