6 #ifndef __ALTER_MODEL_H__
7 #define __ALTER_MODEL_H__
18 struct AlterModelRequest
27 modelName(std::string()),
28 action(std::string()),
30 options(std::map<std::string, std::string>())
51 AlterModelRequest(
const std::string& modelName_,
const std::string& action_,
const std::string& value_,
const std::map<std::string, std::string>& options_):
52 modelName( modelName_ ),
59 std::string modelName;
62 std::map<std::string, std::string> options;
72 template<>
struct codec_traits<gpudb::AlterModelRequest>
74 static void encode(Encoder& e,
const gpudb::AlterModelRequest& v)
76 ::avro::encode(e, v.modelName);
77 ::avro::encode(e, v.action);
78 ::avro::encode(e, v.value);
79 ::avro::encode(e, v.options);
82 static void decode(Decoder& d, gpudb::AlterModelRequest& v)
84 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
86 const std::vector<size_t> fo = rd->fieldOrder();
88 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
93 ::avro::decode(d, v.modelName);
97 ::avro::decode(d, v.action);
101 ::avro::decode(d, v.value);
105 ::avro::decode(d, v.options);
115 ::avro::decode(d, v.modelName);
116 ::avro::decode(d, v.action);
117 ::avro::decode(d, v.value);
118 ::avro::decode(d, v.options);
133 struct AlterModelResponse
141 AlterModelResponse() :
142 modelName(std::string()),
143 action(std::string()),
144 value(std::string()),
145 info(std::map<std::string, std::string>())
149 std::string modelName;
152 std::map<std::string, std::string> info;
162 template<>
struct codec_traits<gpudb::AlterModelResponse>
164 static void encode(Encoder& e,
const gpudb::AlterModelResponse& v)
166 ::avro::encode(e, v.modelName);
167 ::avro::encode(e, v.action);
168 ::avro::encode(e, v.value);
169 ::avro::encode(e, v.info);
172 static void decode(Decoder& d, gpudb::AlterModelResponse& v)
174 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
176 const std::vector<size_t> fo = rd->fieldOrder();
178 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
183 ::avro::decode(d, v.modelName);
187 ::avro::decode(d, v.action);
191 ::avro::decode(d, v.value);
195 ::avro::decode(d, v.info);
205 ::avro::decode(d, v.modelName);
206 ::avro::decode(d, v.action);
207 ::avro::decode(d, v.value);
208 ::avro::decode(d, v.info);