CVS update: JGroups/src/org/jgroups/protocols UNICAST.java SMACK.java UNICAST2.java SEQUENCER.java

"Bela Ban" <[email protected]> Mon, 8 Nov 2010 08:56:59 +0000
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: belaban 
  Date: 10/11/08 08:56:59

  Modified:    src/org/jgroups/protocols UNICAST.java SMACK.java
                        UNICAST2.java SEQUENCER.java
  Log:
  protocols check if NO_RELIABILITY or NO_TOTAL_ORDER flags are set to bypass (https://jira.jboss.org/browse/JGRP-1250)
  
  Revision  Changes    Path
  1.168     +3 -4      JGroups/src/org/jgroups/protocols/UNICAST.java
  
  Index: UNICAST.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/UNICAST.java,v
  retrieving revision 1.167
  retrieving revision 1.168
  diff -u -r1.167 -r1.168
  --- UNICAST.java	17 Sep 2010 12:05:09 -0000	1.167
  +++ UNICAST.java	8 Nov 2010 08:56:59 -0000	1.168
  @@ -39,7 +39,7 @@
    * whenever a message is received: the new message is added and then we try to remove as many messages as
    * possible (until we stop at a gap, or there are no more messages).
    * @author Bela Ban
  - * @version $Id: UNICAST.java,v 1.167 2010/09/17 12:05:09 belaban Exp $
  + * @version $Id: UNICAST.java,v 1.168 2010/11/08 08:56:59 belaban Exp $
    */
   @MBean(description="Reliable unicast layer")
   @DeprecatedProperty(names={"immediate_ack", "use_gms", "enabled_mbrs_timeout", "eager_lock_release"})
  @@ -281,7 +281,7 @@
                   msg=(Message)evt.getArg();
                   dst=msg.getDest();
   
  -                if(dst == null || dst.isMulticastAddress())  // only handle unicast messages
  +                if(dst == null || dst.isMulticastAddress() || msg.isFlagSet(Message.NO_RELIABILITY))  // only handle unicast messages
                       break;  // pass up
   
                   // changed from removeHeader(): we cannot remove the header because if we do loopback=true at the
  @@ -320,9 +320,8 @@
                   Address dst=msg.getDest();
   
                   /* only handle unicast messages */
  -                if (dst == null || dst.isMulticastAddress()) {
  +                if (dst == null || dst.isMulticastAddress() || msg.isFlagSet(Message.NO_RELIABILITY))
                       break;
  -                }
   
                   if(!started) {
                       if(log.isTraceEnabled())
  
  
  
  1.39      +3 -3      JGroups/src/org/jgroups/protocols/SMACK.java
  
  Index: SMACK.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/SMACK.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- SMACK.java	17 Sep 2010 12:03:35 -0000	1.38
  +++ SMACK.java	8 Nov 2010 08:56:59 -0000	1.39
  @@ -50,7 +50,7 @@
    * </ul>
    * Advantage of this protocol: no group membership necessary, fast.
    * @author Bela Ban Aug 2002
  - * @version $Id: SMACK.java,v 1.38 2010/09/17 12:03:35 belaban Exp $
  + * @version $Id: SMACK.java,v 1.39 2010/11/08 08:56:59 belaban Exp $
    * <BR> Fix membershop bug: start a, b, kill b, restart b: b will be suspected by a.
    */
   @Experimental @Unsupported
  @@ -102,7 +102,7 @@
   
               case Event.MSG:
                   Message msg=(Message)evt.getArg(), tmp_msg;
  -                if(msg == null) break;
  +                if(msg == null || msg.isFlagSet(Message.NO_RELIABILITY)) break;
                   sender=msg.getSrc();
                   SmackHeader hdr=(SmackHeader)msg.getHeader(this.id);
                   if(hdr == null) // is probably a unicast message
  @@ -202,7 +202,7 @@
               // add a header with the current sequence number and increment seqno
               case Event.MSG:
                   Message msg=(Message)evt.getArg();
  -                if(msg == null) break;
  +                if(msg == null || msg.isFlagSet(Message.NO_RELIABILITY)) break;
                   if(msg.getDest() == null || msg.getDest().isMulticastAddress()) {
                       lock.lock();
                       try {
  
  
  
  1.12      +3 -4      JGroups/src/org/jgroups/protocols/UNICAST2.java
  
  Index: UNICAST2.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/UNICAST2.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- UNICAST2.java	17 Sep 2010 12:05:09 -0000	1.11
  +++ UNICAST2.java	8 Nov 2010 08:56:59 -0000	1.12
  @@ -34,7 +34,7 @@
    * The advantage of this protocol over {@link org.jgroups.protocols.UNICAST} is that it doesn't send acks for every
    * message. Instead, it sends 'acks' after receiving max_bytes and/ or periodically (stable_interval).
    * @author Bela Ban
  - * @version $Id: UNICAST2.java,v 1.11 2010/09/17 12:05:09 belaban Exp $
  + * @version $Id: UNICAST2.java,v 1.12 2010/11/08 08:56:59 belaban Exp $
    */
   @Experimental @Unsupported
   @MBean(description="Reliable unicast layer")
  @@ -251,7 +251,7 @@
                   msg=(Message)evt.getArg();
                   dst=msg.getDest();
   
  -                if(dst == null || dst.isMulticastAddress())  // only handle unicast messages
  +                if(dst == null || dst.isMulticastAddress() || msg.isFlagSet(Message.NO_RELIABILITY))  // only handle unicast messages
                       break;  // pass up
   
                   // changed from removeHeader(): we cannot remove the header because if we do loopback=true at the
  @@ -293,9 +293,8 @@
                   Address dst=msg.getDest();
   
                   /* only handle unicast messages */
  -                if (dst == null || dst.isMulticastAddress()) {
  +                if (dst == null || dst.isMulticastAddress() || msg.isFlagSet(Message.NO_RELIABILITY))
                       break;
  -                }
   
                   if(!started) {
                       if(log.isTraceEnabled())
  
  
  
  1.37      +5 -1      JGroups/src/org/jgroups/protocols/SEQUENCER.java
  
  Index: SEQUENCER.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/SEQUENCER.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- SEQUENCER.java	15 Jun 2010 06:44:35 -0000	1.36
  +++ SEQUENCER.java	8 Nov 2010 08:56:59 -0000	1.37
  @@ -18,7 +18,7 @@
   /**
    * Implementation of total order protocol using a sequencer. Consult doc/design/SEQUENCER.txt for details
    * @author Bela Ban
  - * @version $Id: SEQUENCER.java,v 1.36 2010/06/15 06:44:35 belaban Exp $
  + * @version $Id: SEQUENCER.java,v 1.37 2010/11/08 08:56:59 belaban Exp $
    */
   @Experimental
   @MBean(description="Implementation of total order protocol using a sequencer")
  @@ -80,6 +80,8 @@
           switch(evt.getType()) {
               case Event.MSG:
                   Message msg=(Message)evt.getArg();
  +                if(msg.isFlagSet(Message.NO_TOTAL_ORDER))
  +                    break;
                   Address dest=msg.getDest();
                   if(dest == null || dest.isMulticastAddress()) { // only handle multicasts
                       long next_seqno=seqno.getAndIncrement();
  @@ -118,6 +120,8 @@
           switch(evt.getType()) {
               case Event.MSG:
                   msg=(Message)evt.getArg();
  +                if(msg.isFlagSet(Message.NO_TOTAL_ORDER))
  +                    break;
                   hdr=(SequencerHeader)msg.getHeader(this.id);
                   if(hdr == null)
                       break; // pass up
  
  
  

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev