GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evaluate_model.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 __EVALUATE_MODEL_H__
7 #define __EVALUATE_MODEL_H__
8 
9 namespace gpudb
10 {
11 
18  struct EvaluateModelRequest
19  {
20 
26  EvaluateModelRequest() :
27  modelName(std::string()),
28  replicas(int32_t()),
29  deploymentMode(std::string()),
30  sourceTable(std::string()),
31  destinationTable(std::string()),
32  options(std::map<std::string, std::string>())
33  {
34  }
35 
49  EvaluateModelRequest(const std::string& modelName_, const int32_t replicas_, const std::string& deploymentMode_, const std::string& sourceTable_, const std::string& destinationTable_, const std::map<std::string, std::string>& options_):
50  modelName( modelName_ ),
51  replicas( replicas_ ),
52  deploymentMode( deploymentMode_ ),
53  sourceTable( sourceTable_ ),
54  destinationTable( destinationTable_ ),
55  options( options_ )
56  {
57  }
58 
59  std::string modelName;
60  int32_t replicas;
61  std::string deploymentMode;
62  std::string sourceTable;
63  std::string destinationTable;
64  std::map<std::string, std::string> options;
65  };
66 }
67 
72 namespace avro
73 {
74  template<> struct codec_traits<gpudb::EvaluateModelRequest>
75  {
76  static void encode(Encoder& e, const gpudb::EvaluateModelRequest& v)
77  {
78  ::avro::encode(e, v.modelName);
79  ::avro::encode(e, v.replicas);
80  ::avro::encode(e, v.deploymentMode);
81  ::avro::encode(e, v.sourceTable);
82  ::avro::encode(e, v.destinationTable);
83  ::avro::encode(e, v.options);
84  }
85 
86  static void decode(Decoder& d, gpudb::EvaluateModelRequest& v)
87  {
88  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
89  {
90  const std::vector<size_t> fo = rd->fieldOrder();
91 
92  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
93  {
94  switch (*it)
95  {
96  case 0:
97  ::avro::decode(d, v.modelName);
98  break;
99 
100  case 1:
101  ::avro::decode(d, v.replicas);
102  break;
103 
104  case 2:
105  ::avro::decode(d, v.deploymentMode);
106  break;
107 
108  case 3:
109  ::avro::decode(d, v.sourceTable);
110  break;
111 
112  case 4:
113  ::avro::decode(d, v.destinationTable);
114  break;
115 
116  case 5:
117  ::avro::decode(d, v.options);
118  break;
119 
120  default:
121  break;
122  }
123  }
124  }
125  else
126  {
127  ::avro::decode(d, v.modelName);
128  ::avro::decode(d, v.replicas);
129  ::avro::decode(d, v.deploymentMode);
130  ::avro::decode(d, v.sourceTable);
131  ::avro::decode(d, v.destinationTable);
132  ::avro::decode(d, v.options);
133  }
134  }
135  };
136 }
137 
138 namespace gpudb
139 {
140 
147  struct EvaluateModelResponse
148  {
149 
155  EvaluateModelResponse() :
156  modelName(std::string()),
157  destinationTable(std::string()),
158  info(std::map<std::string, std::string>())
159  {
160  }
161 
162  std::string modelName;
163  std::string destinationTable;
164  std::map<std::string, std::string> info;
165  };
166 }
167 
172 namespace avro
173 {
174  template<> struct codec_traits<gpudb::EvaluateModelResponse>
175  {
176  static void encode(Encoder& e, const gpudb::EvaluateModelResponse& v)
177  {
178  ::avro::encode(e, v.modelName);
179  ::avro::encode(e, v.destinationTable);
180  ::avro::encode(e, v.info);
181  }
182 
183  static void decode(Decoder& d, gpudb::EvaluateModelResponse& v)
184  {
185  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
186  {
187  const std::vector<size_t> fo = rd->fieldOrder();
188 
189  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
190  {
191  switch (*it)
192  {
193  case 0:
194  ::avro::decode(d, v.modelName);
195  break;
196 
197  case 1:
198  ::avro::decode(d, v.destinationTable);
199  break;
200 
201  case 2:
202  ::avro::decode(d, v.info);
203  break;
204 
205  default:
206  break;
207  }
208  }
209  }
210  else
211  {
212  ::avro::decode(d, v.modelName);
213  ::avro::decode(d, v.destinationTable);
214  ::avro::decode(d, v.info);
215  }
216  }
217  };
218 }
219 
220 #endif