Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think EhCache indexing feature has nothing to do with Terracotta. Its a core feature of EhCache. I'm using both Ehcache and Ehcache backed by commercial version of Terracotta.</p> <p>When you do provide ehcache.xml configuration you'll have to specify which fields are searcheable (this will trigger Lucene's indexing activity every time a new object is cached or updated/removed in cache)</p> <p>Here a sample example of such configuration (I've setup maxBytesLocalHeap="1024m" as per your requirements):</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ehcache maxBytesLocalHeap="1024m"&gt; &lt;sizeOfPolicy maxDepth="2000" /&gt; &lt;defaultCache eternal="false" timeToLiveSeconds="600"/&gt; &lt;cache name="myCacheablePOJO" eternal="true" statistics="true"&gt; &lt;searchable&gt; &lt;searchAttribute name="field1" /&gt; &lt;searchAttribute name="field2" /&gt; &lt;searchAttribute name="field3" /&gt; &lt;/searchable&gt; &lt;/cache&gt; &lt;/ehcache&gt; </code></pre> <p>When you use Terracotta based implementatio of EhCache APIs you will have to have additional jars on the classpath and enable terracotta in the configuration:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ehcache maxBytesLocalHeap="1.3g"&gt; &lt;sizeOfPolicy maxDepth="2000" /&gt; &lt;defaultCache eternal="false" timeToLiveSeconds="600"&gt; &lt;terracotta/&gt; &lt;/defaultCache&gt; &lt;cache name="myCacheablePOJO" eternal="true" statistics="true"&gt; &lt;searchable&gt; &lt;searchAttribute name="field1" /&gt; &lt;searchAttribute name="field2" /&gt; &lt;searchAttribute name="field3" /&gt; &lt;/searchable&gt; &lt;terracotta compressionEnabled="true" /&gt; &lt;/cache&gt; &lt;/ehcache&gt; </code></pre> <p>Notice, that I've added "terracotta" tag to the cache name="myCacheablePOJO" with an optional attribute to enable object compression in cache (saves ram space with a fractional performance cost).</p> <p>So, in other words you should be fine with 1.2M of elements in your local EhCache without Terracotta clustering. The only problem you should consider is fail-over. You should ask yourself the following questions:</p> <ul> <li>What is my system caching strategy? </li> <li>Can the system afford loosing cached data in case of JVM crash?</li> <li>How data is populated in your local cache in case of JVM restart?</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload