Is Infinispan GridFileSystem persistable ?
penkween Sep 11, 2010 10:49 PMWhile the In-Memory GridFileSystem using replicated cache (for Metadata) and distributed cache (for Data) is stable, but when I try to make GridFileSystem's Metadata persist using FileCacheStore as shown in the config xml below , I am facing some evicted entries can't be really retrieved by the following codes:
Test Codes used:
##########################################################################################
Cache<String,byte[]> data = cacheManager.getCache("distributed");
Cache<String,GridFile.Metadata> metadata = cacheManager.getCache("replicated"); //Current test only try to make metadata persistable
GridFilesystem fs = new GridFilesystem(data, metadata);
//------- After creating some directories and files (with empty data) exceeding eviction maxEntries="5" ------------//
//-------- Try to list the files -------//
File file=fs.getFile("/");
File[] files=file.listFiles();
files.toString(); //Missing entries
***** Although metadata cache survive restart using metadata.stop() & metada.start() , BUT :----- *****
***** Not all directories or files entry are retrieved by "file.listFiles()" . I guess those evicted one gone missing .... *****
***** Not all entries are retrieved by "metadata.keySet() or metadata.entrySet() or metadata.values() ***
***** If without eviction, everythings look fine *****
Anybody has any ideas if Infinispan GridFS is persistable? and is it possible to make both its metadata & data persistable (with or without passivation ) using FileCacheStore?
Test config.xml used:
##########################################################################################
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:4.0">
<global>
<transport clusterName="infinispan-cluster" distributedSyncTimeout="50000" nodeName="Jalapeno"/>
<serialization marshallerClass="org.infinispan.marshall.VersionAwareMarshaller" version="1.0"/>
<shutdown hookBehavior="DEFAULT"/>
</global>
<namedCache name="distributed">
<clustering mode="distribution">
<sync/>
<hash numOwners="3" rehashWait="120000" rehashRpcTimeout="600000"/>
<l1 enabled="true" lifespan="600000"/>
</clustering>
</namedCache>
<namedCache name="replicated">
<clustering mode="replication">
<sync replTimeout="20000"/>
</clustering>
<loaders passivation="false" shared="false" preload="true">
<loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true"
ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="location" value="/tmp"/>
</properties>
</loader>
</loaders>
<eviction wakeUpInterval="500" maxEntries="5" strategy="FIFO"/>
</namedCache>
</infinispan>
##########################################################################################