Package org.apache.zookeeper.server.util
Class MessageTracker
- java.lang.Object
- 
- org.apache.zookeeper.server.util.MessageTracker
 
- 
 public class MessageTracker extends Object This class provides a way of buffering sentBuffer and receivedBuffer messages in order. It uses EvictingQueue of size BUFFERED_MESSAGE_SIZE to store the messages. When the queue is full it overrides the oldest in a circular manner. This class does doe not provide thread safety.
- 
- 
Field SummaryFields Modifier and Type Field Description static intBUFFERED_MESSAGE_SIZEstatic StringMESSAGE_TRACKER_BUFFER_SIZEstatic StringMESSAGE_TRACKER_ENABLED
 - 
Constructor SummaryConstructors Constructor Description MessageTracker(int buffer_size)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddumpToLog(String serverAddress)org.apache.zookeeper.server.util.MessageTracker.BufferedMessagepeekReceived()longpeekReceivedTimestamp()org.apache.zookeeper.server.util.MessageTracker.BufferedMessagepeekSent()longpeekSentTimestamp()voidtrackReceived(int packetType)voidtrackReceived(long timestamp)voidtrackSent(int packetType)voidtrackSent(long timestamp)
 
- 
- 
- 
Field Detail- 
MESSAGE_TRACKER_BUFFER_SIZEpublic static final String MESSAGE_TRACKER_BUFFER_SIZE - See Also:
- Constant Field Values
 
 - 
MESSAGE_TRACKER_ENABLEDpublic static final String MESSAGE_TRACKER_ENABLED - See Also:
- Constant Field Values
 
 - 
BUFFERED_MESSAGE_SIZEpublic static final int BUFFERED_MESSAGE_SIZE 
 
- 
 - 
Method Detail- 
trackSentpublic void trackSent(long timestamp) 
 - 
trackSentpublic void trackSent(int packetType) 
 - 
trackReceivedpublic void trackReceived(long timestamp) 
 - 
trackReceivedpublic void trackReceived(int packetType) 
 - 
peekSentpublic final org.apache.zookeeper.server.util.MessageTracker.BufferedMessage peekSent() 
 - 
peekReceivedpublic final org.apache.zookeeper.server.util.MessageTracker.BufferedMessage peekReceived() 
 - 
peekSentTimestamppublic final long peekSentTimestamp() 
 - 
peekReceivedTimestamppublic final long peekReceivedTimestamp() 
 - 
dumpToLogpublic void dumpToLog(String serverAddress) 
 
- 
 
-