thecoop commented on issue #14422: URL: https://github.com/apache/lucene/issues/14422#issuecomment-2789635909
That's a good idea - we can separate it out by type, allowing for more granular specifications, whilst keeping it flexible. How about - we could use the same pattern as Java IO options - a `FileOpenOptions` marker interface, with some enum implementations: `FileType` - `METADATA`, `DATA`, `INDEX` `FileData` - `POSTINGS`, `STORED_FIELDS`, `VECTORS` `DataAccess` - `SEQUENTIAL`, `RANDOM` IOContext would have a `FileOpenOptions[]` array allowing any combination of these to be specified. Then we would go through all the existing uses of `withReadAdvice`, and specify the correct set of options instead, pushing the decision on the ReadAdvice to use to the Directory (I imagine there'll be some helper methods in `Directory` to handle common combinations of these, so subclasses don't need to worry about the exact options unless they need to). The marker interface is there to decouple the `IOContext` class from the exact file options specified - it essentially acts as a pass-through from the code that wants to open the file, to the `Directory` actually doing the opening. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org