thecoop commented on code in PR #16883:
URL: https://github.com/apache/lucene/pull/16883#discussion_r4350073304
##########
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:
Whilst I understand why this returns `true` by default, it's a bit
misleading. Basically, with no other information, it says 'yeah, it's ok, no
worries!', which is incorrect.
I think it'll be better to return a 3rd option to some extent - maybe an
`Optional<Boolean>` so it's not saying `true` when it actually doesn't know.
--
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]