[infinispan-dev] Cache chaining and async and transactions

Manik Surtani manik at jboss.org
Mon Dec 21 06:23:11 EST 2009


On 17 Dec 2009, at 12:43, philippe van dyck wrote:

> Hi all,
> 
> i am searching for the perfect configuration on EC2 and I have a question about the asynchronous operations.
> 
> I would like to chain two caches 1) one filecache 2) one s3cache.

Keep in mind the S3CacheStore will (soon) be replaced with a CloudCacheStore.  More generic and based on better JClouds APIs.

> I would also like the transaction to return ASAP when the filecache has committed, and the s3cache to commit the same transaction, but asynchronously.
> 
> Is it 'configurable' ?
> 
> Right now I use this ... but it is not working (I have to wait for the s3cache to finish what it seems to be an async operation)

Your cfg *should* do as you expect, due to the <async > element in the 2nd store.  Perhaps you could write a unit test to prove this, along the lines of ChainingCacheLoaderTest in trunk, to ensure that one CS blocks and the other does not (maybe using 2 different DumyCacheStores, or mocks)?

Cheers
Manik

> 
> <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="urn:infinispan:config:4.0">
> 	<global>
> 		<transport
> 			transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport">
> 			<properties>
> 				<property name="configurationFile" value="jgroups.xml" />
> 			</properties>
> 		</transport>
> 
> 	</global>
> 	<default>
> 		<transaction
> 			transactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup" />
> 		<clustering mode="distribution">
> 			<l1 enabled="true" lifespan="100000" />
> 			<hash numOwners="2" rehashRpcTimeout="120000" />
> 		</clustering>
> 		<loaders passivation="false" shared="true" preload="false">
> 
> 			<loader class="org.infinispan.loaders.file.FileCacheStore"
> 				fetchPersistentState="true" ignoreModifications="false"
> 				purgeOnStartup="true">
> 				<properties>
> 					<property name="location" value="/tmp" />
> 				</properties>
> 			</loader>
> 
> 			<loader class="org.infinispan.loaders.s3.S3CacheStore"
> 				fetchPersistentState="false" ignoreModifications="false"
> 				purgeOnStartup="false">
> 
> 				<properties>
> 					<property name="awsAccessKey" value="***" />
> 					<property name="awsSecretKey" value="***" />
> 					<property name="bucketPrefix" value="store" />
> 				</properties>
> 				<async enabled="true" threadPoolSize="10" />
> 			</loader>
> 		</loaders>
> 		<eviction strategy="LRU" wakeUpInterval="10000" maxEntries="1000" />
> 		<unsafe unreliableReturnValues="true" />
> 	</default>
> </infinispan>
> 
> 
> 
> Thanks,
> 
> Phil 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20091221/a211c359/attachment-0002.html 


More information about the infinispan-dev mailing list