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 classDAISYCHAIN.DaisyHeader
-
Field Summary
Fields Modifier and Type Field Description protected intmsgs_forwardedprotected intmsgs_sentprotected Addressnextprotected TPtransportprotected Viewview-
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.Objectdown(Event evt)An event is to be sent down the stack.java.lang.Objectdown(Message msg)A message is sent down the stack.protected voidhandleView(View view)voidinit()Called after a protocol has been created and before the protocol is started.voidresetStats()java.lang.Objectup(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:
resetStatsin classProtocol
-
init
public void init() throws java.lang.ExceptionDescription copied from class:ProtocolCalled 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:ProtocolAn 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:ProtocolA 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:ProtocolA 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)
-
-