asmuts      02/01/18 22:27:13

  Modified:    src/java/org/apache/stratum/jcs/access TestCacheAccess.java
               src/java/org/apache/stratum/jcs/auxiliary/disk/jisp
                        JISPCache.java
               src/java/org/apache/stratum/jcs/engine/behavior
                        IAttributes.java
               src/java/org/apache/stratum/jcs/engine/control Cache.java
               src/java/org/apache/stratum/jcs/engine Attributes.java
  Log:
  Removed the set and get flag methods that are in the ocs4j. They are too inflexible.
  
  Other ocs4j feature evaluations:
  I'm going to set up the ability to add element event notificaiton.
  See no need for sub regions.
  See no need for pool objects, though this is simple.  Basically a pool is put in the 
cache.  Not sure if they distribute.  This would be  a disaster.
  Stream objects may be nice, but they require some disk to be configured.  Makes the 
cache less pluggable.
  Cache loaders seem to add little.  A normal cache user is a cache loader of sorts.
  Remote synchronization or locking of elements looks nasty.  I don't want to go to 
this model.  It is too expensive and impossible to get right.  There is no way it 
works properly in osc4j.
  Wait for response seems unnecessary as well.
  osc4j got in the situation where an access object can't be shared.  Makes 
programming too combersome and they warn of memory leak dangers.
  
  Revision  Changes    Path
  1.8       +8 -8      
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java
  
  Index: TestCacheAccess.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestCacheAccess.java      18 Jan 2002 06:45:27 -0000      1.7
  +++ TestCacheAccess.java      19 Jan 2002 06:27:12 -0000      1.8
  @@ -457,8 +457,8 @@
                           else
                           {
                               Attributes attrp = new Attributes();
  -                            attrp.setFlags( attrp.LATERAL );
  -                            attrp.setFlags( attrp.REMOTE );
  +                            attrp.IS_LATERAL = true;
  +                            attrp.IS_REMOTE = true;
                               long n_start = System.currentTimeMillis();
                               cache_control.putInGroup( key,
                                   group,
  @@ -498,8 +498,8 @@
                           else
                           {
                               Attributes attrp = new Attributes();
  -                            attrp.setFlags( attrp.LATERAL );
  -                            attrp.setFlags( attrp.REMOTE );
  +                            attrp.IS_LATERAL = true;
  +                            attrp.IS_REMOTE = true;
                               long n_start = System.currentTimeMillis();
                               for ( int a = 0; a < num; a++ )
                               {
  @@ -523,8 +523,8 @@
                           else
                           {
                               Attributes attrp = new Attributes();
  -                            attrp.setFlags( attrp.LATERAL );
  -                            attrp.setFlags( attrp.REMOTE );
  +                            attrp.IS_LATERAL = true;
  +                            attrp.IS_REMOTE = true;
                               long n_start = System.currentTimeMillis();
                               for ( int n = 0; n < num; n++ )
                               {
  @@ -565,8 +565,8 @@
                           else
                           {
                               Attributes attrp = new Attributes();
  -                            attrp.setFlags( attrp.LATERAL );
  -                            attrp.setFlags( attrp.REMOTE );
  +                            attrp.IS_LATERAL = true;
  +                            attrp.IS_REMOTE = true;
                               long n_start = System.currentTimeMillis();
                               cache_control.put( key, val, attrp.copy() );
                               long n_end = System.currentTimeMillis();
  
  
  
  1.10      +0 -1      
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCache.java
  
  Index: JISPCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCache.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JISPCache.java    18 Jan 2002 22:40:13 -0000      1.9
  +++ JISPCache.java    19 Jan 2002 06:27:12 -0000      1.10
  @@ -82,7 +82,6 @@
    *@author     <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
    *@created    January 15, 2002
    *@version    $Id: ILateralCacheTCPListener.java,v 1.2 2002/01/18 22:08:26
  - *      asmuts Exp $
    */
   public class JISPCache implements ICache, Serializable
   {
  
  
  
  1.4       +0 -22     
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/behavior/IAttributes.java
  
  Index: IAttributes.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/behavior/IAttributes.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IAttributes.java  15 Jan 2002 21:33:34 -0000      1.3
  +++ IAttributes.java  19 Jan 2002 06:27:12 -0000      1.4
  @@ -29,17 +29,6 @@
   
       /////////////////////////////////////////////////
       /**
  -     *  Sets the flags attribute of the IAttributes object
  -     *
  -     *@param  flags  The new flags value
  -     */
  -    public void setFlags( long flags );
  -
  -
  -    //public void setLoader( CacheLoader loader );
  -
  -    /////////////////////////////////////////////////
  -    /**
        *  Sets the version attribute of the IAttributes object
        *
        *@param  version  The new version value
  @@ -93,17 +82,6 @@
        *@return    The size value
        */
       public int getSize();
  -
  -
  -    /////////////////////////////////////////
  -    /**
  -     *  Gets the set attribute of the IAttributes object
  -     *
  -     *@param  flags  Description of the Parameter
  -     *@return        The set value
  -     */
  -    public boolean isSet( long flags );
  -
   
       /////////////////////////////////////////
       /**
  
  
  
  1.9       +2 -3      
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/Cache.java
  
  Index: Cache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/Cache.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Cache.java        18 Jan 2002 21:54:35 -0000      1.8
  +++ Cache.java        19 Jan 2002 06:27:13 -0000      1.9
  @@ -448,9 +448,8 @@
                   {
                       p( "lateralcache in aux list" );
                       p( "cattr " + cacheAttr.getUseLateral() );
  -                    p( "attr  " + ce.getAttributes().isSet( Attributes.LATERAL ) );
                   }
  -                if ( cacheAttr.getUseLateral() && ce.getAttributes().isSet( 
Attributes.LATERAL ) && updateRemoteCache )
  +                if ( cacheAttr.getUseLateral() && ce.getAttributes().IS_LATERAL  && 
updateRemoteCache )
                   {
   
                       // later if we want a multicast, possibly delete abnormal 
broadcaster
  @@ -932,7 +931,7 @@
                                   MemoryElementDescriptor me = ( 
MemoryElementDescriptor ) entry.getValue();
                                   try
                                   {
  -                                    if ( aux.getCacheType() == 
ICacheType.LATERAL_CACHE && !me.ce.getAttributes().isSet( Attributes.LATERAL ) )
  +                                    if ( aux.getCacheType() == 
ICacheType.LATERAL_CACHE && !me.ce.getAttributes().IS_LATERAL )
                                       {
                                           continue;
                                       }
  
  
  
  1.4       +58 -117   
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/Attributes.java
  
  Index: Attributes.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/Attributes.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Attributes.java   15 Jan 2002 21:33:33 -0000      1.3
  +++ Attributes.java   19 Jan 2002 06:27:13 -0000      1.4
  @@ -10,13 +10,68 @@
   
   import org.apache.stratum.jcs.access.exception.InvalidArgumentException;
   
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + * notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + * notice, this list of conditions and the following disclaimer in
  + * the documentation and/or other materials provided with the
  + * distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if
  + * any, must include the following acknowlegement:
  + * "This product includes software developed by the
  + * Apache Software Foundation (http://www.apache.org/)."
  + * Alternately, this acknowlegement may appear in the software itself,
  + * if and wherever such third-party acknowlegements normally appear.
  + *
  + * 4. The names "The Jakarta Project", "Velocity", and "Apache Software
  + * Foundation" must not be used to endorse or promote products derived
  + * from this software without prior written permission. For written
  + * permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache"
  + * nor may "Apache" appear in their names without prior written
  + * permission of the Apache Group.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +
   import org.apache.stratum.jcs.engine.behavior.IAttributes;
   
   /**
    *  Element attribute descriptor class.
    *
  - *@author     asmuts
  + *@author     <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
    *@created    January 15, 2002
  + *@version    $Id: ILateralCacheTCPListener.java,v 1.2 2002/01/18 22:08:26
    */
   public class Attributes implements IAttributes, Serializable, Cloneable
   {
  @@ -201,7 +256,8 @@
               return attr;
           }
           catch ( Exception e )
  -        {}
  +        {
  +        }
           return null;
           /*
            * System.out.println( "cloning" );
  @@ -210,57 +266,6 @@
            */
       }
   
  -
  -    /////////////////////////////////////////////////
  -    // doesn't work, didn't have time to implement bitmap
  -    /**
  -     *  TODO: complete
  -     *
  -     *@param  flags  The new flags value
  -     */
  -    public void setFlags( long flags )
  -    {
  -        if ( flags == LATERAL )
  -        {
  -            IS_LATERAL = true;
  -            //System.out.println( "set IS_LATERAL to true" );
  -        }
  -        /*
  -         * if ( flags == NOFLUSH ) {
  -         * IS_NOFLUSH = true;
  -         * }
  -         * if ( flags == REPLY ) {
  -         * IS_REPLY = true;
  -         * }
  -         * if ( flags == SYNCHRONIZE ) {
  -         * IS_SYNCHRONIZE = true;
  -         * }
  -         */
  -        if ( flags == SPOOL )
  -        {
  -            IS_SPOOL = true;
  -        }
  -        /*
  -         * if ( flags == GROUP_TTL_DESTROY ) {
  -         * IS_GROUP_TTL_DESTROY = true;
  -         * }
  -         * if ( flags == ORIGINAL ) {
  -         * IS_ORIGINAL = true;
  -         * }
  -         */
  -        if ( flags == REMOTE )
  -        {
  -            IS_REMOTE = true;
  -        }
  -        if ( flags == ETERNAL )
  -        {
  -            IS_ETERNAL = true;
  -        }
  -    }
  -
  -
  -    //public void setLoader( CacheLoader loader ) {}
  -
       /////////////////////////////////////////////////
       /**
        *  Sets the version attribute of the Attributes object
  @@ -336,55 +341,6 @@
       }
   
   
  -/////////////////////////////////////////
  -    /**
  -     *  TODO: complete
  -     *
  -     *@param  flags  Description of the Parameter
  -     *@return        The set value
  -     */
  -    public boolean isSet( long flags )
  -    {
  -        boolean allSet = false;
  -        if ( flags == LATERAL )
  -        {
  -            allSet = IS_LATERAL;
  -        }
  -        /*
  -         * if ( flags == NOFLUSH ) {
  -         * allSet =  IS_NOFLUSH;
  -         * }
  -         * if ( flags == REPLY ) {
  -         * allSet =  IS_REPLY;
  -         * }
  -         * if ( flags == SYNCHRONIZE ) {
  -         * allSet =  IS_SYNCHRONIZE;
  -         * }
  -         */
  -        if ( flags == SPOOL )
  -        {
  -            allSet = IS_SPOOL;
  -        }
  -        /*
  -         * if ( flags == GROUP_TTL_DESTROY ) {
  -         * allSet =   IS_GROUP_TTL_DESTROY;
  -         * }
  -         * if ( flags == ORIGINAL ) {
  -         * allSet =  IS_ORIGINAL;
  -         * }
  -         */
  -        if ( flags == REMOTE )
  -        {
  -            allSet = IS_REMOTE;
  -        }
  -        if ( flags == ETERNAL )
  -        {
  -            allSet = IS_ETERNAL;
  -        }
  -        return allSet;
  -    }
  -
  -
       /////////////////////////////////////////
       /**
        *  Gets the createTime attribute of the Attributes object
  @@ -499,21 +455,6 @@
       public static void p( String s )
       {
           System.out.println( s );
  -    }
  -
  -
  -    /**
  -     *  Test harness.
  -     *
  -     *@param  args  The command line arguments
  -     */
  -    public static void main( String[] args )
  -    {
  -        Attributes attr = new Attributes();
  -        attr.setFlags( attr.LATERAL | attr.SPOOL );
  -        p( "set attr" );
  -        p( String.valueOf( attr.isSet( attr.LATERAL | attr.REMOTE ) ) );
  -        p( String.valueOf( attr.isSet( attr.LATERAL | attr.SPOOL | attr.REMOTE ) ) 
);
       }
   
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to