6 #ifndef __CREATE_STATE_TABLE_H__
7 #define __CREATE_STATE_TABLE_H__
18 struct CreateStateTableRequest
26 CreateStateTableRequest() :
27 tableName(std::string()),
28 inputTableName(std::string()),
29 initTableName(std::string()),
30 options(std::map<std::string, std::string>())
45 CreateStateTableRequest(
const std::string& tableName_,
const std::string& inputTableName_,
const std::string& initTableName_,
const std::map<std::string, std::string>& options_):
46 tableName( tableName_ ),
47 inputTableName( inputTableName_ ),
48 initTableName( initTableName_ ),
53 std::string tableName;
54 std::string inputTableName;
55 std::string initTableName;
56 std::map<std::string, std::string> options;
66 template<>
struct codec_traits<gpudb::CreateStateTableRequest>
68 static void encode(Encoder& e,
const gpudb::CreateStateTableRequest& v)
70 ::avro::encode(e, v.tableName);
71 ::avro::encode(e, v.inputTableName);
72 ::avro::encode(e, v.initTableName);
73 ::avro::encode(e, v.options);
76 static void decode(Decoder& d, gpudb::CreateStateTableRequest& v)
78 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
80 const std::vector<size_t> fo = rd->fieldOrder();
82 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
87 ::avro::decode(d, v.tableName);
91 ::avro::decode(d, v.inputTableName);
95 ::avro::decode(d, v.initTableName);
99 ::avro::decode(d, v.options);
109 ::avro::decode(d, v.tableName);
110 ::avro::decode(d, v.inputTableName);
111 ::avro::decode(d, v.initTableName);
112 ::avro::decode(d, v.options);
127 struct CreateStateTableResponse
135 CreateStateTableResponse() :
136 tableName(std::string()),
137 info(std::map<std::string, std::string>())
141 std::string tableName;
142 std::map<std::string, std::string> info;
152 template<>
struct codec_traits<gpudb::CreateStateTableResponse>
154 static void encode(Encoder& e,
const gpudb::CreateStateTableResponse& v)
156 ::avro::encode(e, v.tableName);
157 ::avro::encode(e, v.info);
160 static void decode(Decoder& d, gpudb::CreateStateTableResponse& v)
162 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
164 const std::vector<size_t> fo = rd->fieldOrder();
166 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
171 ::avro::decode(d, v.tableName);
175 ::avro::decode(d, v.info);
185 ::avro::decode(d, v.tableName);
186 ::avro::decode(d, v.info);