6 #ifndef __ADMIN_REPLACE_TOM_H__ 7 #define __ADMIN_REPLACE_TOM_H__ 18 struct AdminReplaceTomRequest
26 AdminReplaceTomRequest() :
27 oldRankTom(int64_t()),
41 AdminReplaceTomRequest(
const int64_t oldRankTom_,
const int64_t newRankTom_):
42 oldRankTom( oldRankTom_ ),
43 newRankTom( newRankTom_ )
58 template<>
struct codec_traits<
gpudb::AdminReplaceTomRequest>
60 static void encode(Encoder& e,
const gpudb::AdminReplaceTomRequest& v)
62 ::avro::encode(e, v.oldRankTom);
63 ::avro::encode(e, v.newRankTom);
66 static void decode(Decoder& d, gpudb::AdminReplaceTomRequest& v)
68 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
70 const std::vector<size_t> fo = rd->fieldOrder();
72 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
77 ::avro::decode(d, v.oldRankTom);
81 ::avro::decode(d, v.newRankTom);
91 ::avro::decode(d, v.oldRankTom);
92 ::avro::decode(d, v.newRankTom);
107 struct AdminReplaceTomResponse
115 AdminReplaceTomResponse() :
116 oldRankTom(int64_t()),
117 newRankTom(int64_t())
132 template<>
struct codec_traits<
gpudb::AdminReplaceTomResponse>
134 static void encode(Encoder& e,
const gpudb::AdminReplaceTomResponse& v)
136 ::avro::encode(e, v.oldRankTom);
137 ::avro::encode(e, v.newRankTom);
140 static void decode(Decoder& d, gpudb::AdminReplaceTomResponse& v)
142 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
144 const std::vector<size_t> fo = rd->fieldOrder();
146 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
151 ::avro::decode(d, v.oldRankTom);
155 ::avro::decode(d, v.newRankTom);
165 ::avro::decode(d, v.oldRankTom);
166 ::avro::decode(d, v.newRankTom);