You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "jpountz (via GitHub)" <gi...@apache.org> on 2024/03/29 09:03:32 UTC
[PR] Replace (IO)Context#READ with (IO)Context.DEFAULT. [lucene]
jpountz opened a new pull request, #13242:
URL: https://github.com/apache/lucene/pull/13242
`DEFAULT` doesn't mean much today and could be used whenever `READ` is used. So let's use `DEFAULT` all the time instead and remove `READ`.
--
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-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Replace (IO)Context#READ with (IO)Context.DEFAULT. [lucene]
Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz merged PR #13242:
URL: https://github.com/apache/lucene/pull/13242
--
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-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Replace (IO)Context#READ with (IO)Context.DEFAULT. [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Replace (IO)Context#READ with (IO)Context.DEFAULT. [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on code in PR #13242:
URL: https://github.com/apache/lucene/pull/13242#discussion_r1544334488
##########
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:
see #13245
--
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-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org