GPUdb C++ API  Version 6.1.0.0
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 
27  {
28 
34  tableName(std::string()),
35  sourceTableNames(std::vector<std::string>()),
36  fieldMaps(std::vector<std::map<std::string, std::string> >()),
37  options(std::map<std::string, std::string>())
38  {
39  }
40 
99  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_):
100  tableName( tableName_ ),
101  sourceTableNames( sourceTableNames_ ),
102  fieldMaps( fieldMaps_ ),
103  options( options_ )
104  {
105  }
106 
107  std::string tableName;
108  std::vector<std::string> sourceTableNames;
109  std::vector<std::map<std::string, std::string> > fieldMaps;
110  std::map<std::string, std::string> options;
111  };
112 }
113 
114 namespace avro
115 {
116  template<> struct codec_traits<gpudb::MergeRecordsRequest>
117  {
118  static void encode(Encoder& e, const gpudb::MergeRecordsRequest& v)
119  {
120  ::avro::encode(e, v.tableName);
121  ::avro::encode(e, v.sourceTableNames);
122  ::avro::encode(e, v.fieldMaps);
123  ::avro::encode(e, v.options);
124  }
125 
126  static void decode(Decoder& d, gpudb::MergeRecordsRequest& v)
127  {
128  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
129  {
130  const std::vector<size_t> fo = rd->fieldOrder();
131 
132  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
133  {
134  switch (*it)
135  {
136  case 0:
137  ::avro::decode(d, v.tableName);
138  break;
139 
140  case 1:
141  ::avro::decode(d, v.sourceTableNames);
142  break;
143 
144  case 2:
145  ::avro::decode(d, v.fieldMaps);
146  break;
147 
148  case 3:
149  ::avro::decode(d, v.options);
150  break;
151 
152  default:
153  break;
154  }
155  }
156  }
157  else
158  {
159  ::avro::decode(d, v.tableName);
160  ::avro::decode(d, v.sourceTableNames);
161  ::avro::decode(d, v.fieldMaps);
162  ::avro::decode(d, v.options);
163  }
164  }
165  };
166 }
167 
168 namespace gpudb
169 {
170 
186  {
187 
193  tableName(std::string())
194  {
195  }
196 
197  std::string tableName;
198  };
199 }
200 
201 namespace avro
202 {
203  template<> struct codec_traits<gpudb::MergeRecordsResponse>
204  {
205  static void encode(Encoder& e, const gpudb::MergeRecordsResponse& v)
206  {
207  ::avro::encode(e, v.tableName);
208  }
209 
210  static void decode(Decoder& d, gpudb::MergeRecordsResponse& v)
211  {
212  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
213  {
214  const std::vector<size_t> fo = rd->fieldOrder();
215 
216  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
217  {
218  switch (*it)
219  {
220  case 0:
221  ::avro::decode(d, v.tableName);
222  break;
223 
224  default:
225  break;
226  }
227  }
228  }
229  else
230  {
231  ::avro::decode(d, v.tableName);
232  }
233  }
234  };
235 }
236 
237 #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.
Definition: merge_records.h:99
std::map< std::string, std::string > options
MergeRecordsRequest()
Constructs a MergeRecordsRequest object with default parameter values.
Definition: merge_records.h:33
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:26
std::vector< std::map< std::string, std::string > > fieldMaps
MergeRecordsResponse()
Constructs a MergeRecordsResponse object with default parameter values.