Skip to content

Draft: Lazy Frame reading for TTree based I/O#953

Draft
tmadlener wants to merge 12 commits intomasterfrom
lazy-frame
Draft

Draft: Lazy Frame reading for TTree based I/O#953
tmadlener wants to merge 12 commits intomasterfrom
lazy-frame

Conversation

@tmadlener
Copy link
Copy Markdown
Collaborator

BEGINRELEASENOTES

  • Thank you for writing the text to appear in the release notes. It will show up
    exactly as it appears between the two bold lines
  • ...

ENDRELEASENOTES

This is an alternative approach to lazy reading, outlined in the comments of #949. In short this

  • Introduces a new ROOTLazyReader that produces ROOTLazyFrameData on readEntry.
  • ROOTLazyFrameData retain a reference to the reader that created them and call back to this reader whenever a getCollectionBuffers is issued to try and read the collection on demand only. The common shared state also inluces a mutex which allows to lock the necessary TTree whenever necessary.

I have lifted some of the adaptions to the DataSource from #949 (including the tests) and added a lazy flag to makeReader instead of using the readFrameLazy that was introduced there.

This currently also does some quite extensive refactoring to lift common functionality into a ReaderCommon and into a TTreeReaderCommon class as well as generalizing some of the utility functionality. If we go for this approach I would potentially lift some of that into a separate PR.

This does not yet implement the same functionality for RNTuple, but that can be added in a similar fashion.

The main advantage over #949 is that this approach allows to transparently switch readers (at least when going through the Reader), but in principle also when using the low level readers as podio::Frame(reader.readNextEntry()) will keep working even if the reader changes type and readNextEntry returns a different frame data type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants