[ 
https://issues.apache.org/jira/browse/SOLR-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13931447#comment-13931447
 ] 

Shawn Heisey commented on SOLR-5851:
------------------------------------

I have learned that FastLRUCache will actually create a cache of max size 2 
when you tell it that you want the size to be zero, because of these two lines 
in its init method:

{code}
    if (minLimit==0) minLimit=1;
    if (limit <= minLimit) limit=minLimit+1;
{code}

I initially tried to just add code to the get() and put() methods of all the 
cache implementations that returns immediately if the cache size is zero, but 
that didn't work and broke most of the tests.  In hindsight, this makes sense - 
it was not the right solution.

If we're going to implement this idea, we need some other way to detect that 
the *requested* cache size was zero so we can short-circuit all the cache 
methods into returning immediately and not taking any action.  Ideally, we 
would also avoid creating the underlying data structure at all.


> Disabling lookups into disabled caches
> --------------------------------------
>
>                 Key: SOLR-5851
>                 URL: https://issues.apache.org/jira/browse/SOLR-5851
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Otis Gospodnetic
>            Priority: Minor
>
> When a cache is disabled, ideally lookups into that cache should be 
> completely disabled, too.
> See: 
> http://search-lucene.com/m/QTPaTfMT52&subj=Disabling+lookups+into+disabled+caches



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to