[
https://issues.apache.org/jira/browse/LUCENE-3531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Uwe Schindler reopened LUCENE-3531:
-----------------------------------
Mike and I discussed on IRC about easier ways to solve the caching problem. We
came to the conclusion, that using the acceptDocs (may be null) as a sub-key
are suboptimal, because the null key cannot be evicted from the
WeakIdentityHashMap. Also the two caches inside each other are hard to manage.
The idea was to have a "combined" key on segmentreader, thats hard referenced
by the instance, changing only when deletions change. This key should also only
have identity equals/hashCode.
IndexReader like in 3.x now supplies two keys, one based on the core without
deletions, and a second one thats equal for all segmentreaders with same
deletions and same core. The trick is to use a Object field in SegmentReader
thats initialized with new Object() at the beginning and transferred over to a
new instance when cloned. But once deletions change, we reassign a new "new
Object()", so the key changes.
CachingWrapperFilter uses either the conventional coreCacheKey (if if does not
respect deletions at all and caches without acceptDocs), or it uses the
combined key (IndexReader.getCombinedCoreAndDeletesKey()) for the cache.
The WeakIdentityHashMap is therefore obsolete again, I will nuke it.
> Improve CachingWrapperFilter to optionally also cache acceptDocs, if
> identical to liveDocs
> ------------------------------------------------------------------------------------------
>
> Key: LUCENE-3531
> URL: https://issues.apache.org/jira/browse/LUCENE-3531
> Project: Lucene - Java
> Issue Type: Improvement
> Components: core/search
> Affects Versions: 4.0
> Reporter: Uwe Schindler
> Assignee: Michael McCandless
> Fix For: 4.0
>
> Attachments: LUCENE-3531-identityFix.patch,
> LUCENE-3531-identityFix.patch, LUCENE-3531-identityFix.patch,
> LUCENE-3531-identityFix.patch, LUCENE-3531-identityFix.patch,
> LUCENE-3531.patch
>
>
> Spinoff from LUCENE-1536: This issue removed the different cache modes
> completely and always applies the acceptDocs using
> BitsFilteredDocIdSet.wrap(), the cache only contains raw DocIdSet without any
> deletions/acceptDocs. For IndexReaders that are seldom reopened, this might
> not be as performant as it could be. If the acceptDocs==IR.liveDocs, those
> DocIdSet could also be cached with liveDocs applied.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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]