[jboss-cvs] JBossCache/src/org/jboss/cache/loader ...

Manik Surtani manik at jboss.org
Fri Mar 30 13:22:07 EDT 2007


  User: msurtani
  Date: 07/03/30 13:22:07

  Modified:    src/org/jboss/cache/loader  FileCacheLoader.java
  Log:
  JBCACHE-807
  
  Revision  Changes    Path
  1.31      +18 -5     JBossCache/src/org/jboss/cache/loader/FileCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FileCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/FileCacheLoader.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -b -r1.30 -r1.31
  --- FileCacheLoader.java	7 Mar 2007 23:32:06 -0000	1.30
  +++ FileCacheLoader.java	30 Mar 2007 17:22:07 -0000	1.31
  @@ -4,16 +4,15 @@
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Modification;
  -import org.jboss.cache.marshall.ObjectSerializationFactory;
   import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
  -import org.jboss.util.stream.MarshalledValueInputStream;
  +import org.jboss.cache.marshall.ObjectSerializationFactory;
   
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.FileOutputStream;
   import java.io.IOException;
  -import java.io.ObjectOutputStream;
   import java.io.ObjectInputStream;
  +import java.io.ObjectOutputStream;
   import java.util.HashMap;
   import java.util.HashSet;
   import java.util.List;
  @@ -25,10 +24,24 @@
   
   /**
    * Simple file-based CacheLoader implementation. Nodes are directories, attributes of a node is a file in the directory
  + * <p/>
  + * The FileCacheLoader has some severe limitations which restrict it's use in a production
  + * environment, or if used in such an environment, it should be used with due care and sufficient
  + * understanding of these limitations.
  + * <ul>
  + * <li>Due to the way the FileCacheLoader represents a tree structure on disk (directories and files) traversal is inefficient for deep trees.</li>
  + * <li>Usage on shared filesystems like NFS, Windows shares, etc. should be avoided as these do not implement proper file locking and can cause data corruption.</li>
  + * <li>Usage with an isolation level of NONE can cause corrupt writes as multiple threads attempt to write to the same file.</li>
  + * <li>File systems are inherently not transactional, so when attempting to use your cache in a transactional context, failures when writing to the file (which happens during the commit phase) cannot be recovered.</li>
  + * </ul>
  + * <p/>
  + * As a rule of thumb, it is recommended that the FileCacheLoader not be used in a highly concurrent,
  + * transactional or stressful environment, and it's use is restricted to testing.
  + * <p/>
    *
    * @author Bela Ban
    * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  - * @version $Id: FileCacheLoader.java,v 1.30 2007/03/07 23:32:06 gzamarreno Exp $
  + * @version $Id: FileCacheLoader.java,v 1.31 2007/03/30 17:22:07 msurtani Exp $
    */
   public class FileCacheLoader extends AbstractCacheLoader
   {
  @@ -361,7 +374,7 @@
         if (!child.exists()) return new HashMap(0); // no node attribs exist hence the empty HashMap.
         //if(!child.exists()) return null;
   
  -      Map m = (Map)unmarshall(child);
  +      Map m = (Map) unmarshall(child);
         return m;
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list