[
https://issues.apache.org/jira/browse/LUCENE-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13765341#comment-13765341
]
Michael McCandless commented on LUCENE-4998:
--------------------------------------------
Thanks Shikhar.
The patch looks good! Except, the changes in IndexWriter and
BufferedDeletesStream are not quite right: because the reader pool may in fact
pool (hang onto) the opened SegmentReader, READONCE is not necessarily correct.
Ie, a reader may be opened in order to apply deletes, and that caller thinks it
will READONCE, but then the pool will hang onto it, and reuse that reader to
open an NRT reader, or to do a merge, etc.
> be more precise about IOContext for reads
> -----------------------------------------
>
> Key: LUCENE-4998
> URL: https://issues.apache.org/jira/browse/LUCENE-4998
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Shikhar Bhushan
> Priority: Minor
> Fix For: 5.0, 4.5
>
> Attachments: LUCENE-4998.patch
>
>
> Set the context as {{IOContext.READ}} / {{IOContext.READONCE}} where
> applicable
> ----
> Motivation:
> Custom {{PostingsFormat}} may want to check the context on
> {{SegmentReadState}} and branch differently, but for this to work properly
> the context has to be specified correctly up the stack.
> For example, {{DirectPostingsFormat}} only loads postings into memory if the
> {{context != MERGE}}. However a better condition would be {{context ==
> Context.READ && !context.readOnce}}.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]