|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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<Message> |
become_server_queue
|
protected int |
become_server_queue_size
|
protected BoundedList<java.lang.String> |
digest_history
Keeps a bounded list of the last N digest sets |
protected int |
num_messages_received
|
protected int |
num_messages_sent
|
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 |
protected SuppressLog<Address> |
suppress_log_non_member
Log to suppress identical warnings for messages from non-members |
protected long |
suppress_time_non_member_warnings
|
protected long |
xmit_stagger_timeout
|
Fields inherited from class org.jgroups.stack.Protocol |
---|
down_prot, ergonomics, id, log, name, stack, stats, up_prot |
Constructor Summary | |
---|---|
NAKACK()
|
Method Summary | |
---|---|
protected void |
checkForRebroadcasts()
|
void |
clearNonMemberCache()
|
void |
compact()
|
java.lang.Object |
down(Event evt)
Callback. |
java.util.Map<java.lang.String,java.lang.Object> |
dumpStats()
|
protected void |
flushBecomeServerQueue()
Flushes the queue. |
long |
getCurrentSeqno()
|
Digest |
getDigest()
Returns a message digest: for each member P the highest delivered and received seqno is added |
Digest |
getDigest(Address mbr)
|
boolean |
getLogDiscardMessages()
|
int |
getNonMemberMessages()
|
int |
getPendingXmitRequests()
|
long |
getSizeOfAllMessages()
|
long |
getSizeOfAllMessagesInclHeaders()
|
NakReceiverWindow |
getWindow(Address mbr)
Please don't use this method; it is only provided for unit testing ! |
long |
getXmitRequestsReceived()
|
long |
getXmitRequestsSent()
|
long |
getXmitResponsesReceived()
|
long |
getXmitResponsesSent()
|
int |
getXmitTableMissingMessages()
|
int |
getXmitTableSize()
|
java.util.Map<java.lang.String,java.lang.String> |
handleProbe(java.lang.String... keys)
Handles a probe. |
void |
init()
Called after instance has been created (null constructor) and before protocol is started. |
boolean |
isDiscardDeliveredMsgs()
|
boolean |
isUseMcastXmit()
|
boolean |
isXmitFromRandomMember()
|
java.lang.String |
printDigestHistory()
|
java.lang.String |
printLossRates()
|
java.lang.String |
printMessages()
|
java.lang.String |
printRetransmitStats()
|
java.lang.String |
printRetransmitTableSizes()
|
java.lang.String |
printStabilityHistory()
|
java.lang.String |
printStabilityMessages()
|
java.lang.String |
printStats()
|
java.util.List<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)
|
protected void |
send(Event evt,
Message msg)
Adds the message to the sent_msgs table and then passes it down the stack. |
void |
setDiscardDeliveredMsgs(boolean discard_delivered_msgs)
|
void |
setLogDiscardMessages(boolean flag)
|
void |
setLogDiscardMsgs(boolean flag)
|
void |
setTimer(TimeScheduler timer)
Only used for unit tests, don't use ! |
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.String[] |
supportedKeys()
Returns a list of supported keys |
java.lang.Object |
up(Event evt)
Callback. |
Methods inherited from class org.jgroups.stack.Protocol |
---|
destroy, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long xmit_stagger_timeout
protected boolean print_stability_history_on_failed_xmit
protected int become_server_queue_size
protected long suppress_time_non_member_warnings
protected int num_messages_sent
protected int num_messages_received
protected final BoundedList<Digest> stability_msgs
protected final BoundedList<java.lang.String> digest_history
protected BoundedList<Message> become_server_queue
protected SuppressLog<Address> suppress_log_non_member
Constructor Detail |
---|
public NAKACK()
Method Detail |
---|
public int getNonMemberMessages()
public void clearNonMemberCache()
public long getXmitRequestsReceived()
public long getXmitRequestsSent()
public long getXmitResponsesReceived()
public long getXmitResponsesSent()
public int getPendingXmitRequests()
public int getXmitTableSize()
public int getXmitTableMissingMessages()
public long getSizeOfAllMessages()
public long getSizeOfAllMessagesInclHeaders()
public long getCurrentSeqno()
public java.lang.String printRetransmitStats()
public NakReceiverWindow getWindow(Address mbr)
mbr
-
public void setTimer(TimeScheduler timer)
timer
- public void resetStats()
resetStats
in class Protocol
public void init() throws java.lang.Exception
Protocol
init
in class Protocol
java.lang.Exception
- Thrown if protocol cannot be initialized successfully. This will cause the
ProtocolStack to fail, so the channel constructor will throw an exceptionpublic 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 void setLogDiscardMessages(boolean flag)
public void setLogDiscardMsgs(boolean flag)
public boolean getLogDiscardMessages()
public java.util.Map<java.lang.String,java.lang.Object> dumpStats()
dumpStats
in class Protocol
public java.lang.String printStats()
printStats
in class Protocol
public java.lang.String printStabilityMessages()
public java.lang.String printStabilityHistory()
public java.lang.String printDigestHistory()
public java.lang.String printLossRates()
public java.lang.String printRetransmitTableSizes()
public void compact()
public java.util.List<java.lang.Integer> providedUpServices()
Protocol
providedUpServices
in class Protocol
public void start() throws java.lang.Exception
Protocol
Channel.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 Protocol
java.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()
Protocol
Channel.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 Protocol
public 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 Protocol
public 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 Protocol
protected void send(Event evt, Message msg)
protected void flushBecomeServerQueue()
ClientGmsImpl.installView(org.jgroups.View,org.jgroups.util.Digest)
method (called when a view is installed).
protected void checkForRebroadcasts()
public Digest getDigest()
public Digest getDigest(Address mbr)
public void retransmit(long first_seqno, long last_seqno, Address sender)
retransmit
in interface Retransmitter.RetransmitCommand
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).protected void retransmit(long first_seqno, long last_seqno, Address sender, boolean multicast_xmit_request)
public java.lang.String printMessages()
public java.util.Map<java.lang.String,java.lang.String> handleProbe(java.lang.String... keys)
DiagnosticsHandler.ProbeHandler
handleProbe
in interface DiagnosticsHandler.ProbeHandler
public java.lang.String[] supportedKeys()
DiagnosticsHandler.ProbeHandler
supportedKeys
in interface DiagnosticsHandler.ProbeHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |