-
1. Re: Jboss Infinispan 8.1.x NearCache and L1 Cache Configuration Enable
nadirx Feb 2, 2016 6:44 AM (in response to stejas7)1 of 1 people found this helpfulHi,
L1 is a concept which applies to embedded distributed caches, where nodes keep local copies of data "owned" by other nodes so that multiple requests to that data will not incur an RPC. Obviously entries in L1 get invalidated when the data on the owner is changed.
It is enabled by setting the l1-lifespan attribute on the distributed-cache element to a value greater than 0:
<distributed-cache name="distributedCache" owners="2" l1-timeout="1000"/>
Refer to urn:infinispan:config:8.1 for a complete documentation of the configuration schema.
Programmatically, use the following:
Configuration c = new ConfigurationBuilder()
.clustering()
.cacheMode(CacheMode.DIST_SYNC)
.hash()
.numOwners(2)
.l1().enable().lifespan(1000l)
.build();Near cache is similar, but applies to remote hotrod clients, and is explained in detail here: http://infinispan.org/docs/8.1.x/user_guide/user_guide.html#_near_caching
As for tutorials, we have quite an extensive tutorial available at Tutorials - Infinispan together with a bunch of examples highlighting many of our features.
If you need something specific, let us know
Tristan
-
2. Re: Jboss Infinispan 8.1.x NearCache and L1 Cache Configuration Enable
stejas7 Feb 2, 2016 7:33 AM (in response to nadirx)Hello,
Can you please give me a simple programmatic example of nearcache for hotrod clients? if you have a some specific example please let me know? its really useful for us.
-
3. Re: Jboss Infinispan 8.1.x NearCache and L1 Cache Configuration Enable
galder.zamarreno Feb 8, 2016 9:16 AM (in response to stejas7)Near cache is just a configuration option, there's no extra API enabled by this option. All it does is enable clients to locally cache results from RemoteCache.get() calls internally, without affecting the end user code.
-
4. Re: Jboss Infinispan 8.1.x NearCache and L1 Cache Configuration Enable
stejas7 Feb 9, 2016 9:01 AM (in response to galder.zamarreno)Thanks Glader.....!!!!!
-
5. Re: Jboss Infinispan 8.1.x NearCache and L1 Cache Configuration Enable
stejas7 Feb 9, 2016 9:04 AM (in response to galder.zamarreno)Can you please tell me what is difference between NearCacheMode.INVALIDATE and NearCacheMode.EAGER ? & what are the advantages & disadvantage of NearCacheMode.INVALIDATE ?
-
6. Re: Jboss Infinispan 8.1.x NearCache and L1 Cache Configuration Enable
galder.zamarreno Feb 17, 2016 7:25 AM (in response to stejas7)EAGER is deprecated so ignore it.