-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[ntuple] Some cleanups in the page source #22391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jblomer
wants to merge
7
commits into
root-project:master
Choose a base branch
from
jblomer:ntuple-cleanup-loadpage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c834482
[ntuple] RPageStorage::RClusterInfo --> RPageSummary
jblomer 8e4fa79
[ntuple] remove unneeded 2nd page cache lookup in LoadPageImpl
jblomer 7b3023f
[ntuple] remove unneeded parameter from RPageSource::LoadPageImpl()
jblomer 38094ea
[ntuple] factor out loading of zero pages
jblomer 8f8a27e
[ntuple] factor out common code in LoadSealedPage()
jblomer 9df13e0
[ntuple] remove EDaosMapping
jblomer 26fff4b
[ntuple] return page (not page ref) from LoadPageImpl()
jblomer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -567,6 +567,16 @@ The page source also gives access to the ntuple's metadata. | |||||
| */ | ||||||
| // clang-format on | ||||||
| class RPageSource : public RPageStorage { | ||||||
| protected: | ||||||
| /// Summarizes meta-data is necessary to load a certain page. Used by LoadPageImpl(). | ||||||
| struct RPageSummary { | ||||||
| ROOT::DescriptorId_t fClusterId = 0; | ||||||
| /// The first element number of the page's column in the given cluster | ||||||
| std::uint64_t fColumnOffset = 0; | ||||||
| /// Location of the page on disk | ||||||
| ROOT::RClusterDescriptor::RPageInfoExtended fPageInfo; | ||||||
| }; | ||||||
|
|
||||||
| public: | ||||||
| /// Used in SetEntryRange / GetEntryRange | ||||||
| struct REntryRange { | ||||||
|
|
@@ -640,6 +650,9 @@ private: | |||||
| /// Must not be called when the descriptor guard is taken. | ||||||
| void UpdateLastUsedCluster(ROOT::DescriptorId_t clusterId); | ||||||
|
|
||||||
| // Common treatment of zero pages that would otherwise needed to be handled in LoadPageImpl() | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ROOT::Internal::RPageRef LoadZeroPage(ColumnHandle_t columnHandle, const RPageSummary &pageSummary); | ||||||
|
|
||||||
| protected: | ||||||
| /// Default I/O performance counters that get registered in `fMetrics` | ||||||
| struct RCounters { | ||||||
|
|
@@ -693,16 +706,6 @@ protected: | |||||
| } | ||||||
| }; | ||||||
|
|
||||||
| /// Summarizes cluster-level information that are necessary to load a certain page. | ||||||
| /// Used by LoadPageImpl(). | ||||||
| struct RClusterInfo { | ||||||
| ROOT::DescriptorId_t fClusterId = 0; | ||||||
| /// Location of the page on disk | ||||||
| ROOT::RClusterDescriptor::RPageInfoExtended fPageInfo; | ||||||
| /// The first element number of the page's column in the given cluster | ||||||
| std::uint64_t fColumnOffset = 0; | ||||||
| }; | ||||||
|
|
||||||
| std::unique_ptr<RCounters> fCounters; | ||||||
|
|
||||||
| ROOT::RNTupleReadOptions fOptions; | ||||||
|
|
@@ -726,9 +729,11 @@ protected: | |||||
| virtual std::unique_ptr<RPageSource> CloneImpl() const = 0; | ||||||
| // Only called if a task scheduler is set. No-op be default. | ||||||
| virtual void UnzipClusterImpl(ROOT::Internal::RCluster *cluster); | ||||||
| // Returns a page from storage if not found in the page pool. Should be able to handle zero page locators. | ||||||
| virtual ROOT::Internal::RPageRef | ||||||
| LoadPageImpl(ColumnHandle_t columnHandle, const RClusterInfo &clusterInfo, ROOT::NTupleSize_t idxInCluster) = 0; | ||||||
| // Returns a page from storage if not found in the page pool. Will never receive requests for zero pages. | ||||||
| virtual ROOT::Internal::RPage LoadPageImpl(ColumnHandle_t columnHandle, const RPageSummary &pageSummary) = 0; | ||||||
| // Returns a sealed page from storage without adding it to the page pool. The sealed pages buffer and buffer size | ||||||
| // is already initialized. | ||||||
| virtual void LoadSealedPageImpl(const RNTupleLocator &locator, RSealedPage &sealedPage) = 0; | ||||||
|
|
||||||
| /// Prepare a page range read for the column set in `clusterKey`. Specifically, pages referencing the | ||||||
| /// `kTypePageZero` locator are filled in `pageZeroMap`; otherwise, `perPageFunc` is called for each page. This is | ||||||
|
|
@@ -816,8 +821,7 @@ public: | |||||
| /// The `fSize` and `fNElements` member of the sealedPage parameters are always set. If `sealedPage.fBuffer` is | ||||||
| /// `nullptr`, no data will be copied but the returned size information can be used by the caller to allocate a large | ||||||
| /// enough buffer and call `LoadSealedPage` again. | ||||||
| virtual void | ||||||
| LoadSealedPage(ROOT::DescriptorId_t physicalColumnId, RNTupleLocalIndex localIndex, RSealedPage &sealedPage) = 0; | ||||||
| void LoadSealedPage(ROOT::DescriptorId_t physicalColumnId, RNTupleLocalIndex localIndex, RSealedPage &sealedPage); | ||||||
|
|
||||||
| /// Populates all the pages of the given cluster ids and columns; it is possible that some columns do not | ||||||
| /// contain any pages. The page source may load more columns than the minimal necessary set from `columns`. | ||||||
|
|
||||||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? or just
meta-data necessary?