asmuts      02/01/20 23:00:34

  Modified:    src/java/org/apache/stratum/jcs/auxiliary/remote/server
                        RemoteCacheServer.java
               src/java/org/apache/stratum/jcs/auxiliary/remote
                        RemoteCacheListener.java RemoteCacheFactory.java
                        RemoteCacheAttributes.java RemoteCache.java
               src/conf remote.cache2.ccf remote.cache.ccf cache2.ccf
                        cache.ccf
               src/java/org/apache/stratum/jcs/auxiliary/remote/behavior
                        IRemoteCacheAttributes.java
               src/java/org/apache/stratum/jcs/engine CacheListeners.java
  Log:
  Working on clustering.  Can keep remotes consistent, need to add option to keep all 
locals in a cluster consistent.  This is a bit tricky.
  
  Revision  Changes    Path
  1.4       +42 -19    
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheServer.java
  
  Index: RemoteCacheServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheServer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheServer.java    15 Jan 2002 21:33:33 -0000      1.3
  +++ RemoteCacheServer.java    21 Jan 2002 07:00:33 -0000      1.4
  @@ -140,22 +140,22 @@
           }
   
           /*
  -         * / TOO UGLY
  -         * / should register listeners with other clusters here.
  -         * / CLUSTERLISTENERS
  -         * / populate attr
  +         * TOO UGLY
  +         * should register listeners with other clusters here.
  +         * CLUSTERLISTENERS
  +         * populate attr
            * RemoteCacheAttributes rca = new RemoteCacheAttributes();
            * Properties props = RemoteUtils.loadProps(prop);
            * rca.setClusterServers( props.getProperty("remote.clusterServers") );
            * RemoteCacheClusterFactory rccf = new RemoteCacheClusterFactory();
            * rca.setCacheName( "SYSTEM_CLUSTER" );
  -         * / this creates managers for each on cluster list, so failur can be 
managed
  -         * / individually
  +         * this creates managers for each on cluster list, so failur can be managed
  +         * individually
            * ICache ic = rccf.createCache( rca );
  -         * / listenersMap is a local cache or cache service that has a group of 
assoicated
  -         * / listeners.  When an element is put in the remote cache it looks at the
  -         * / cache names, get the listenersMap entry for it and then sends a put to 
all the
  -         * / listeners in that queue
  +         * listenersMap is a local cache or cache service that has a group of 
assoicated
  +         * listeners.  When an element is put in the remote cache it looks at the
  +         * cache names, get the listenersMap entry for it and then sends a put to 
all the
  +         * listeners in that queue
            * clusterListenersMap.put("SYSTEM_CLUSTER", new CacheListeners(ic) );
            */
           /*
  @@ -163,7 +163,7 @@
            * for (Iterator itr = 
RemoteCacheClusterManager.instances.values().iterator(); itr.hasNext();) {
            * node++;
            * RemoteCacheClusterManager mgr = (RemoteCacheClusterManager)itr.next();
  -         * / will repeat, ok
  +         * will repeat, ok
            * clusterListenersMap.put("SYSTEM_CLUSTER", new 
CacheListeners(mgr.getCache("SYSTEM_CLUSTER")) );
            * }
            */
  @@ -317,6 +317,13 @@
           {
               CacheListeners cacheDesc = getCacheListeners( item.getCacheName() );
               Object val = item.getVal();
  +
  +            Integer remoteTypeL = ( Integer ) idTypeMap.get( new Byte( requesterId 
) );
  +            boolean fromRemote = false;
  +            if ( remoteTypeL.intValue() == IRemoteCacheAttributes.CLUSTER )
  +            {
  +                fromRemote = true;
  +            }
               // ordered cache item update and notification.
               synchronized ( cacheDesc )
               {
  @@ -330,11 +337,24 @@
                       //Can go ICompositeCache
                       //Cache c = (Cache)cacheDesc.cache;
                       ICompositeCache c = ( ICompositeCache ) cacheDesc.cache;
  -                    c.update( item, false );
  -                    // bypassing this may leave no cluster recovery
  +                    //TODO; make this a bit less of a hack
  +                    // If the source of this request was from a cluster, then
  +                    // update the remote caches.  COnsider it a local update.
  +                    // This requires that two local caches not be connected to
  +                    // two clustered remote caches. The failover runner will
  +                    // have to make sure of this.  ALos,t he local cache needs
  +                    // avoid updating this source.  Will need to pass the source
  +                    // id somehow.  The remote cache should udate all local caches
  +                    // but not update the cluster source.  Cluster remote caches
  +                    // should only be updated by the server and not the RemoteCache.
  +                    // PUT LOGIC IN REMOTE CACHE
  +                    // WILL TRY UPDATING REMOTES
  +                    //c.update( item, ICache.REMOTE_INVOKATION );
  +                    c.update( item, ICache.LOCAL_INVOKATION );
                   }
                   catch ( Exception oee )
  -                {}
  +                {
  +                }
   
                   ICacheEventQueue[] qlist = getEventQList( cacheDesc, requesterId );
   
  @@ -349,11 +369,10 @@
                   // may be able to use the same listener code
   
                   // make sure the requester isn't a CLUSTER
  -                Integer remoteTypeL = ( Integer ) idTypeMap.get( new Byte( 
requesterId ) );
                   // right now 0 is the what will be sent since the call back does not
                   // identify the id of the observer.  Clusters either need to  be 
put via the remote
                   // or they should use 0 to signify that they are clusters
  -                if ( ( remoteTypeL != null ) && ( requesterId != 0 ) && ( 
remoteTypeL.intValue() != IRemoteCacheAttributes.CLUSTER ) )
  +                if ( ( remoteTypeL != null ) && ( requesterId != 0 ) && ( 
!fromRemote ) )
                   {
                       //if ( false ) {
                       if ( debug )
  @@ -500,7 +519,8 @@
           else
           {
               ICompositeCache c = ( ICompositeCache ) cacheDesc.cache;
  -            return c.get( key, container, false );
  +            //return c.get( key, container, ICache.REMOTE_INVOKATION );
  +            return c.get( key, container, ICache.LOCAL_INVOKATION );
           }
           //return cacheDesc == null ? null : cacheDesc.cache.get(key, container);
           // could add some clustered get
  @@ -544,7 +564,9 @@
               synchronized ( cacheDesc )
               {
                   // No need to notify if it was not cached.
  -                if ( cacheDesc.cache.remove( key ) )
  +                ICompositeCache c = ( ICompositeCache ) cacheDesc.cache;
  +                //if ( c.remove( key, ICache.REMOTE_INVOKATION ) )
  +                if ( c.remove( key, ICache.LOCAL_INVOKATION ) )
                   {
                       //p( "propogating remove, was cached" );
   
  @@ -789,7 +811,8 @@
                       }
                   }
                   catch ( IOException ioe )
  -                {}
  +                {
  +                }
                   //eventQMap.put(listener, new CacheEventQueue(listener, 
getRequester(), cacheName));
                   eventQMap.put( listener, new CacheEventQueue( listener, id, 
cacheName ) );
   
  
  
  
  1.5       +23 -7     
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheListener.java
  
  Index: RemoteCacheListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheListener.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteCacheListener.java  17 Jan 2002 00:19:37 -0000      1.4
  +++ RemoteCacheListener.java  21 Jan 2002 07:00:33 -0000      1.5
  @@ -32,7 +32,7 @@
   
   ///////////////////////////////////////////////////////////////////////
   /**
  - *  Registered with RemoteCache server.  The server updates the local caches via
  + *  Registered with RemoteCache server. The server updates the local caches via
    *  this class.
    *
    *@author     asmuts
  @@ -260,13 +260,17 @@
   
               getCacheManager();
               ICompositeCache cache = ( ICompositeCache ) cacheMgr.getCache( 
cb.getCacheName() );
  -            cache.update( cb, ICache.EXCLUDE_REMOTE_CACHE );
  -
  -
  -         }
  +            if ( this.irca.getLocalClusterConsistency() && 
this.irca.getRemoteType() != irca.CLUSTER )
  +            {
  +                cache.update( cb, ICache.EXCLUDE_REMOTE_CACHE );
  +            }
  +            else
  +            {
  +                cache.update( cb, ICache.INCLUDE_REMOTE_CACHE );
  +            }
  +        }
   
           return;
  -
       }
   
   
  @@ -301,7 +305,19 @@
   
           getCacheManager();
           Cache cache = ( Cache ) cacheMgr.getCache( cacheName );
  -        cache.remove( key, cache.REMOTE_INVOKATION );
  +        // If cluster updates another cluster, then update listeners to that
  +        // cluster.
  +        // Do not communicate with cluster except via server.
  +        // separates the remote from the local.  Must run a server to
  +        // cluster, else it can be run inside a local.
  +        if ( this.irca.getLocalClusterConsistency() && this.irca.getRemoteType() != 
irca.CLUSTER )
  +        {
  +            cache.remove( key, cache.REMOTE_INVOKATION );
  +        }
  +        else
  +        {
  +            cache.remove( key, cache.LOCAL_INVOKATION );
  +        }
       }
   
   
  
  
  
  1.4       +6 -2      
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheFactory.java
  
  Index: RemoteCacheFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheFactory.java   15 Jan 2002 21:33:32 -0000      1.3
  +++ RemoteCacheFactory.java   21 Jan 2002 07:00:33 -0000      1.4
  @@ -68,8 +68,10 @@
               // not necessary if a failover list is defined
               // REGISTER PRIMARY LISTENER
               // if it is a primary
  +            boolean primayDefined = false;
               if ( rca.getRemoteHost() != null )
               {
  +                primayDefined = true;
   
                   failovers.add( rca.getRemoteHost() + ":" + rca.getRemotePort() );
   
  @@ -90,8 +92,10 @@
               if ( failoverList != null )
               {
                   StringTokenizer fit = new StringTokenizer( failoverList, "," );
  +                int fCnt = 0;
                   while ( fit.hasMoreElements() )
                   {
  +                    fCnt++;
   
                       String server = ( String ) fit.nextElement();
                       failovers.add( server );
  @@ -100,9 +104,9 @@
                       rca.setRemotePort( Integer.parseInt( server.substring( 
server.indexOf( ":" ) + 1 ) ) );
                       RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca );
                       // add a listener if there are none, need to tell rca what 
number it is at
  -                    if ( noWaits.size() <= 0 )
  +                    if ( (!primayDefined && fCnt == 1) || noWaits.size() <= 0 )
                       {
  -                        ICache ic = rcm.getCache( rca.getCacheName() );
  +                        ICache ic = rcm.getCache( rca );
                           if ( ic != null )
                           {
                               noWaits.add( ic );
  
  
  
  1.4       +20 -0     
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheAttributes.java
  
  Index: RemoteCacheAttributes.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheAttributes.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheAttributes.java        15 Jan 2002 21:33:32 -0000      1.3
  +++ RemoteCacheAttributes.java        21 Jan 2002 07:00:33 -0000      1.4
  @@ -41,6 +41,7 @@
       private boolean removeUponRemotePut = true;
       private boolean getOnly = false;
   
  +    private boolean localClusterConsistency = false;
   
       ////////////////////////////////////////////////////
       /**
  @@ -405,6 +406,25 @@
           this.getOnly = r;
       }
   
  +    /**
  +     *  Should cluster updates be propogated to the locals
  +     *
  +     *@return    The localClusterConsistency value
  +     */
  +    public boolean getLocalClusterConsistency()
  +    {
  +        return    localClusterConsistency;
  +    }
  +
  +    /**
  +     *  Should cluster updates be propogated to the locals
  +     *
  +     *@param  r  The new localClusterConsistency value
  +     */
  +    public void setLocalClusterConsistency( boolean r )
  +    {
  +        this.localClusterConsistency = r;
  +    }
   
       ////////////////////////////////////////////////////
       /**
  
  
  
  1.4       +85 -53    
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCache.java
  
  Index: RemoteCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCache.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCache.java  15 Jan 2002 21:33:32 -0000      1.3
  +++ RemoteCache.java  21 Jan 2002 07:00:33 -0000      1.4
  @@ -34,7 +34,7 @@
       //true;
       Logger log;
       private static int numCreated = 0;
  -    private static boolean debug = false;
  +    private static boolean debug = true;
       private static boolean debugR = false;
       private static boolean debugPut = false;
   
  @@ -95,9 +95,9 @@
               p( "irca = " + irca.toString() );
           }
           /*
  -         * / TODO
  -         * / should be done by the remote cache, not the job of the hub manager
  -         * / Set up the idle period for the RemoteCacheMonitor.
  +         * TODO
  +         * should be done by the remote cache, not the job of the hub manager
  +         * Set up the idle period for the RemoteCacheMonitor.
            * long monPeriod = 0;
            * try {
            * monPeriod = 
Long.parseLong(props.getProperty("remote.monitor.idle.period", "0"));
  @@ -182,27 +182,34 @@
       public void update( ICacheElement ce )
           throws IOException
       {
  -        if ( !this.irca.getGetOnly() )
  +        // Do not communicate with cluster except via server.
  +        // separates the remote from the local.  Must run a server to
  +        // cluster, else it can be run inside a local.
  +        if ( this.irca.getRemoteType() != irca.CLUSTER )
           {
  -            try
  -            {
  -                remote.update( ce, RemoteCacheInfo.listenerId );
  -            }
  -            catch ( NullPointerException npe )
  +
  +            if ( !this.irca.getGetOnly() )
               {
  -                log.error( npe, "npe for ce = " + ce + "ce.attr = " + 
ce.getAttributes() );
  -                return;
  +                try
  +                {
  +                    remote.update( ce, RemoteCacheInfo.listenerId );
  +                }
  +                catch ( NullPointerException npe )
  +                {
  +                    log.error( npe, "npe for ce = " + ce + "ce.attr = " + 
ce.getAttributes() );
  +                    return;
  +                }
  +                catch ( Exception ex )
  +                {
  +                    handleException( ex, "Failed to put " + ce.getKey() + " to " + 
ce.getCacheName() );
  +                    //throw ex;
  +                }
               }
  -            catch ( Exception ex )
  +            else
               {
  -                handleException( ex, "Failed to put " + ce.getKey() + " to " + 
ce.getCacheName() );
  -                //throw ex;
  +                //p( "get only mode, irca = " + irca.toString() );
               }
           }
  -        else
  -        {
  -            //p( "get only mode, irca = " + irca.toString() );
  -        }
       }
   
   
  @@ -270,22 +277,31 @@
       public Serializable get( Serializable key, boolean container )
           throws IOException
       {
  -        try
  -        {
  -            return remote.get( cacheName, sanitized( key ), container );
  -        }
  -        catch ( ObjectNotFoundException one )
  +        // TODO: rethink this with gets
  +        // Do not communicate with cluster except via server.
  +        // separates the remote from the local.  Must run a server to
  +        // cluster, else it can be run inside a local.
  +        if ( this.irca.getRemoteType() != irca.CLUSTER )
           {
  -            log.debug( "didn't find element " + key + " in remote" );
  -            return null;
  -        }
  -        catch ( Exception ex )
  -        {
  -            handleException( ex, "Failed to get " + key + " from " + cacheName );
  -            return null;
  -            // never executes; just keep the compiler happy.
  -            //throw ex;
  +
  +            try
  +            {
  +                return remote.get( cacheName, sanitized( key ), container );
  +            }
  +            catch ( ObjectNotFoundException one )
  +            {
  +                log.debug( "didn't find element " + key + " in remote" );
  +                return null;
  +            }
  +            catch ( Exception ex )
  +            {
  +                handleException( ex, "Failed to get " + key + " from " + cacheName 
);
  +                return null;
  +                // never executes; just keep the compiler happy.
  +                //throw ex;
  +            }
           }
  +        return null;
       }
   
   
  @@ -300,20 +316,28 @@
       public boolean remove( Serializable key )
           throws IOException
       {
  -        if ( !this.irca.getGetOnly() )
  +
  +        // Do not communicate with cluster except via server.
  +        // separates the remote from the local.  Must run a server to
  +        // cluster, else it can be run inside a local.
  +        if ( this.irca.getRemoteType() != irca.CLUSTER )
           {
  -            if ( dbug )
  -            {
  -                p( "remove> key=" + key );
  -            }
  -            try
  -            {
  -                remote.remove( cacheName, sanitized( key ), 
RemoteCacheInfo.listenerId );
  -            }
  -            catch ( Exception ex )
  +
  +            if ( !this.irca.getGetOnly() )
               {
  -                handleException( ex, "Failed to remove " + key + " from " + 
cacheName );
  -                //throw ex;
  +                if ( dbug )
  +                {
  +                    p( "remove> key=" + key );
  +                }
  +                try
  +                {
  +                    remote.remove( cacheName, sanitized( key ), 
RemoteCacheInfo.listenerId );
  +                }
  +                catch ( Exception ex )
  +                {
  +                    handleException( ex, "Failed to remove " + key + " from " + 
cacheName );
  +                    //throw ex;
  +                }
               }
           }
           return false;
  @@ -329,16 +353,24 @@
       public void removeAll()
           throws IOException
       {
  -        if ( !this.irca.getGetOnly() )
  +
  +        // Do not communicate with cluster except via server.
  +        // separates the remote from the local.  Must run a server to
  +        // cluster, else it can be run inside a local.
  +        if ( this.irca.getRemoteType() != irca.CLUSTER )
           {
  -            try
  -            {
  -                remote.removeAll( cacheName, RemoteCacheInfo.listenerId );
  -            }
  -            catch ( Exception ex )
  +
  +            if ( !this.irca.getGetOnly() )
               {
  -                handleException( ex, "Failed to remove all from " + cacheName );
  -                //throw ex;
  +                try
  +                {
  +                    remote.removeAll( cacheName, RemoteCacheInfo.listenerId );
  +                }
  +                catch ( Exception ex )
  +                {
  +                    handleException( ex, "Failed to remove all from " + cacheName );
  +                    //throw ex;
  +                }
               }
           }
       }
  
  
  
  1.4       +25 -28    jakarta-turbine-stratum/src/conf/remote.cache2.ccf
  
  Index: remote.cache2.ccf
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/conf/remote.cache2.ccf,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- remote.cache2.ccf 20 Jan 2002 01:47:56 -0000      1.3
  +++ remote.cache2.ccf 21 Jan 2002 07:00:33 -0000      1.4
  @@ -2,66 +2,63 @@
   # Registry used to register and provide the IRmiCacheService service.
   registry.host=localhost
   registry.port=1103
  -#remote.clusterServers=localhost:1103
  -#remote.cache.service.name=RemoteCache
   # call back port to local caches.
   remote.cache.service.port=1101
   # tomcat config
   remote.tomcat.on=false
   remote.tomcat.xml=@project_home_f@bin/conf/remote.tomcat.xml
   
  +
   ##############################################################
   ################## DEFAULT CACHE REGION  #####################
   # sets the default aux value for any non configured caches
  -jcs.default=DC
  +jcs.default=DC,RCluster1
   jcs.default.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
   jcs.default.cacheattributes.MaxObjects=1000
   
   # should be defined for the storage of group attribute list
  -jcs.system.groupIdCache=DC
  +jcs.system.groupIdCache=DC,RCluster1
   
jcs.system.groupIdCache.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
   jcs.system.groupIdCache.cacheattributes.MaxObjects=1000
    
   
   ##############################################################
   ################## CACHE REGIONS AVAILABLE ###################
  -jcs.auxiliary.RCluster=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
  
-jcs.auxiliary.RCluster.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
  -jcs.auxiliary.RCluster.attributes.RemoteTypeName=CLUSTER
  -jcs.auxiliary.RCluster.attributes.ClusterServers=localhost:1102
  -jcs.auxiliary.RC.attributes.RemoveUponRemotePut=false
  -
  -jcs.region.test=DC
  
-jcs.region.test.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  -jcs.region.test.cacheattributes.MaxObjects=100
  - 
  -jcs.region.test2=DC
  
-jcs.region.test2.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  -jcs.region.test2.cacheattributes.MaxObjects=1000
  -
  -jcs.region.test3=DC
  
-jcs.region.test3.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  -jcs.region.test3.cacheattributes.MaxObjects=10000
  +jcs.region.testCache1=DC,RCluster1
  
+jcs.region.testCache1.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  +jcs.region.testCache1.cacheattributes.MaxObjects=1000
   
   
   ##############################################################
   ################## AUXILIARY CACHES AVAILABLE ################
  +# server to update for clustering -- remote.cache.ccf 1
  +jcs.auxiliary.RCluster1=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
  
+jcs.auxiliary.RCluster1.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
  +jcs.auxiliary.RCluster1.attributes.RemoteTypeName=CLUSTER
  +jcs.auxiliary.RCluster1.attributes.RemoveUponRemotePut=false
  +jcs.auxiliary.RCluster1.attributes.ClusterServers=localhost:1102
  +jcs.auxiliary.RCluster1.attributes.GetOnly=false
  +jcs.auxiliary.RCluster1.attributes.LocalClusterConsistency=true
  +
  +# server to update for clustering
  +jcs.auxiliary.RCluster2=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
  
+jcs.auxiliary.RCluster2.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
  +jcs.auxiliary.RCluster2.attributes.RemoteTypeName=CLUSTER
  +jcs.auxiliary.RCluster2.attributes.RemoveUponRemotePut=false
  +jcs.auxiliary.RCluster2.attributes.ClusterServers=localhost:1104
  +jcs.auxiliary.RCluster2.attributes.GetOnly=false
  +jcs.auxiliary.RCluster2.attributes.LocalClusterConsistency=true
  +
   jcs.auxiliary.DC=org.apache.stratum.jcs.auxiliary.disk.DiskCacheFactory
   
jcs.auxiliary.DC.attributes=org.apache.stratum.jcs.auxiliary.disk.DiskCacheAttributes
   jcs.auxiliary.DC.attributes.DiskPath=@project_home@/raf/remote
   
  + 
   jcs.auxiliary.LC=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheFactory
   
jcs.auxiliary.LC.attributes=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheAttributes
   jcs.auxiliary.LC.attributes.TransmissionTypeName=UDP
   jcs.auxiliary.LC.attributes.UdpMulticastAddr=228.5.6.7
   jcs.auxiliary.LC.attributes.UdpMulticastPort=6789
  -
  -jcs.auxiliary.RC=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
  
-jcs.auxiliary.RC.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
  -jcs.auxiliary.RC.attributes.RemoteHost=localhost
  -jcs.auxiliary.RC.attributes.RemotePort=1101
  -#jcs.auxiliary.RC.attributes.LocalPort=1101
  -#jcs.auxiliary.RC.attributes.RemoteServiceName=RemoteCache
   
   # example of how to configure the http version of the lateral cache
   jcs.auxiliary.LCHTTP=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheFactory
  
  
  
  1.5       +23 -32    jakarta-turbine-stratum/src/conf/remote.cache.ccf
  
  Index: remote.cache.ccf
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/conf/remote.cache.ccf,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- remote.cache.ccf  20 Jan 2002 01:47:56 -0000      1.4
  +++ remote.cache.ccf  21 Jan 2002 07:00:33 -0000      1.5
  @@ -2,8 +2,6 @@
   # Registry used to register and provide the IRmiCacheService service.
   registry.host=localhost
   registry.port=1102
  -# remote.clusterServers=localhost:1101
  -# remote.cache.service.name=RemoteCache
   # call back port to local caches.
   remote.cache.service.port=1101
   # tomcat config
  @@ -14,55 +12,48 @@
   ##############################################################
   ################## DEFAULT CACHE REGION  #####################
   # sets the default aux value for any non configured caches
  -jcs.default=DC
  +jcs.default=DC,RCluster1
   jcs.default.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
   jcs.default.cacheattributes.MaxObjects=1000
   
   # should be defined for the storage of group attribute list
  -jcs.system.groupIdCache=DC,RClusterGroup
  +jcs.system.groupIdCache=DC,RCluster1
   
jcs.system.groupIdCache.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
   jcs.system.groupIdCache.cacheattributes.MaxObjects=1000
    
   
   ##############################################################
   ################## CACHE REGIONS AVAILABLE ###################
  -jcs.region.test=DC
  
-jcs.region.test.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  -jcs.region.test.cacheattributes.MaxObjects=100
  - 
  -jcs.region.test2=DC
  
-jcs.region.test2.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  -jcs.region.test2.cacheattributes.MaxObjects=1000
  -
  -jcs.region.testCache=DC
  
-jcs.region.testCache.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  -jcs.region.testCache.cacheattributes.MaxObjects=1000
  -
  -jcs.region.test3=DC
  
-jcs.region.test3.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  -jcs.region.test3.cacheattributes.MaxObjects=10000
  +jcs.region.testCache1=DC,RCluster1
  
+jcs.region.testCache1.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
  +jcs.region.testCache1.cacheattributes.MaxObjects=1000
   
   
   ##############################################################
   ################## AUXILIARY CACHES AVAILABLE ################
  
-jcs.auxiliary.RClusterGroup=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
  
-jcs.auxiliary.RClusterGroup.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
  -jcs.auxiliary.RClusterGroup.attributes.RemoteTypeName=CLUSTER
  -#jcs.auxiliary.RClusterGroup.attributes.ClusterServers=localhost:1101
  -jcs.auxiliary.RClusterGroup.attributes.RemoveUponRemotePut=false
  -jcs.auxiliary.RClusterGroup.attributes.GetOnly=true
  +# server to update for clustering -- remote.cache.ccf 2
  +jcs.auxiliary.RCluster1=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
  
+jcs.auxiliary.RCluster1.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
  +jcs.auxiliary.RCluster1.attributes.RemoteTypeName=CLUSTER
  +jcs.auxiliary.RCluster1.attributes.RemoveUponRemotePut=false
  +jcs.auxiliary.RCluster1.attributes.ClusterServers=localhost:1103
  +jcs.auxiliary.RCluster1.attributes.GetOnly=false
  +jcs.auxiliary.RCluster1.attributes.LocalClusterConsistency=true
  +
  +# server to update for clustering
  +jcs.auxiliary.RCluster2=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
  
+jcs.auxiliary.RCluster2.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
  +jcs.auxiliary.RCluster2.attributes.RemoteTypeName=CLUSTER
  +jcs.auxiliary.RCluster2.attributes.RemoveUponRemotePut=false
  +jcs.auxiliary.RCluster2.attributes.ClusterServers=localhost:1104
  +jcs.auxiliary.RCluster2.attributes.GetOnly=false
  +jcs.auxiliary.RCluster2.attributes.LocalClusterConsistency=true
   
   jcs.auxiliary.DC=org.apache.stratum.jcs.auxiliary.disk.DiskCacheFactory
   
jcs.auxiliary.DC.attributes=org.apache.stratum.jcs.auxiliary.disk.DiskCacheAttributes
   jcs.auxiliary.DC.attributes.DiskPath=@project_home@/raf/remote
   
  -jcs.auxiliary.RCluster=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
  
-jcs.auxiliary.RCluster.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
  -jcs.auxiliary.RCluster.attributes.RemoteTypeName=CLUSTER
  -#jcs.auxiliary.RCluster.attributes.ClusterServers=localhost:1101
  -jcs.auxiliary.RCluster.attributes.RemoveUponRemotePut=false
  -jcs.auxiliary.RCluster.attributes.GetOnly=false
  -
  + 
   jcs.auxiliary.LC=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheFactory
   
jcs.auxiliary.LC.attributes=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheAttributes
   jcs.auxiliary.LC.attributes.TransmissionTypeName=UDP
  
  
  
  1.5       +3 -5      jakarta-turbine-stratum/src/conf/cache2.ccf
  
  Index: cache2.ccf
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/conf/cache2.ccf,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- cache2.ccf        18 Jan 2002 21:54:14 -0000      1.4
  +++ cache2.ccf        21 Jan 2002 07:00:33 -0000      1.5
  @@ -37,20 +37,18 @@
   
jcs.auxiliary.HC.attributes=org.apache.stratum.jcs.auxiliary.disk.hsql.HSQLCacheAttributes
   jcs.auxiliary.HC.attributes.DiskPath=@project_home@/hsql
   
  -
  +# standard disk cache
   jcs.auxiliary.DC=org.apache.stratum.jcs.auxiliary.disk.DiskCacheFactory
   
jcs.auxiliary.DC.attributes=org.apache.stratum.jcs.auxiliary.disk.DiskCacheAttributes
   jcs.auxiliary.DC.attributes.DiskPath=@project_home@/raf
   
  -# need to make put or invalidate an option
  -# just a remove lock to add
  +# connects to the server started by "startRemoteCacheServer 2"
   jcs.auxiliary.RC=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
   
jcs.auxiliary.RC.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
   jcs.auxiliary.RC.attributes.RemoteHost=localhost
   jcs.auxiliary.RC.attributes.RemotePort=1103
  -#jcs.auxiliary.RC.attributes.LocalPort=1103
  +jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1103,localhost:1102
   jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true
  -#jcs.auxiliary.RC.attributes.RemoteServiceName=RemoteCache
   
   # unreliable
   jcs.auxiliary.LUDP=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheFactory
  
  
  
  1.7       +3 -5      jakarta-turbine-stratum/src/conf/cache.ccf
  
  Index: cache.ccf
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/conf/cache.ccf,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- cache.ccf 18 Jan 2002 22:40:13 -0000      1.6
  +++ cache.ccf 21 Jan 2002 07:00:33 -0000      1.7
  @@ -8,7 +8,7 @@
   
   # SYSTEM CACHE
   # should be defined for the storage of group attribute list
  -jcs.system.groupIdCache=DC,RGroup
  +jcs.system.groupIdCache=DC,RFailover
   
jcs.system.groupIdCache.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
   jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
   
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.stratum.jcs.engine.memory.lru.LRUMemoryCache
  @@ -22,7 +22,7 @@
   jcs.region.testCache1.cacheattributes.MaxObjects=1000
   
jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.stratum.jcs.engine.memory.lru.LRUMemoryCache
   
  -jcs.region.testCache2=DC,LTCP
  +jcs.region.testCache2=DC
   
jcs.region.testCache2.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes
   jcs.region.testCache2.cacheattributes.MaxObjects=1000
   
jcs.region.testCache2.cacheattributes.MemoryCacheName=org.apache.stratum.jcs.engine.memory.lru.LRUMemoryCache
  @@ -49,9 +49,7 @@
   jcs.auxiliary.RFailover=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory
   
jcs.auxiliary.RFailover.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes
   jcs.auxiliary.RFailover.attributes.RemoteTypeName=LOCAL
  -jcs.auxiliary.RFailover.attributes.RemoteHost=localhost
  -jcs.auxiliary.RFailover.attributes.RemotePort=1102
  -jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1102,localhost:1103
  +jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1102
   jcs.auxiliary.RFailover.attributes.GetOnly=false
   
   # Primary Disk Cache-- faster than the rest because of memory key storage
  
  
  
  1.4       +14 -0     
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java
  
  Index: IRemoteCacheAttributes.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IRemoteCacheAttributes.java       15 Jan 2002 21:33:32 -0000      1.3
  +++ IRemoteCacheAttributes.java       21 Jan 2002 07:00:34 -0000      1.4
  @@ -225,4 +225,18 @@
        */
       public void setGetOnly( boolean r );
   
  +    /**
  +     *  Should cluster updates be propogated to the locals
  +     *
  +     *@return    The localClusterConsistency value
  +     */
  +    public boolean getLocalClusterConsistency();
  +
  +    /**
  +     *  Should cluster updates be propogated to the locals
  +     *
  +     *@param  r  The new localClusterConsistency value
  +     */
  +    public void setLocalClusterConsistency( boolean r );
  +
   }
  
  
  
  1.4       +1 -0      
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheListeners.java
  
  Index: CacheListeners.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheListeners.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CacheListeners.java       15 Jan 2002 21:33:33 -0000      1.3
  +++ CacheListeners.java       21 Jan 2002 07:00:34 -0000      1.4
  @@ -4,6 +4,7 @@
   import java.util.Map;
   
   import org.apache.stratum.jcs.engine.behavior.ICache;
  +import org.apache.stratum.jcs.engine.behavior.ICompositeCache;
   
   /**
    *  Used to associates a set of [cache listener to cache event queue] for a
  
  
  

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

Reply via email to