Package org.jgroups.protocols
Class DAISYCHAIN
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DAISYCHAIN.DaisyHeader
-
Field Summary
Fields Modifier and Type Field Description protected int
msgs_forwarded
protected int
msgs_sent
protected Address
next
protected TP
transport
protected View
view
-
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot
-
-
Constructor Summary
Constructors Constructor Description DAISYCHAIN()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
down(Event evt)
An event is to be sent down the stack.java.lang.Object
down(Message msg)
A message is sent down the stack.protected void
handleView(View view)
void
init()
Called after a protocol has been created and before the protocol is started.void
resetStats()
java.lang.Object
up(Message msg)
A single message was received.-
Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, start, statsEnabled, stop, toString, up, up
-
-
-
-
Method Detail
-
resetStats
public void resetStats()
- Overrides:
resetStats
in classProtocol
-
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.
-
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 usingdown_prot.down()
.
-
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.
-
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.
-
handleView
protected void handleView(View view)
-
-