GPUdb C++ API  Version 6.2.0.3
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 
122  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_):
123  tableName( tableName_ ),
124  sourceTableNames( sourceTableNames_ ),
125  fieldMaps( fieldMaps_ ),
126  options( options_ )
127  {
128  }
129 
130  std::string tableName;
131  std::vector<std::string> sourceTableNames;
132  std::vector<std::map<std::string, std::string> > fieldMaps;
133  std::map<std::string, std::string> options;
134  };
135 }
136 
137 namespace avro
138 {
139  template<> struct codec_traits<gpudb::MergeRecordsRequest>
140  {
141  static void encode(Encoder& e, const gpudb::MergeRecordsRequest& v)
142  {
143  ::avro::encode(e, v.tableName);
144  ::avro::encode(e, v.sourceTableNames);
145  ::avro::encode(e, v.fieldMaps);
146  ::avro::encode(e, v.options);
147  }
148 
149  static void decode(Decoder& d, gpudb::MergeRecordsRequest& v)
150  {
151  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
152  {
153  const std::vector<size_t> fo = rd->fieldOrder();
154 
155  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
156  {
157  switch (*it)
158  {
159  case 0:
160  ::avro::decode(d, v.tableName);
161  break;
162 
163  case 1:
164  ::avro::decode(d, v.sourceTableNames);
165  break;
166 
167  case 2:
168  ::avro::decode(d, v.fieldMaps);
169  break;
170 
171  case 3:
172  ::avro::decode(d, v.options);
173  break;
174 
175  default:
176  break;
177  }
178  }
179  }
180  else
181  {
182  ::avro::decode(d, v.tableName);
183  ::avro::decode(d, v.sourceTableNames);
184  ::avro::decode(d, v.fieldMaps);
185  ::avro::decode(d, v.options);
186  }
187  }
188  };
189 }
190 
191 namespace gpudb
192 {
193 
215  {
216 
222  tableName(std::string())
223  {
224  }
225 
226  std::string tableName;
227  };
228 }
229 
230 namespace avro
231 {
232  template<> struct codec_traits<gpudb::MergeRecordsResponse>
233  {
234  static void encode(Encoder& e, const gpudb::MergeRecordsResponse& v)
235  {
236  ::avro::encode(e, v.tableName);
237  }
238 
239  static void decode(Decoder& d, gpudb::MergeRecordsResponse& v)
240  {
241  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
242  {
243  const std::vector<size_t> fo = rd->fieldOrder();
244 
245  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
246  {
247  switch (*it)
248  {
249  case 0:
250  ::avro::decode(d, v.tableName);
251  break;
252 
253  default:
254  break;
255  }
256  }
257  }
258  else
259  {
260  ::avro::decode(d, v.tableName);
261  }
262  }
263  };
264 }
265 
266 #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 mergeRecords(const MergeRecordsRequest&) const.
std::vector< std::string > sourceTableNames
A set of input parameters for mergeRecords(const MergeRecordsRequest&) const.
Definition: merge_records.h:32
std::vector< std::map< std::string, std::string > > fieldMaps
MergeRecordsResponse()
Constructs a MergeRecordsResponse object with default parameter values.