lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Updated: (LUCENE-1798) FieldCacheSanityChecker called directly by FieldCache.get*
Date Sun, 23 Aug 2009 15:00:59 GMT


Michael McCandless updated LUCENE-1798:

    Attachment: LUCENE-1798.patch

Attached patch.  I added get/setInfoStream to FieldCache, then, in FieldCacheImpl.Cache.get,
if we hit a cache miss and infoStream is enabled, I gather the Insanity[] before  the cache
entry is added and after, then print out any change involving the entry just added.  It produces
this output to the infoStream:

    [junit] WARNING: new FieldCache insanity created
    [junit] Details: VALUEMISMATCH: Multiple distinct value objects for org.apache.lucene.index.DirectoryReader@da3a1e+theDouble
    [junit] 	'org.apache.lucene.index.DirectoryReader@da3a1e'=>'theDouble',float,>[F#7896426
(size =~ 3.9 KB)
    [junit] 	'org.apache.lucene.index.DirectoryReader@da3a1e'=>'theDouble',double,>[D#5503831
(size =~ 7.8 KB)
    [junit] 	'org.apache.lucene.index.DirectoryReader@da3a1e'=>'theDouble',double,null=>[D#5503831
(size =~ 7.8 KB)
    [junit] Stack:
    [junit] java.lang.Throwable
    [junit] 	at$Cache.printNewInsanity(
    [junit] 	at$Cache.get(
    [junit] 	at
    [junit] 	at$FloatCache.createValue(
    [junit] 	at$Cache.get(
    [junit] 	at
    [junit] 	at
    [junit] 	at
    [junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke(
    [junit] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    [junit] 	at java.lang.reflect.Method.invoke(
    [junit] 	at junit.framework.TestCase.runTest(
    [junit] 	at junit.framework.TestCase.runBare(
    [junit] 	at org.apache.lucene.util.LuceneTestCase.runBare(
    [junit] 	at junit.framework.TestResult$1.protect(
    [junit] 	at junit.framework.TestResult.runProtected(
    [junit] 	at
    [junit] 	at
    [junit] 	at junit.framework.TestSuite.runTest(
    [junit] 	at
    [junit] 	at
    [junit] 	at
    [junit] 	at

> 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
> 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