lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] Commented: (LUCENE-1798) FieldCacheSanityChecker called directly by FieldCache.get*
Date Tue, 25 Aug 2009 18:25:59 GMT


Hoss Man commented on LUCENE-1798:

Michael: reading the patch you commited, i only have two concerns...

1) a PrintStream doesn't really seem like the ideal callback API for this situation ... with
IndexWriter it makes some sense because we ant to be able to log all sorts of misc info that
will be unstructured, but in the field cache checkign case we already have a fairly robust
data structure (Insanity) that we can provide ... so instead of a setInfoStream(PritStream)
method, why not have a callback interface that takes Insanity objects (and the Entry that
triggered the problem)

   * If non-null, this monitor will be notify anytime an entry is created 
   * which are not sane according to {@link FieldCacheSanityChecker}.
   * @param monitor The Monitor to notify, if it throws a RuntimeException then the cache
method will throw a RuntimeException.
  public void setInsanityMonitor(InsanityMonitor monitor)
  public interface InsanityMonitor {
    public void notify(CacheEntry e, Instanty[] i);

2) it seems like we should change LuceneTestCase to use this new hook instead of just calling
the FieldCacheSanityChecker in tearDown() ... that way we can be sure we're checking all FieldCache
usages (the current approach risks IndexReader weak refs getting gc'ed after they go out of
scope in the test and before the checker runs in tearDown)


> FieldCacheSanityChecker called directly by FieldCache.get*
> ----------------------------------------------------------
>                 Key: LUCENE-1798
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Hoss Man
>            Assignee: Michael McCandless
>             Fix For: 2.9
>         Attachments: LUCENE-1798.patch, LUCENE-1798.patch
> As suggested by McCandless in LUCENE-1749, we can make FieldCacheImpl a client of the
FieldCacheSanityChecker and have it sanity check itself each time it creates a new cache entry,
and log a warning if it thinks there is a problem.  (although we'd probably only want to do
this if the caller has set some sort of infoStream/warningStream type property on the FieldCache

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:
For additional commands, e-mail:

View raw message