[ 
https://issues.apache.org/jira/browse/LUCENE-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael McCandless updated LUCENE-2474:
---------------------------------------

    Attachment: LUCENE-2474.patch

Patch (for trunk), with non-static solution.

I cut back to sync(HashSet) because it's easy, now, for dups to be added.  EG 
the collection is shared to all sub-readers, and FC registers its listener to 
all subs... and, each of FC's typed caches will register the listener.

DirReader shares the collection to all subs and to all reopens.

MultiReader, ParReader delegate (but also track/invoke their own listeners).

I added a private reader listeners collection to IW, which is only used to make 
sure all NRT readers opened from the writer share the same collection (ie, this 
is not a public API in IW).

Subclasses of IR are now responsible for initializing the reader listeners 
collection (if the add/removeReaderFinishedListener could be invoked).

> Allow to plug in a Cache Eviction Listener to IndexReader to eagerly clean 
> custom caches that use the IndexReader (getFieldCacheKey)
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-2474
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2474
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Shay Banon
>            Assignee: Michael McCandless
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2474.patch, LUCENE-2474.patch, LUCENE-2474.patch, 
> LUCENE-2574.patch
>
>
> Allow to plug in a Cache Eviction Listener to IndexReader to eagerly clean 
> custom caches that use the IndexReader (getFieldCacheKey).
> A spin of: https://issues.apache.org/jira/browse/LUCENE-2468. Basically, its 
> make a lot of sense to cache things based on IndexReader#getFieldCacheKey, 
> even Lucene itself uses it, for example, with the CachingWrapperFilter. 
> FieldCache enjoys being called explicitly to purge its cache when possible 
> (which is tricky to know from the "outside", especially when using NRT - 
> reader attack of the clones).
> The provided patch allows to plug a CacheEvictionListener which will be 
> called when the cache should be purged for an IndexReader.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to