iemejia commented on code in PR #3859:
URL: https://github.com/apache/avro/pull/3859#discussion_r3568121881


##########
lang/c++/include/avro/Decoder.hh:
##########
@@ -169,6 +169,14 @@ public:
     /// by the avro decoder. Similar set of problems occur if the Decoder
     /// consumes more than what it should.
     virtual void drain() = 0;
+
+    /// Returns the number of bytes that remain to be read from the underlying
+    /// stream, or a negative value when that count is not known (for example a
+    /// streaming source, or a decoder not backed by a byte stream). The 
default
+    /// is "unknown"; byte-stream decoders override it so a length prefix or a
+    /// collection block count that exceeds the data actually available can be
+    /// rejected before allocating for it.
+    virtual int64_t bytesRemaining() const { return -1; }

Review Comment:
   Decision: keep the virtual approach and accept the ABI bump for the next 
release. The C++ shared library's VERSION is derived from AVRO_VERSION 
(share/VERSION.txt) in CMakeLists.txt (set_target_properties ... VERSION 
${AVRO_VERSION}), so the library version already changes with each release and 
downstream consumers relink against the new version. No separate SOVERSION pin 
needs bumping. The new virtual remainingBytes()/bytesRemaining() are therefore 
acceptable here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to