Class DAISYCHAIN

  • All Implemented Interfaces:
    Lifecycle

    public class DAISYCHAIN
    extends Protocol
    Implementation of daisy chaining. Multicast messages are sent to our neighbor, which sends them to its neighbor etc. A TTL restricts the number of times a message is forwarded. The advantage of daisy chaining is that - for point-to-point transports such as TCP - we can avoid the N-1 issue: when A sends a multicast message to 10 members, it needs to send it 9 times. With daisy chaining, it sends it 1 time, and in the next round, can already send another message. This leads to much better throughput, see the ref in the JIRA.

    Should be inserted just above MERGE3, in TCP based configurations. JIRA: https://issues.redhat.com/browse/JGRP-1021

    Since:
    2.11
    Author:
    Bela Ban
    • Field Detail

      • next

        protected volatile Address next
      • view

        protected volatile View view
      • msgs_forwarded

        protected int msgs_forwarded
      • msgs_sent

        protected int msgs_sent
      • transport

        protected TP transport
    • Constructor Detail

      • DAISYCHAIN

        public DAISYCHAIN()
    • Method Detail

      • init

        public void init()
                  throws java.lang.Exception
        Description copied from class: Protocol
        Called after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent.
        Specified by:
        init in interface Lifecycle
        Overrides:
        init in class Protocol
        Throws:
        java.lang.Exception - Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
      • down

        public java.lang.Object down​(Event evt)
        Description copied from class: Protocol
        An event is to be sent down the stack. A protocol may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the protocol may need to add a header to it (or do nothing at all) before sending it down the stack using down_prot.down().
        Overrides:
        down in class Protocol
      • down

        public java.lang.Object down​(Message msg)
        Description copied from class: Protocol
        A message is sent down the stack. Protocols may examine the message and do something (e.g. add a header) with it, before passing it down.
        Overrides:
        down in class Protocol
      • up

        public java.lang.Object up​(Message msg)
        Description copied from class: Protocol
        A single message was received. Protocols may examine the message and do something (e.g. add a header) with it before passing it up.
        Overrides:
        up in class Protocol
      • handleView

        protected void handleView​(View view)