6 #ifndef __CREATE_STATE_TABLE_H__ 7 #define __CREATE_STATE_TABLE_H__ 12 struct CreateStateTableRequest
14 CreateStateTableRequest() :
15 tableName(std::string()),
16 inputTableName(std::string()),
17 initTableName(std::string()),
18 options(std::map<std::string, std::string>())
22 CreateStateTableRequest(
const std::string& tableName_,
const std::string& inputTableName_,
const std::string& initTableName_,
const std::map<std::string, std::string>& options_):
23 tableName( tableName_ ),
24 inputTableName( inputTableName_ ),
25 initTableName( initTableName_ ),
30 std::string tableName;
31 std::string inputTableName;
32 std::string initTableName;
33 std::map<std::string, std::string> options;
39 template<>
struct codec_traits<
gpudb::CreateStateTableRequest>
41 static void encode(Encoder& e,
const gpudb::CreateStateTableRequest& v)
43 ::avro::encode(e, v.tableName);
44 ::avro::encode(e, v.inputTableName);
45 ::avro::encode(e, v.initTableName);
46 ::avro::encode(e, v.options);
49 static void decode(Decoder& d, gpudb::CreateStateTableRequest& 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.tableName);
64 ::avro::decode(d, v.inputTableName);
68 ::avro::decode(d, v.initTableName);
72 ::avro::decode(d, v.options);
82 ::avro::decode(d, v.tableName);
83 ::avro::decode(d, v.inputTableName);
84 ::avro::decode(d, v.initTableName);
85 ::avro::decode(d, v.options);
94 struct CreateStateTableResponse
96 CreateStateTableResponse() :
97 tableName(std::string()),
98 info(std::map<std::string, std::string>())
102 std::string tableName;
103 std::map<std::string, std::string> info;
109 template<>
struct codec_traits<
gpudb::CreateStateTableResponse>
111 static void encode(Encoder& e,
const gpudb::CreateStateTableResponse& v)
113 ::avro::encode(e, v.tableName);
114 ::avro::encode(e, v.info);
117 static void decode(Decoder& d, gpudb::CreateStateTableResponse& v)
119 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
121 const std::vector<size_t> fo = rd->fieldOrder();
123 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
128 ::avro::decode(d, v.tableName);
132 ::avro::decode(d, v.info);
142 ::avro::decode(d, v.tableName);
143 ::avro::decode(d, v.info);
149 #endif // __CREATE_STATE_TABLE_H__