Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-2474

Allow to plug in a Cache Eviction Listener to IndexReader to eagerly clean custom caches that use the IndexReader (getFieldCacheKey)

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.1, 4.0-ALPHA
    • core/search
    • None
    • New, Patch Available

    Description

      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.

      Attachments

        1. LUCENE-2474.patch
          20 kB
          Michael McCandless
        2. LUCENE-2474.patch
          10 kB
          Michael McCandless
        3. LUCENE-2474.patch
          6 kB
          Shay Banon
        4. LUCENE-2574.patch
          43 kB
          Michael McCandless
        5. MapBackedSet.java
          1 kB
          Shay Banon

        Activity

          People

            mikemccand Michael McCandless
            kimchy Shay Banon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: