ChrisHegarty commented on code in PR #16883:
URL: https://github.com/apache/lucene/pull/16883#discussion_r4349109624
##########
lucene/core/src/java/org/apache/lucene/store/IndexInput.java:
##########
@@ -238,6 +238,16 @@ public boolean prefetch(long offset, long length) throws
IOException {
*/
public void updateIOContext(IOContext context) throws IOException {}
+ /**
+ * Returns true if reading this input is as efficient as reading an input
opened with the given
+ * {@code IOContext}. If not, callers that read with this context may open
the file again.
+ *
+ * <p>The default implementation returns {@code true}.
+ */
+ public boolean readsAs(IOContext context) {
Review Comment:
Subjective: `readsAs` is a hard name to parse. What about something like
`isEfficientFor(IOContext)` ?
Maybe document that it is a hint, relative to how the input was last
advised. So maybe something along the lines of "This is a hint based on the
advice applied when the input was opened, sliced, or updated", or some such.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]