[ https://issues.apache.org/jira/browse/AVRO-1182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13568287#comment-13568287 ]
Daniel Russel commented on AVRO-1182: ------------------------------------- I attached an implementation. It can also be found at <https://github.com/drussel/avro_seek> in a slightly more browsable form. The API is slightly different than proposed, mostly due to getting correct offsets within blocks being expensive due to all the layers of buffering: DataFileReader(Base) get: /** * Returns the size of the input in bytes, or -1 if the size cannot be * determined. */ int64_t sizeBytes() const; /** * Returns the offset of the start of the current block in the file in bytes. */ int64_t blockOffsetBytes() const; /** * Seeks to the next sync mark after the provided number of bytes. * Offset is from the start of the file. */ void seekBlockBytes(size_t offset); There are some tests in the DataFileTests.cc. And InputStream has an added method /** * Returns the number of bytes remaining in the stream or -1 if * that is not available. */ virtual int64_t remainingBytes() const = 0; > DataFileReader missing seek, sync methods > ----------------------------------------- > > Key: AVRO-1182 > URL: https://issues.apache.org/jira/browse/AVRO-1182 > Project: Avro > Issue Type: Improvement > Components: c++ > Affects Versions: 1.7.3 > Reporter: Daniel Russel > Attachments: add_seek > > > The DataFileReader is missing the seek and sync methods that are found in the > java version making it hard to navigate a file except in a linear fashion. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira