6 #ifndef __ADMIN_REBALANCE_H__
7 #define __ADMIN_REBALANCE_H__
22 struct AdminRebalanceRequest
30 AdminRebalanceRequest() :
31 tableNames(std::vector<std::string>()),
32 options(std::map<std::string, std::string>())
45 AdminRebalanceRequest(
const std::vector<std::string>& tableNames_,
const std::map<std::string, std::string>& options_):
46 tableNames( tableNames_ ),
55 std::vector<std::string> tableNames;
56 std::map<std::string, std::string> options;
66 template<>
struct codec_traits<gpudb::AdminRebalanceRequest>
68 static void encode(Encoder& e,
const gpudb::AdminRebalanceRequest& v)
70 ::avro::encode(e, v.tableNames);
71 ::avro::encode(e, v.options);
74 static void decode(Decoder& d, gpudb::AdminRebalanceRequest& v)
76 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
78 const std::vector<size_t> fo = rd->fieldOrder();
80 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
85 ::avro::decode(d, v.tableNames);
89 ::avro::decode(d, v.options);
99 ::avro::decode(d, v.tableNames);
100 ::avro::decode(d, v.options);
119 struct AdminRebalanceResponse
127 AdminRebalanceResponse() :
128 tableNames(std::vector<std::string>()),
129 message(std::vector<std::string>())
137 std::vector<std::string> tableNames;
138 std::vector<std::string> message;
148 template<>
struct codec_traits<gpudb::AdminRebalanceResponse>
150 static void encode(Encoder& e,
const gpudb::AdminRebalanceResponse& v)
152 ::avro::encode(e, v.tableNames);
153 ::avro::encode(e, v.message);
156 static void decode(Decoder& d, gpudb::AdminRebalanceResponse& v)
158 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
160 const std::vector<size_t> fo = rd->fieldOrder();
162 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
167 ::avro::decode(d, v.tableNames);
171 ::avro::decode(d, v.message);
181 ::avro::decode(d, v.tableNames);
182 ::avro::decode(d, v.message);