-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: main
Are you sure you want to change the base?
Conversation
7a36602
to
440ddf1
Compare
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.
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.
lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
Outdated
Show resolved
Hide resolved
440ddf1
to
808e7fa
Compare
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 |
Refactor
IOContext
and createFileOpenHint
to specify how files are likely to be accessed once opened. This is the first PR of several to move from specifyingReadAdvice
directly, to specifying the file usage context as hints and theReadAdvice
being inferred from the hints insideDirectory
implementations.Relates #14422