You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2006/03/23 05:20:44 UTC

svn commit: r388027 - in /tomcat/container/tc5.5.x/modules: groupcom/src/share/org/apache/catalina/tribes/tipis/ ha/src/share/org/apache/catalina/ha/session/

Author: fhanik
Date: Wed Mar 22 20:20:42 2006
New Revision: 388027

URL: http://svn.apache.org/viewcvs?rev=388027&view=rev
Log:
slowly getting somewhere

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/BackupManager.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=388027&r1=388026&r2=388027&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java Wed Mar 22 20:20:42 2006
@@ -133,10 +133,10 @@
         this.channel.addChannelListener(this);
         this.channel.addMembershipListener(this);
 
-        broadcast(MapMessage.MSG_START,true);
-
         //transfer state from another map
         transferState();
+        broadcast(MapMessage.MSG_START,true);
+
     }
 
     private void broadcast(int msgtype, boolean rpc) {
@@ -365,8 +365,10 @@
             mapmsg.deserialize(getExternalLoaders());
         } catch (IOException x) {
             log.error("Unable to deserialize MapMessage.", x);
+            return;
         } catch (ClassNotFoundException x) {
             log.error("Unable to deserialize MapMessage.", x);
+            return;
         }
         if (mapmsg.getMsgType() == MapMessage.MSG_START) {
             mapMemberAdded(mapmsg.getBackupNodes()[0]);

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java?rev=388027&r1=388026&r2=388027&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java Wed Mar 22 20:20:42 2006
@@ -132,17 +132,18 @@
         //publish the data out to all nodes
         MapMessage msg = new MapMessage(getMapContextName(), MapMessage.MSG_PROXY, false,
                                         (Serializable) key, null, null, wrap(backup));
-        getChannel().send(getMapMembers(), msg,Channel.SEND_OPTIONS_DEFAULT);
+        getChannel().send(getMapMembers(), msg,getChannelSendOptions());
 
         //publish the backup data to one node
         msg = new MapMessage(getMapContextName(), MapMessage.MSG_BACKUP, false,
                              (Serializable) key, (Serializable) value, null, wrap(backup));
-        getChannel().send(new Member[] {backup}, msg, Channel.SEND_OPTIONS_DEFAULT);
+        getChannel().send(new Member[] {backup}, msg, getChannelSendOptions());
         return wrap(backup);
     }
     
     public Object get(Object key) {
         MapEntry entry = (MapEntry)super.get(key);
+        System.out.println("Requesting id:"+key+" entry:"+entry);
         if ( entry == null ) return null;
         if ( !entry.isPrimary() ) {
             //if the message is not primary, we need to retrieve the latest value
@@ -160,7 +161,7 @@
                         return null;
                     }
                     msg = (MapMessage) resp[0].getMessage();
-
+                    msg.deserialize(getExternalLoaders());
                     backup = entry.getBackupNodes();
                     if ( entry.getValue() instanceof ReplicatedMapEntry ) {
                         ReplicatedMapEntry val = (ReplicatedMapEntry)entry.getValue();
@@ -174,7 +175,7 @@
                 } else if ( entry.isProxy() ) {
                     //invalidate the previous primary
                     msg = new MapMessage(getMapContextName(),MapMessage.MSG_PROXY,false,(Serializable)key,null,null,backup);
-                    getChannel().send(backup,msg,Channel.SEND_OPTIONS_DEFAULT);
+                    getChannel().send(backup,msg,getChannelSendOptions());
                 }
 
                 entry.setBackupNodes(backup);
@@ -182,11 +183,12 @@
                 entry.setProxy(false);
 
                 
-            } catch (ChannelException x) {
+            } catch (Exception x) {
                 log.error("Unable to replicate out data for a LazyReplicatedMap.get operation", x);
                 return null;
             }
         }
+        System.out.println("Requesting id:"+key+" result:"+entry.getValue());
         return entry.getValue();
     }
 
@@ -249,7 +251,7 @@
         
         try {
             MapMessage msg = new MapMessage(getMapContextName(),MapMessage.MSG_REMOVE,false,(Serializable)key,null,null,null);
-            getChannel().send(getMapMembers(), msg,Channel.SEND_OPTIONS_DEFAULT);
+            getChannel().send(getMapMembers(), msg,getChannelSendOptions());
         } catch ( ChannelException x ) {
             log.error("Unable to replicate out data for a LazyReplicatedMap.remove operation",x);
         }

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/BackupManager.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/BackupManager.java?rev=388027&r1=388026&r2=388027&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/BackupManager.java (original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/BackupManager.java Wed Mar 22 20:20:42 2006
@@ -60,7 +60,7 @@
     /**
      * 
      */
-    private int mapSendOptions = Channel.SEND_OPTIONS_ASYNCHRONOUS|Channel.SEND_OPTIONS_SYNCHRONIZED_ACK|Channel.SEND_OPTIONS_USE_ACK;
+    private int mapSendOptions = Channel.SEND_OPTIONS_SYNCHRONIZED_ACK|Channel.SEND_OPTIONS_USE_ACK;
 
     /**
      * Constructor, just calls super()



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org