lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3360) Move FieldCache to IndexReader
Date Thu, 04 Aug 2011 13:27:27 GMT


Uwe Schindler commented on LUCENE-3360:

Tiny, nice! I most like the readerFinishedListeners that purge the cache!

I would suggest to add a new interface/abstract class for the per-Reader FieldCaches, as we
currently have the stupid extra IndexReader param in the interface. The current FieldCacheImpl/FieldCache
interface in the search package should be removed. The new one could have same name in the
index package.

I would move the current FieldCacheImpl code to the SlowMultiReaderWrapper (with the new interface)
and leave the deprecated FieldCache/FieldCacheImpl in search with just delegating like this,
but no actual impls:

int[] FieldCacheImpl#getInts(IndexReader reader, String field) throws IOException {
  return new SlowMultiReaderWrapper(reader).getFieldCache().getInts(field);

> Move FieldCache to IndexReader
> ------------------------------
>                 Key: LUCENE-3360
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Martijn van Groningen
>             Fix For: 3.4, 4.0
>         Attachments: LUCENE-3360.patch
> Move the static FieldCache.DEFAULT field instance to atomic IndexReaders, so that FieldCache
insanity caused by the WeakHashMap no longer occurs.
> * Add a new method to IndexReader that by default throws an UOE:
> {code}public FieldCache getFieldCache(){code}
> * The SegmentReader implements this method and returns its own internal FieldCache implementation.
This implementation just uses a HashMap<Entry<T>,Object>> to store entries.
> * The SlowMultiReaderWrapper implements this method as well and basically behaves the
same as the current FieldCacheImpl.
> This issue won't solve the insanity that comes from inconsistent usage of a single field
(for example retrieve both int[] and DocTermIndex for the same field). 

This message is automatically generated by JIRA.
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message