6 #ifndef __SHOW_MODEL_H__ 7 #define __SHOW_MODEL_H__ 12 struct ShowModelRequest
15 modelNames(std::vector<std::string>()),
16 options(std::map<std::string, std::string>())
20 ShowModelRequest(
const std::vector<std::string>& modelNames_,
const std::map<std::string, std::string>& options_):
21 modelNames( modelNames_ ),
26 std::vector<std::string> modelNames;
27 std::map<std::string, std::string> options;
33 template<>
struct codec_traits<
gpudb::ShowModelRequest>
35 static void encode(Encoder& e,
const gpudb::ShowModelRequest& v)
37 ::avro::encode(e, v.modelNames);
38 ::avro::encode(e, v.options);
41 static void decode(Decoder& d, gpudb::ShowModelRequest& v)
43 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
45 const std::vector<size_t> fo = rd->fieldOrder();
47 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
52 ::avro::decode(d, v.modelNames);
56 ::avro::decode(d, v.options);
66 ::avro::decode(d, v.modelNames);
67 ::avro::decode(d, v.options);
76 struct ShowModelResponse
79 modelNames(std::vector<std::string>()),
80 entityIds(std::vector<int32_t>()),
81 inputSchemas(std::vector<std::string>()),
82 outputSchemas(std::vector<std::string>()),
83 registryList(std::vector<std::string>()),
84 containerList(std::vector<std::string>()),
85 runFunctionList(std::vector<std::string>()),
86 deployments(std::vector<std::string>()),
87 options(std::vector<std::map<std::string, std::string> >()),
88 info(std::map<std::string, std::string>())
92 std::vector<std::string> modelNames;
93 std::vector<int32_t> entityIds;
94 std::vector<std::string> inputSchemas;
95 std::vector<std::string> outputSchemas;
96 std::vector<std::string> registryList;
97 std::vector<std::string> containerList;
98 std::vector<std::string> runFunctionList;
99 std::vector<std::string> deployments;
100 std::vector<std::map<std::string, std::string> > options;
101 std::map<std::string, std::string> info;
107 template<>
struct codec_traits<
gpudb::ShowModelResponse>
109 static void encode(Encoder& e,
const gpudb::ShowModelResponse& v)
111 ::avro::encode(e, v.modelNames);
112 ::avro::encode(e, v.entityIds);
113 ::avro::encode(e, v.inputSchemas);
114 ::avro::encode(e, v.outputSchemas);
115 ::avro::encode(e, v.registryList);
116 ::avro::encode(e, v.containerList);
117 ::avro::encode(e, v.runFunctionList);
118 ::avro::encode(e, v.deployments);
119 ::avro::encode(e, v.options);
120 ::avro::encode(e, v.info);
123 static void decode(Decoder& d, gpudb::ShowModelResponse& 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.modelNames);
138 ::avro::decode(d, v.entityIds);
142 ::avro::decode(d, v.inputSchemas);
146 ::avro::decode(d, v.outputSchemas);
150 ::avro::decode(d, v.registryList);
154 ::avro::decode(d, v.containerList);
158 ::avro::decode(d, v.runFunctionList);
162 ::avro::decode(d, v.deployments);
166 ::avro::decode(d, v.options);
170 ::avro::decode(d, v.info);
180 ::avro::decode(d, v.modelNames);
181 ::avro::decode(d, v.entityIds);
182 ::avro::decode(d, v.inputSchemas);
183 ::avro::decode(d, v.outputSchemas);
184 ::avro::decode(d, v.registryList);
185 ::avro::decode(d, v.containerList);
186 ::avro::decode(d, v.runFunctionList);
187 ::avro::decode(d, v.deployments);
188 ::avro::decode(d, v.options);
189 ::avro::decode(d, v.info);
195 #endif // __SHOW_MODEL_H__