6 #ifndef __ALTER_MODEL_H__ 7 #define __ALTER_MODEL_H__ 12 struct AlterModelRequest
15 modelName(std::string()),
16 action(std::string()),
18 options(std::map<std::string, std::string>())
22 AlterModelRequest(
const std::string& modelName_,
const std::string& action_,
const std::string& value_,
const std::map<std::string, std::string>& options_):
23 modelName( modelName_ ),
30 std::string modelName;
33 std::map<std::string, std::string> options;
39 template<>
struct codec_traits<
gpudb::AlterModelRequest>
41 static void encode(Encoder& e,
const gpudb::AlterModelRequest& v)
43 ::avro::encode(e, v.modelName);
44 ::avro::encode(e, v.action);
45 ::avro::encode(e, v.value);
46 ::avro::encode(e, v.options);
49 static void decode(Decoder& d, gpudb::AlterModelRequest& v)
51 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
53 const std::vector<size_t> fo = rd->fieldOrder();
55 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
60 ::avro::decode(d, v.modelName);
64 ::avro::decode(d, v.action);
68 ::avro::decode(d, v.value);
72 ::avro::decode(d, v.options);
82 ::avro::decode(d, v.modelName);
83 ::avro::decode(d, v.action);
84 ::avro::decode(d, v.value);
85 ::avro::decode(d, v.options);
94 struct AlterModelResponse
96 AlterModelResponse() :
97 modelName(std::string()),
98 action(std::string()),
100 info(std::map<std::string, std::string>())
104 std::string modelName;
107 std::map<std::string, std::string> info;
113 template<>
struct codec_traits<
gpudb::AlterModelResponse>
115 static void encode(Encoder& e,
const gpudb::AlterModelResponse& v)
117 ::avro::encode(e, v.modelName);
118 ::avro::encode(e, v.action);
119 ::avro::encode(e, v.value);
120 ::avro::encode(e, v.info);
123 static void decode(Decoder& d, gpudb::AlterModelResponse& v)
125 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
127 const std::vector<size_t> fo = rd->fieldOrder();
129 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
134 ::avro::decode(d, v.modelName);
138 ::avro::decode(d, v.action);
142 ::avro::decode(d, v.value);
146 ::avro::decode(d, v.info);
156 ::avro::decode(d, v.modelName);
157 ::avro::decode(d, v.action);
158 ::avro::decode(d, v.value);
159 ::avro::decode(d, v.info);
165 #endif // __ALTER_MODEL_H__