Package org.jgroups.protocols
Class DAISYCHAIN
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.DAISYCHAIN
- All Implemented Interfaces:
Lifecycle
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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanprotected intprotected intprotected Addressprotected TPprotected ViewFields 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 -
Method Summary
Modifier and TypeMethodDescriptionAn event is to be sent down the stack.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.voidA 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
-
Field Details
-
loopback
boolean loopback -
next
-
view
-
msgs_forwarded
protected int msgs_forwarded -
msgs_sent
protected int msgs_sent -
transport
-
-
Constructor Details
-
DAISYCHAIN
public DAISYCHAIN()
-
-
Method Details
-
resetStats
public void resetStats()- Overrides:
resetStatsin classProtocol
-
init
Description 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
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
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
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
-