uschindler commented on code in PR #13242:
URL: https://github.com/apache/lucene/pull/13242#discussion_r1544287471
##########
lucene/core/src/java/org/apache/lucene/store/IOContext.java:
##########
@@ -87,12 +86,13 @@ public IOContext(MergeInfo mergeInfo) {
/**
* Return an updated {@link IOContext} that has the provided {@link
ReadAdvice} if the {@link
- * Context} is a {@link Context#READ} context, otherwise return this
existing instance. This helps
- * preserve a {@link ReadAdvice#SEQUENTIAL} advice for merging, which is
always the right choice,
- * while allowing {@link IndexInput}s open for searching to use arbitrary
{@link ReadAdvice}s.
+ * Context} is a {@link Context#DEFAULT} context, otherwise return this
existing instance. This
+ * helps preserve a {@link ReadAdvice#SEQUENTIAL} advice for merging, which
is always the right
+ * choice, while allowing {@link IndexInput}s open for searching to use
arbitrary {@link
+ * ReadAdvice}s.
*/
public IOContext withReadAdvice(ReadAdvice advice) {
- if (context == Context.READ) {
+ if (context == Context.DEFAULT) {
return new IOContext(advice);
Review Comment:
This is a bit unrelated, but here we could use precalculated DEFAULT
IOContexts for each advice, to not create new instances every time. Will check
in a separate PR.
--
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]