[jboss-cvs] CacheBenchFwk/src/org/cachebench/cachewrappers ...

Manik Surtani manik at jboss.org
Wed Apr 18 15:09:29 EDT 2007


  User: msurtani
  Date: 07/04/18 15:09:29

  Modified:    src/org/cachebench/cachewrappers    
                        TangosolCacheWrapper.java EHCacheWrapper.java
                        JBossCache200Wrapper.java JBossCacheWrapper.java
  Log:
  Updated loads of stuff
  
  Revision  Changes    Path
  1.4       +8 -8      CacheBenchFwk/src/org/cachebench/cachewrappers/TangosolCacheWrapper.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TangosolCacheWrapper.java
  ===================================================================
  RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/cachewrappers/TangosolCacheWrapper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- TangosolCacheWrapper.java	13 Mar 2007 14:50:46 -0000	1.3
  +++ TangosolCacheWrapper.java	18 Apr 2007 19:09:29 -0000	1.4
  @@ -7,28 +7,28 @@
    * An Implementation of the CacheWrapper that used tangosol coherence 3.0
    *
    * @author Imran Bohoran
  - * @version $Id: TangosolCacheWrapper.java,v 1.3 2007/03/13 14:50:46 msurtani Exp $
  + * @version $Id: TangosolCacheWrapper.java,v 1.4 2007/04/18 19:09:29 msurtani Exp $
    */
   public class TangosolCacheWrapper
   {//implements SerializableCacheWrapper {
      /*
       NamedCache cache;
  -    private Log logger = LogFactory.getLog("org.cachebench.cachewrappers.TangosolCacheWrapper");
  +    private Log log = LogFactory.getLog("org.cachebench.cachewrappers.TangosolCacheWrapper");
   
       public void init(Properties parameters) throws Exception {
  -        logger.debug("Initializing the Tangosol Cache..");
  +        log.debug("Initializing the Tangosol Cache..");
           // Initialize the cache to pick the configuration file specified.
           // We need to do this so that tangosol knows which configuration it should be using.
           String configPath = parameters.getProperty("config");
           System.setProperty("tangosol.coherence.cacheconfig",configPath);
  -        logger.debug("Completed Initializing the Tangosol Cache");
  +        log.debug("Completed Initializing the Tangosol Cache");
       }
   
       public void setUp() throws Exception {
           // This is where we'd setup the cache instance that we'd be working with
  -        logger.debug("Running the Tangosol Setup....");
  +        log.debug("Running the Tangosol Setup....");
           cache = CacheFactory.getCache("VirtualCache");
  -        logger.debug("Completed the Tangosol Setup!");
  +        log.debug("Completed the Tangosol Setup!");
       }
   
       public void tearDown() throws Exception {
  @@ -49,7 +49,7 @@
   
       public void put(Object key, Object value) throws Exception
       {
  -        logger.warn("Put: Does not deal with non-Serializables, should not be called.");
  +        log.warn("Put: Does not deal with non-Serializables, should not be called.");
       }
   
       /* (non-Javadoc)
  @@ -57,7 +57,7 @@
        */
   //    public Object get(Object key) throws Exception
   //    {
  -//        logger.warn("Get: Does not deal with non-Serializables, should not be called.");
  +//        log.warn("Get: Does not deal with non-Serializables, should not be called.");
   //        return null;
   //    }
   
  
  
  
  1.5       +11 -5     CacheBenchFwk/src/org/cachebench/cachewrappers/EHCacheWrapper.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: EHCacheWrapper.java
  ===================================================================
  RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/cachewrappers/EHCacheWrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- EHCacheWrapper.java	13 Mar 2007 14:50:46 -0000	1.4
  +++ EHCacheWrapper.java	18 Apr 2007 19:09:29 -0000	1.5
  @@ -16,7 +16,7 @@
    * An implementation of SerializableCacheWrapper that uses EHCache as an underlying implementation.
    *
    * @author Manik Surtani (manik at surtani.org)
  - * @version $Id: EHCacheWrapper.java,v 1.4 2007/03/13 14:50:46 msurtani Exp $
  + * @version $Id: EHCacheWrapper.java,v 1.5 2007/04/18 19:09:29 msurtani Exp $
    */
   public class EHCacheWrapper implements SerializableCacheWrapper
   {
  @@ -39,7 +39,7 @@
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Unable to configure the treecache.  Using params " + parameters, e);
  +//            log.error("Unable to configure the treecache.  Using params " + parameters, e);
   //        }
      }
   
  @@ -58,7 +58,7 @@
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Unable to create cache", e);
  +//            log.error("Unable to create cache", e);
   //        }
      }
   
  @@ -92,7 +92,7 @@
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Unable to retrieve object with key [" + key + "] from cache", e);
  +//            log.error("Unable to retrieve object with key [" + key + "] from cache", e);
   //            return null;
   //        }
      }
  @@ -105,7 +105,7 @@
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Unable to empty cache", e);
  +//            log.error("Unable to empty cache", e);
   //        }
      }
   
  @@ -125,4 +125,10 @@
         logger.warn("Get: Does not deal with non-Serializables, should not be called.");
         return null;
      }
  +
  +   public int getNumMembers()
  +   {
  +      logger.warn("Not running in clustered mode!!!");
  +      return 1;
  +   }
   }
  
  
  
  1.3       +11 -2     CacheBenchFwk/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JBossCache200Wrapper.java
  ===================================================================
  RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- JBossCache200Wrapper.java	13 Mar 2007 14:50:46 -0000	1.2
  +++ JBossCache200Wrapper.java	18 Apr 2007 19:09:29 -0000	1.3
  @@ -26,16 +26,25 @@
   
      public void put(Object key, Object value) throws Exception
      {
  -      cache.put(new Fqn(new Object[]{"root", key}), key, value);
  +      // make sure the threads don't conflict!
  +      Fqn f = Fqn.fromString("/" + Thread.currentThread().getName() + "/" + key);
  +      cache.put(f, key, value);
      }
   
      public Object get(Object key) throws Exception
      {
  -      return cache.get(new Fqn(new Object[]{"root", key}), key);
  +      Fqn f = Fqn.fromString("/" + Thread.currentThread().getName() + "/" + key);
  +      return cache.get(f, key);
      }
   
      public void empty() throws Exception
      {
         cache.removeNode(Fqn.ROOT);
      }
  +
  +   public int getNumMembers()
  +   {
  +      return cache.getMembers().size();
  +   }
  +
   }
  
  
  
  1.6       +13 -13    CacheBenchFwk/src/org/cachebench/cachewrappers/JBossCacheWrapper.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JBossCacheWrapper.java
  ===================================================================
  RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/cachewrappers/JBossCacheWrapper.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- JBossCacheWrapper.java	13 Mar 2007 14:50:46 -0000	1.5
  +++ JBossCacheWrapper.java	18 Apr 2007 19:09:29 -0000	1.6
  @@ -8,13 +8,13 @@
    * An implementation of CacheWrapper that uses JBossCache as an underlying implementation.
    *
    * @author Manik Surtani (manik at surtani.org)
  - * @version $Id: JBossCacheWrapper.java,v 1.5 2007/03/13 14:50:46 msurtani Exp $
  + * @version $Id: JBossCacheWrapper.java,v 1.6 2007/04/18 19:09:29 msurtani Exp $
    */
   public class JBossCacheWrapper
   {//implements CacheWrapper
   /*{
       private TreeCache tree;
  -    private Log logger = LogFactory.getLog("org.cachebench.cachewrappers.JBossCacheWrapper");
  +    private Log log = LogFactory.getLog("org.cachebench.cachewrappers.JBossCacheWrapper");
   
       *//* (non-Javadoc)
        * @see org.jboss.cachebench.CacheWrapper#init(java.util.Properties)
  @@ -23,16 +23,16 @@
       {
   //        try
   //        {
  -            logger.debug("Initializing the cache");
  +            log.debug("Initializing the cache");
               //parameters.
               tree = new TreeCache();
   	        PropertyConfigurator conf = new PropertyConfigurator();
   	        conf.configure( tree, parameters.getProperty("config") );
  -            logger.debug("Finish Initializing the cache");
  +            log.debug("Finish Initializing the cache");
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Unable to configure the treecache.  Using params " + parameters, e);
  +//            log.error("Unable to configure the treecache.  Using params " + parameters, e);
   //        }
       }
   
  @@ -41,16 +41,16 @@
        *//*
       public void setUp() throws Exception
       {
  -        logger.debug("Run StepUp on Cache");
  +        log.debug("Run StepUp on Cache");
   //        try
   //        {
               tree.createService(); // not necessary, but is same as MBean lifecycle
   	        tree.startService(); // kick start tree cache
  -            logger.debug("Completed StepUp on Cache");
  +            log.debug("Completed StepUp on Cache");
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Unable to start the tree cache", e);
  +//            log.error("Unable to start the tree cache", e);
   //        }
       }
   
  @@ -59,10 +59,10 @@
        *//*
       public void tearDown() throws Exception
       {
  -        logger.debug("Cache Shutdown Initiated");
  +        log.debug("Cache Shutdown Initiated");
           tree.stopService();
           tree.destroyService();
  -        logger.debug("Cahce Shutdown Completed");
  +        log.debug("Cahce Shutdown Completed");
       }
   
       *//* (non-Javadoc)
  @@ -78,7 +78,7 @@
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Problems adding values to tree cache", e);
  +//            log.error("Problems adding values to tree cache", e);
   //        }
       }
   
  @@ -93,7 +93,7 @@
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Problems getting values to tree cache", e);
  +//            log.error("Problems getting values to tree cache", e);
   //            return null;
   //        }
       }
  @@ -106,7 +106,7 @@
   //        }
   //        catch (Exception e)
   //        {
  -//            logger.error("Problems emptying tree cache", e);
  +//            log.error("Problems emptying tree cache", e);
   //        }
       }*/
   
  
  
  



More information about the jboss-cvs-commits mailing list