Skip to content

Use a hint to specify READONCE IOContext#14509

Merged
ChrisHegarty merged 2 commits intoapache:mainfrom
thecoop:iocontext-readonce-hint
May 29, 2025
Merged

Use a hint to specify READONCE IOContext#14509
ChrisHegarty merged 2 commits intoapache:mainfrom
thecoop:iocontext-readonce-hint

Conversation

@thecoop
Copy link
Copy Markdown
Contributor

@thecoop thecoop commented Apr 16, 2025

Use a hint to specify readonce IO, rather than checking for object identity (which we shouldn't really be doing with records anyway)

@uschindler
Copy link
Copy Markdown
Contributor

Could we get some context/issue what this is about?

@thecoop
Copy link
Copy Markdown
Contributor Author

thecoop commented Apr 16, 2025

This is following on from #14482. This is in draft, as I wanted to see that this refactoring worked cleanly based on the changes in #14482, but needs that PR merged first before it can go in.

@thecoop thecoop force-pushed the iocontext-readonce-hint branch from b981dd3 to ff5067e Compare May 9, 2025 08:26
@thecoop thecoop marked this pull request as ready for review May 9, 2025 08:26
@thecoop
Copy link
Copy Markdown
Contributor Author

thecoop commented May 13, 2025

@ChrisHegarty @jpountz Does this look ok?

Copy link
Copy Markdown
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

I left a few comments/questions but the change makes sense to me.

Comment thread lucene/core/src/java/org/apache/lucene/store/ReadOnceHint.java Outdated
*/
package org.apache.lucene.store;

/** A {@link IOContext.FileOpenHint} indicating the file will only be read once, sequentially */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be interesting to use MockDirectoryWrapper to check that files that open with this hint actually read the data only once and sequentially (in a follow-up PR).

Comment thread lucene/core/src/java/org/apache/lucene/store/IOContext.java
@github-actions
Copy link
Copy Markdown
Contributor

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog-check label to it and you will stop receiving this reminder on future updates to the PR.

@ChrisHegarty ChrisHegarty merged commit 59ec3bc into apache:main May 29, 2025
7 checks passed
ChrisHegarty pushed a commit that referenced this pull request May 29, 2025
Use a hint to specify readonce IO, rather than checking for object identity (which we shouldn't really be doing with records anyway)
@thecoop thecoop deleted the iocontext-readonce-hint branch June 3, 2025 08:27
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.

4 participants