Skip to content

Conversation

silverweed
Copy link
Contributor

@silverweed silverweed commented Sep 16, 2025

Add a bunch of functions to poke through the abstraction of the storage classes (specifically, to get the underlying TDirectory and RMiniFileReader). These functionalities (all Internal) will be needed by the RNTuple Attributes (see the full PR for details)

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

Copy link

github-actions bot commented Sep 16, 2025

Test Results

    22 files      22 suites   3d 18h 45m 11s ⏱️
 3 683 tests  3 683 ✅ 0 💤 0 ❌
79 131 runs  79 131 ✅ 0 💤 0 ❌

Results for commit 60b27af.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@jblomer jblomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need GetUnderlyingDirectory()? Since the attribute anchor is a hidden key, we can just store it in the ROOT file's root directory.

@silverweed
Copy link
Contributor Author

Do we really need GetUnderlyingDirectory()? Since the attribute anchor is a hidden key, we can just store it in the ROOT file's root directory.

Not sure...the reason I need it in the full PR is to create the AttrSetWriter which then uses it create a PageSinkFile using it. Even if we wanted to store the key in the root directory we'd still need the underlying TFile for it...

@silverweed silverweed force-pushed the ntuple_attr_2 branch 2 times, most recently from 3675b97 to 8cc71a8 Compare September 29, 2025 07:21
@silverweed silverweed requested a review from jblomer September 29, 2025 10:17
Copy link
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments inline. I'm not actually sure it helps to review internal methods and additions to the RPageStorage abstraction layer without seeing the immediate need. Maybe one has to look at the final PR all the time, but that is quite some mental overhead. It feels like we are now vertically building the implementation, instead of in logical chunks...

Comment on lines 152 to 155
std::unique_ptr<RPageSink> CloneWithNewRNTuple(std::string_view newName) const final
{
return fInnerSink->CloneWithNewRNTuple(newName);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the semantics are not well defined: As it stands, it will return a page sink that is not buffered anymore.

Copy link
Contributor Author

@silverweed silverweed Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure what should happen here: it's not necessarily true that if the parent sink is buffered then we also want to buffer the clone. Arguably, returning a non-buffered sink gives the most flexibility as the caller can decide whether to wrap it in a buffered sink or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would argue it's not a clone in this case... Maybe it's a matter of finding a more suitable name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't come up with anything better than CreateNewWithNewRNTuple...being a private internal method it might be ok even though it's ugly.

{
auto pageSource = std::make_unique<RPageSourceFile>("", fFile->Clone(), options);
pageSource->fAnchor = anchor;
pageSource->fNTupleName = pageSource->fDescriptorBuilder.GetDescriptor().GetName();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this initialized? Above you are passing "" for ntupleName, is the header already loaded somewhere?

Copy link
Contributor Author

@silverweed silverweed Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "initialized" you mean attached? At the moment it needs to be done manually, like when you create a new PageSource. This is done in 2 places in the full PR: in ReadAttributeSet, by the created Reader, and in RNTupleMerger::OpenAttributeSource

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat: Unless I'm missing something, I think the effect of this line is always that pageSource->fNTupleName = ""; because the descriptor builder doesn't have more information (yet).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It's indeed possible that that line is useless (I still need to verify), but isn't this the case also for CreateFromAnchor then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is very much possible...

Copy link
Contributor Author

@silverweed silverweed Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#20017 (if that solution is fine I will also change this PR accordingly)

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

Successfully merging this pull request may close these issues.

3 participants