lucene-dev mailing list archives

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

     [ https://issues.apache.org/jira/browse/LUCENE-1798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

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:

{noformat}
    [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,org.apache.lucene.search.FieldCache.DEFAULT_FLOAT_PARSER=>[F#7896426
(size =~ 3.9 KB)
    [junit] 	'org.apache.lucene.index.DirectoryReader@da3a1e'=>'theDouble',double,org.apache.lucene.search.FieldCache.DEFAULT_DOUBLE_PARSER=>[D#5503831
(size =~ 7.8 KB)
    [junit] 	'org.apache.lucene.index.DirectoryReader@da3a1e'=>'theDouble',double,null=>[D#5503831
(size =~ 7.8 KB)
    [junit] 
    [junit] 
    [junit] Stack:
    [junit] 
    [junit] java.lang.Throwable
    [junit] 	at org.apache.lucene.search.FieldCacheImpl$Cache.printNewInsanity(FieldCacheImpl.java:263)
    [junit] 	at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:228)
    [junit] 	at org.apache.lucene.search.FieldCacheImpl.getFloats(FieldCacheImpl.java:494)
    [junit] 	at org.apache.lucene.search.FieldCacheImpl$FloatCache.createValue(FieldCacheImpl.java:509)
    [junit] 	at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:223)
    [junit] 	at org.apache.lucene.search.FieldCacheImpl.getFloats(FieldCacheImpl.java:494)
    [junit] 	at org.apache.lucene.search.FieldCacheImpl.getFloats(FieldCacheImpl.java:487)
    [junit] 	at org.apache.lucene.search.TestFieldCache.testInfoStream(TestFieldCache.java:70)
    [junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit] 	at java.lang.reflect.Method.invoke(Method.java:597)
    [junit] 	at junit.framework.TestCase.runTest(TestCase.java:164)
    [junit] 	at junit.framework.TestCase.runBare(TestCase.java:130)
    [junit] 	at org.apache.lucene.util.LuceneTestCase.runBare(LuceneTestCase.java:206)
    [junit] 	at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit] 	at junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit] 	at junit.framework.TestResult.run(TestResult.java:109)
    [junit] 	at junit.framework.TestCase.run(TestCase.java:120)
    [junit] 	at junit.framework.TestSuite.runTest(TestSuite.java:230)
    [junit] 	at junit.framework.TestSuite.run(TestSuite.java:225)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:420)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
{noformat}

> FieldCacheSanityChecker called directly by FieldCache.get*
> ----------------------------------------------------------
>
>                 Key: LUCENE-1798
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1798
>             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
object.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message