Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1203

Support for obtaining the number of bytes written

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Workaround
    • 1.7.2
    • None
    • c++
    • None

    Description

      I've used the Avro C++ library to implement Avro support for Node.js [1].

      In the course of this, I needed to extend the library so that it keeps
      track of the number of bytes written to a stream by an encoder.

      These changes mostly required making various headers public, and only
      small changes to implementation code.

      Here's a detailed list of changes:

      • Make the following headers public:
        • BinaryEncoder.hh
        • Symbol.hh
        • ValidatingCodec.hh
        • json/JsonDom.hh
        • json/JsonEncoder.hh
        • json/JsonIO.hh
      • Extend StreamWriter to keep track of number of bytes written (bytesWritten_, getBytesWritten())
      • Expose BinaryEncoder's and JsonEncoder's StreamWriter via getStreamWriter() method

      The complete changes can be viewed here on Github:

      https://github.com/manuel/avro-cpp/commit/f77c108a04fc9e39397eb2fae86b2710b64e2c8a

      The code is available in the "manuel/avro-cpp" Github Repo on the
      "upstream_submit" branch:

      https://github.com/manuel/avro-cpp/tree/upstream_submit

      We would love to have this functionality added to the Avro C++ library.

      [1] https://github.com/collectivemedia/node-avro

      Attachments

        Activity

          People

            Unassigned Unassigned
            manuelsimoni Manuel Simoni
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: