axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r546122 - in /webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering: handlers/ReplicationHandler.java tribes/AckManager.java tribes/ChannelSender.java
Date Mon, 11 Jun 2007 12:24:10 GMT
Author: azeez
Date: Mon Jun 11 05:24:08 2007
New Revision: 546122

URL: http://svn.apache.org/viewvc?view=rev&rev=546122
Log:
Few more optimizations


Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/handlers/ReplicationHandler.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/handlers/ReplicationHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/handlers/ReplicationHandler.java?view=diff&rev=546122&r1=546121&r2=546122
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/handlers/ReplicationHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/handlers/ReplicationHandler.java
Mon Jun 11 05:24:08 2007
@@ -51,11 +51,11 @@
     public void flowComplete(MessageContext msgContext) {
 
         // If there are no members, we need not do any replication
-        ClusterManager clusterManager =
+        /*ClusterManager clusterManager =
                 msgContext.getConfigurationContext().getAxisConfiguration().getClusterManager();
         if(clusterManager != null && clusterManager.getMemberCount() == 0){
              return;
-        }
+        }*/
 
         int flow = msgContext.getFLOW();
         String mep = msgContext.getAxisOperation().getMessageExchangePattern();
@@ -131,11 +131,11 @@
                 // Wait till all members have ACKed receipt & successful processing of
                 // the message with UUID 'msgUUID'
                 do {
+
+                    // Wait sometime before checking whether message is ACKed
                     try {
                         Thread.sleep(50);
-                    } catch (InterruptedException e) {
-                        log.error(e);
-                        break;
+                    } catch (InterruptedException ignored) {
                     }
                     if (System.currentTimeMillis() - start > 20000) {
                         throw new ClusteringFault("ACKs not received from all members within
20 sec. " +

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java?view=diff&rev=546122&r1=546121&r2=546122
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
Mon Jun 11 05:24:08 2007
@@ -62,14 +62,13 @@
         } else {
             for (int i = 0; i < members.length; i++) {
                 Member member = members[i];
-                if (!memberList.contains(member.getName())) {
+                if (member.isReady() && !memberList.contains(member.getName())) {
                     log.debug("[NO ACK] from member " + member.getName());
                     log.debug("ACKed member list=" + memberList);
+
                     // At this point, resend the original message back to the node which
has not
                     // sent an ACK
-                    if (member.isReady()) {
-                        sender.sendToMember(ack.getCommand(), member);
-                    }
+                    sender.sendToMember(ack.getCommand(), member);
 
                     //TODO: Enhancement, Check whether this is a new member. If then send
the msg
                     isAcknowledged = false;

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java?view=diff&rev=546122&r1=546121&r2=546122
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java
Mon Jun 11 05:24:08 2007
@@ -19,9 +19,7 @@
 import org.apache.axis2.clustering.ClusteringCommand;
 import org.apache.axis2.clustering.ClusteringFault;
 import org.apache.axis2.clustering.MessageSender;
-import org.apache.catalina.tribes.Channel;
-import org.apache.catalina.tribes.ChannelException;
-import org.apache.catalina.tribes.Member;
+import org.apache.catalina.tribes.*;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -36,10 +34,11 @@
         }
 
         // Keep retrying, since at the point of trying to send the msg, a member may leave
the group
+        // causing a view change. All nodes in a view should get the msg
         while (true) {
             if (channel.getMembers().length > 0) {
                 try {
-                    channel.send(channel.getMembers(), msg, Channel.DEFAULT);
+                    channel.send(channel.getMembers(), msg, 0); // TODO: We must try to minimize
the delay here
                     log.debug("Sent " + msg + " to group");
                     break;
                 } catch (ChannelException e) {
@@ -60,7 +59,7 @@
         try {
             channel.send(new Member[]{channel.getLocalMember(true)},
                          msg,
-                         Channel.DEFAULT);
+                         0);
             log.debug("Sent " + msg + " to self");
         } catch (ChannelException e) {
             throw new ClusteringFault(e);
@@ -91,8 +90,13 @@
 
     public void sendToMember(ClusteringCommand cmd, Member member) throws ClusteringFault
{
         try {
-            channel.send(new Member[]{member}, cmd, Channel.DEFAULT);
-            log.debug("Sent " + cmd + " to " + member.getName());
+            System.err.println("######## MEM Ready=" + member.isReady());
+            System.err.println("######## MEM Failing=" + member.isFailing());
+            System.err.println("######## MEM Suspect=" + member.isSuspect());
+            if (member.isReady()) {
+                channel.send(new Member[]{member}, cmd, 0);
+                log.debug("Sent " + cmd + " to " + member.getName());
+            }
         } catch (ChannelException e) {
             String message = "Could not send message to " + member.getName() +
                              ". Reason " + e.getMessage();



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message