Skip to content

GH 1256. Fix cached modeled framework list #1257

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

Merged

Conversation

kotman12
Copy link
Contributor

@kotman12 kotman12 commented Mar 21, 2025

Fix CachedModeledFramework::list so it returns unfiltered list of children based on the cache path (not client path). See #1256 for more details.

Also added really minor fix to CachedModeledFramework::readThrough(Stat). This surfaced after I enhanced the tests a bit. This bug predates #1250

@kotman12 kotman12 changed the title Gh 1256 fix cached modeled framework list GH 1256 fix cached modeled framework list Mar 21, 2025
@kotman12 kotman12 changed the title GH 1256 fix cached modeled framework list GH 1256. fix cached modeled framework list Mar 21, 2025
@tisonkun tisonkun changed the title GH 1256. fix cached modeled framework list GH 1256. Fix cached modeled framework list Mar 22, 2025
@tisonkun tisonkun requested a review from kezhuw March 22, 2025 13:13
@tisonkun
Copy link
Member

@kotman12 This should close #1256?

@kotman12
Copy link
Contributor Author

@kotman12 This should close #1256?

@tisonkun I hope so, yes!

Copy link
Member

@kezhuw kezhuw left a comment

Choose a reason for hiding this comment

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

Looks good.

But I was confused in review regarding the CachedModeledFramework::list and ModeledCache::currentChildren.

  • CachedModeledFramework::list ignores data tree hierarchy. child does not change the result.
  • ModeledCache::currentChildren includes the path itself and and is recursive.

I think we probably should hightlight some to gain attention.

@kotman12
Copy link
Contributor Author

@kezhuw thanks! A few observations here:

CachedModeledFramework::list indeed ignores data hierarchy and returns all descendants of the base path but this is consistent with the API doc (as well as previous behavior):

Return the instances of the base path of this cached framework

Is your suggestion to add the word "recursively" to the doc somewhere in ModeledCache::currentChildren and CachedModeledFramework::list to stress that it recursively returns children's children? My immediate word of choice is "descendant" but I don't see it used anywhere in the curator docs so I don't want to introduce new terminology.

Tangentially, something I found strange is that CachedModeledFramework::parent is unimplemented but you can still potentially get the parent's modeled data if it is under the cache's base path.

@kezhuw kezhuw merged commit e4a4756 into apache:master Mar 26, 2025
10 checks passed
@kezhuw
Copy link
Member

kezhuw commented Mar 26, 2025

@kotman12 Merged. Thank you for your contribution!

but this is consistent with the API doc

Yeh, I saw.

Regarding ModeledCache::currentChildren, I think it is normal that "children" is not recursive just like ZooKeeper::getChildren. Given that it is a public api, I think there is no much room for us to change except documentation.

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.

3 participants