You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to use the serialize function we need to convert my avro object into GenericDatum object , and to do that we need to encode the avro object and then decode it. and in order to send we need to decode the genericDatum agian, it feels like we are doing the same thing twice.
avro lib example :
std::auto_ptr<avro::OutputStream> out = avro::memoryOutputStream();
avro::EncoderPtr e = avro::binaryEncoder();
e->init(*out);
c::cpx c1;
c1.re = 100.23;
c1.im = 105.77;
avro::encode(*e, c1);
std::auto_ptr<avro::InputStream> in = avro::memoryInputStream(*out);
avro::DecoderPtr d = avro::binaryDecoder();
d->init(*in);
avro::GenericDatum datum(cpxSchema);
avro::decode(*d, datum);`
instead we can create some global function which look like that : template<typename T> ssize_t serializeAvro (Schema *schema, const T& avro, std::vector<char> &out, std::string &errstr)
since avro seralize function doesn't use any of the AvroImpl class members , this look better than the current option. any thoughts ?
The text was updated successfully, but these errors were encountered:
to use the serialize function we need to convert my avro object into GenericDatum object , and to do that we need to encode the avro object and then decode it. and in order to send we need to decode the genericDatum agian, it feels like we are doing the same thing twice.
avro lib example :
instead we can create some global function which look like that :
template<typename T> ssize_t serializeAvro (Schema *schema, const T& avro, std::vector<char> &out, std::string &errstr)
since avro seralize function doesn't use any of the AvroImpl class members , this look better than the current option. any thoughts ?
The text was updated successfully, but these errors were encountered: