[ 
https://issues.apache.org/jira/browse/LUCENE-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12978889#action_12978889
 ] 

Michael McCandless commented on LUCENE-2474:
--------------------------------------------

bq. My idea was to simply expand the purge capability that the FC gets for free 
to other external custom components.

I think that's a good baby step, for this issue, today, just for segment 
readers.

Separately, eventually, we can tackle the bigger challenge of allowing caching 
on any reader.

{quote}
Also, if we did have a type safe separation between segment readers and 
compound readers, I would not have added the ability to register a listener on 
the compound readers, just the segment readers, as this will encourage people 
to write caches that only work on segment readers (since the registration for 
the "purge event" will happen within the cache, and it should work only with 
segment readers). That was why my patch does not take compound readers into 
account.
{quote}

I very much want to get type safe IndexReaders done before 4.0...

But: I think we'd want to have composite reader just forward the registration 
down to the atomic readers?  (And, forward on reopen).

> 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
>         Attachments: LUCENE-2474.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