|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgroups.stack.Protocol
org.jgroups.protocols.pbcast.NAKACK
public class NAKACK
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.
Retransmit requests are usually sent to the original sender of a message, but this can be changed by
xmit_from_random_member (send to random member) or use_mcast_xmit_req (send to everyone). Responses can also be sent
to everyone instead of the requester by setting use_mcast_xmit to true.
| Field Summary | |
|---|---|
protected BoundedList<java.lang.String> |
merge_history
|
protected boolean |
print_stability_history_on_failed_xmit
When not finding a message on an XMIT request, include the last N stability messages in the error message |
protected BoundedList<Digest> |
stability_msgs
BoundedList |
| Fields inherited from class org.jgroups.stack.Protocol |
|---|
down_prot, log, props, stack, stats, up_prot |
| Constructor Summary | |
|---|---|
NAKACK()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
down(Event evt)
Callback. |
java.util.Map<java.lang.String,java.lang.Object> |
dumpStats()
|
double |
getAverageLossRate()
|
double |
getAverageSmoothedLossRate()
|
Digest |
getDigest()
Returns a message digest: for each member P the lowest, highest delivered and highest received seqno is added |
int |
getGcLag()
|
int |
getMaxXmitBufSize()
|
long |
getMaxXmitSize()
Deprecated. removed in 2.6 |
long |
getMissingMessagesReceived()
|
java.lang.String |
getName()
|
int |
getPendingRetransmissionRequests()
|
int |
getReceivedTableSize()
|
double |
getSmoothedAverageRetransmissionTime(Address sender)
Returns the smoothed average retransmission time for a given sender |
double |
getTotalAverageRetransmissionTime()
|
double |
getTotalAverageSmoothedRetransmissionTime()
|
long |
getXmitRequestsReceived()
|
long |
getXmitRequestsSent()
|
long |
getXmitResponsesReceived()
|
long |
getXmitResponsesSent()
|
int |
getXmitTableSize()
|
void |
init()
Called after instance has been created (null constructor) and before protocol is started. |
boolean |
isDiscardDeliveredMsgs()
|
boolean |
isLogDiscardMsgs()
|
boolean |
isUseMcastXmit()
|
boolean |
isXmitFromRandomMember()
|
void |
messageGapDetected(long from,
long to,
Address src)
Called when a message gap is detected |
void |
missingMessageReceived(long seqno,
Address original_sender)
|
java.lang.String |
printLossRates()
|
java.lang.String |
printMergeHistory()
|
java.lang.String |
printMessages()
|
java.lang.String |
printRetransmissionAvgs()
|
java.lang.String |
printRetransmissionTimes()
|
java.lang.String |
printSmoothedRetransmissionAvgs()
|
java.lang.String |
printStabilityHistory()
|
java.lang.String |
printStabilityMessages()
|
java.lang.String |
printStats()
|
java.util.Vector<java.lang.Integer> |
providedUpServices()
List of events that are provided to layers above (they will be handled when sent down from above). |
void |
resetStats()
|
void |
retransmit(long first_seqno,
long last_seqno,
Address sender)
Implementation of Retransmitter.RetransmitCommand. |
protected void |
retransmit(long first_seqno,
long last_seqno,
Address sender,
boolean multicast_xmit_request)
|
void |
setDiscardDeliveredMsgs(boolean discard_delivered_msgs)
|
void |
setGcLag(int gc_lag)
|
void |
setLogDiscardMsgs(boolean log_discard_msgs)
|
void |
setMaxXmitBufSize(int max_xmit_buf_size)
|
void |
setMaxXmitSize(long max_xmit_size)
Deprecated. removed in 2.6 |
boolean |
setProperties(java.util.Properties props)
Configures the protocol initially. |
void |
setUseMcastXmit(boolean use_mcast_xmit)
|
void |
setXmitFromRandomMember(boolean xmit_from_random_member)
|
void |
start()
This method is called on a Channel.connect(String). |
void |
stop()
This method is called on a Channel.disconnect(). |
java.lang.Object |
up(Event evt)
Callback. |
| Methods inherited from class org.jgroups.stack.Protocol |
|---|
destroy, downThreadEnabled, enableStats, getDownProtocol, getProperties, getProtocolStack, getThreadFactory, getTransport, getUpProtocol, providedDownServices, requiredDownServices, requiredUpServices, setDownProtocol, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, upThreadEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final BoundedList<Digest> stability_msgs
protected final BoundedList<java.lang.String> merge_history
protected boolean print_stability_history_on_failed_xmit
| Constructor Detail |
|---|
public NAKACK()
| Method Detail |
|---|
public java.lang.String getName()
getName in class Protocolpublic long getXmitRequestsReceived()
public long getXmitRequestsSent()
public long getXmitResponsesReceived()
public long getXmitResponsesSent()
public long getMissingMessagesReceived()
public int getPendingRetransmissionRequests()
public int getXmitTableSize()
public int getReceivedTableSize()
public void resetStats()
resetStats in class Protocol
public void init()
throws java.lang.Exception
Protocol
init in class Protocoljava.lang.Exception - Thrown if protocol cannot be initialized successfully. This will cause the
ProtocolStack to fail, so the channel constructor will throw an exceptionpublic int getGcLag()
public void setGcLag(int gc_lag)
public boolean isUseMcastXmit()
public void setUseMcastXmit(boolean use_mcast_xmit)
public boolean isXmitFromRandomMember()
public void setXmitFromRandomMember(boolean xmit_from_random_member)
public boolean isDiscardDeliveredMsgs()
public void setDiscardDeliveredMsgs(boolean discard_delivered_msgs)
public int getMaxXmitBufSize()
public void setMaxXmitBufSize(int max_xmit_buf_size)
public long getMaxXmitSize()
public void setMaxXmitSize(long max_xmit_size)
max_xmit_size - public boolean isLogDiscardMsgs()
public void setLogDiscardMsgs(boolean log_discard_msgs)
public boolean setProperties(java.util.Properties props)
Protocol"loopback=false;unicast_inport=4444"
setProperties in class Protocolpublic java.util.Map<java.lang.String,java.lang.Object> dumpStats()
dumpStats in class Protocolpublic java.lang.String printStats()
printStats in class Protocolpublic java.lang.String printStabilityMessages()
public java.lang.String printStabilityHistory()
public java.lang.String printMergeHistory()
public java.lang.String printLossRates()
public double getAverageLossRate()
public double getAverageSmoothedLossRate()
public java.util.Vector<java.lang.Integer> providedUpServices()
Protocol
providedUpServices in class Protocol
public void start()
throws java.lang.Exception
ProtocolChannel.connect(String). Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.
start in class Protocoljava.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String) will throw an exceptionpublic void stop()
ProtocolChannel.disconnect(). Stops work (e.g. by closing multicast socket).
Will be called from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushed
stop in class Protocolpublic java.lang.Object down(Event evt)
Do not use down_prot.down() in this
method as the event is passed down by default by the superclass after this method returns !
down in class Protocolpublic java.lang.Object up(Event evt)
Do not use PassUp in this
method as the event is passed up by default by the superclass after this method returns !
up in class Protocolpublic Digest getDigest()
public void retransmit(long first_seqno,
long last_seqno,
Address sender)
retransmit in interface Retransmitter.RetransmitCommandfirst_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).
protected void retransmit(long first_seqno,
long last_seqno,
Address sender,
boolean multicast_xmit_request)
public void missingMessageReceived(long seqno,
Address original_sender)
missingMessageReceived in interface NakReceiverWindow.Listener
public void messageGapDetected(long from,
long to,
Address src)
messageGapDetected in interface NakReceiverWindow.Listenerpublic java.lang.String printMessages()
public java.lang.String printRetransmissionAvgs()
public java.lang.String printSmoothedRetransmissionAvgs()
public java.lang.String printRetransmissionTimes()
public double getTotalAverageRetransmissionTime()
public double getTotalAverageSmoothedRetransmissionTime()
public double getSmoothedAverageRetransmissionTime(Address sender)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||