6 #ifndef __DROP_MODEL_H__
7 #define __DROP_MODEL_H__
18 struct DropModelRequest
26 modelName(std::string()),
27 options(std::map<std::string, std::string>())
39 DropModelRequest(
const std::string& modelName_,
const std::map<std::string, std::string>& options_):
40 modelName( modelName_ ),
45 std::string modelName;
46 std::map<std::string, std::string> options;
56 template<>
struct codec_traits<gpudb::DropModelRequest>
58 static void encode(Encoder& e,
const gpudb::DropModelRequest& v)
60 ::avro::encode(e, v.modelName);
61 ::avro::encode(e, v.options);
64 static void decode(Decoder& d, gpudb::DropModelRequest& v)
66 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
68 const std::vector<size_t> fo = rd->fieldOrder();
70 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
75 ::avro::decode(d, v.modelName);
79 ::avro::decode(d, v.options);
89 ::avro::decode(d, v.modelName);
90 ::avro::decode(d, v.options);
105 struct DropModelResponse
112 DropModelResponse() :
113 modelName(std::string()),
114 info(std::map<std::string, std::string>())
118 std::string modelName;
119 std::map<std::string, std::string> info;
129 template<>
struct codec_traits<gpudb::DropModelResponse>
131 static void encode(Encoder& e,
const gpudb::DropModelResponse& v)
133 ::avro::encode(e, v.modelName);
134 ::avro::encode(e, v.info);
137 static void decode(Decoder& d, gpudb::DropModelResponse& v)
139 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
141 const std::vector<size_t> fo = rd->fieldOrder();
143 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
148 ::avro::decode(d, v.modelName);
152 ::avro::decode(d, v.info);
162 ::avro::decode(d, v.modelName);
163 ::avro::decode(d, v.info);