Draft: Lazy Frame reading for TTree based I/O#953
Draft
Conversation
TODO: More cleanly separate out the detail namespace contens in ROOTReader.h
Allows for easier handling of parameters with less index gynmnastics
Lift common functionality into a ReaderCommon class providing the version and datamodel information. TTree based stuff starts to move into a TTreeReaderBase
Makes re-usability better and reduces boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEGINRELEASENOTES
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
ROOTLazyReaderthat producesROOTLazyFrameDataonreadEntry.ROOTLazyFrameDataretain a reference to the reader that created them and call back to this reader whenever agetCollectionBuffersis issued to try and read the collection on demand only. The common shared state also inluces amutexwhich allows to lock the necessary TTree whenever necessary.I have lifted some of the adaptions to the
DataSourcefrom #949 (including the tests) and added alazyflag tomakeReaderinstead of using thereadFrameLazythat was introduced there.This currently also does some quite extensive refactoring to lift common functionality into a
ReaderCommonand into aTTreeReaderCommonclass 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 aspodio::Frame(reader.readNextEntry())will keep working even if thereaderchanges type andreadNextEntryreturns a different frame data type.