Skip to content

Create file open hints on IOContext to replace ReadAdvice #14482

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
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

thecoop
Copy link
Contributor

@thecoop thecoop commented Apr 14, 2025

Refactor IOContext and create FileOpenHint to specify how files are likely to be accessed once opened. This is the first PR of several to move from specifying ReadAdvice directly, to specifying the file usage context as hints and the ReadAdvice being inferred from the hints inside Directory implementations.

Relates #14422

@thecoop thecoop force-pushed the iocontext-split branch 3 times, most recently from 7a36602 to 440ddf1 Compare April 14, 2025 16:30
Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

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

I like this change. I can see how the usage sites withHints(... are very convenient and readable. This comes at the cost of validateIOContext, which I think is ok.

@thecoop
Copy link
Contributor Author

thecoop commented Apr 15, 2025

To stop this PR getting too big, I suggest merging this here (which doesn't change any existing behaviour), and work on updating uses of IOContext to use hints rather than ReadAdvice in another PR

@thecoop thecoop marked this pull request as ready for review April 15, 2025 13:12
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.

2 participants