org.javagroups.protocols.pbcast
Class NAKACK
java.lang.Object
|
+--org.javagroups.stack.Protocol
|
+--org.javagroups.protocols.pbcast.NAKACK
- All Implemented Interfaces:
- Retransmitter.RetransmitCommand
- public class NAKACK
- extends Protocol
- implements Retransmitter.RetransmitCommand
Negative AcKnowledgement layer (NAKs). Messages are assigned a monotonically increasing sequence number (seqno).
Receivers deliver messages ordered according to seqno and request retransmission of missing messages. Retransmitted
messages are bundled into bigger ones, e.g. when getting an xmit request for messages 1-10, instead of sending 10
unicast messages, we bundle all 10 messages into 1 and send it. However, since this protocol typically sits below
FRAG, we cannot count on FRAG to fragement/defragment the (possibly) large message into smaller ones. Therefore
we only bundle messages up to max_xmit_size bytes to prevent too large messages. For example, if the bundled message
size was a total of 34000 bytes, and max_xmit_size=16000, we'd send 3 messages: 2 16K and a 2K message. Note that
max_xmit_size should be the same value as FRAG.frag_size (or smaller).
- Author:
- Bela Ban
Fields inherited from class org.javagroups.stack.Protocol |
down_handler, down_prot, down_queue, down_thread, observer, props, stack, up_handler, up_prot, up_queue, up_thread |
Method Summary |
void |
down(Event evt)
Callback. |
java.lang.String |
getName()
|
java.util.Vector |
providedDownServices()
List of events that are provided to layers below (they will be handled when sent down from
below). |
java.util.Vector |
providedUpServices()
List of events that are provided to layers above (they will be handled when sent down from
above). |
void |
retransmit(long first_seqno,
long last_seqno,
Address sender)
Implementation of Retransmitter.RetransmitCommand. |
boolean |
setProperties(java.util.Properties props)
Configures the protocol initially. |
void |
up(Event evt)
Callback. |
Methods inherited from class org.javagroups.stack.Protocol |
getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, init, passDown, passUp, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, stopInternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAKACK
public NAKACK()
getName
public java.lang.String getName()
- Overrides:
getName
in class Protocol
providedUpServices
public java.util.Vector providedUpServices()
- Description copied from class:
Protocol
- List of events that are provided to layers above (they will be handled when sent down from
above).
- Overrides:
providedUpServices
in class Protocol
- Following copied from class:
org.javagroups.stack.Protocol
- Returns:
- Vector (of Integers)
providedDownServices
public java.util.Vector providedDownServices()
- Description copied from class:
Protocol
- List of events that are provided to layers below (they will be handled when sent down from
below).
- Overrides:
providedDownServices
in class Protocol
- Following copied from class:
org.javagroups.stack.Protocol
- Returns:
- Vector (of Integers)
down
public void down(Event evt)
- Callback. Called by superclass when event may be handled.
Do not use PassDown
in this method as the event is passed down
by default by the superclass after this method returns !
- Overrides:
down
in class Protocol
up
public void up(Event evt)
- Callback. Called by superclass when event may be handled.
Do not use PassUp
in this method as the event is passed up
by default by the superclass after this method returns !
- Overrides:
up
in class Protocol
- Returns:
- boolean Defaults to true. If false, event will not be passed up the stack.
setProperties
public boolean setProperties(java.util.Properties props)
- Description copied from class:
Protocol
- Configures the protocol initially. A configuration string consists of name=value
items, separated by a ';' (semicolon), e.g.:
"loopback=false;unicast_inport=4444"
- Overrides:
setProperties
in class Protocol
retransmit
public void retransmit(long first_seqno,
long last_seqno,
Address sender)
- Implementation of Retransmitter.RetransmitCommand. Called by retransmission thread
when gap is detected. Sends XMIT_REQ to originator of msg
- Specified by:
retransmit
in interface Retransmitter.RetransmitCommand
- Following copied from interface:
org.javagroups.stack.Retransmitter.RetransmitCommand
- Parameters:
first_seqno
- The sequence number of the first missing messagelast_seqno
- The sequence number of the last missing messagesender
- The destination of the member to which the retransmit request will be sent
(nak-based scheme), or to which the message will be retransmitted (ack-based scheme).
Copyright © 2001,2002 www.javagroups.com . All Rights Reserved.