@Deprecated
public class NakReceiverWindow
extends java.lang.Object
remove()
removes the first message with a sequence
number that is 1 higher than next_to_remove
(this variable is
then incremented), or it returns null if no message is present, or if no
message's sequence number is 1 higher.
When there is a gap upon adding a message, its seqno will be added to the Retransmitter, which (using a timer) requests retransmissions of missing messages and keeps on trying until the message has been received, or the member who sent the message is suspected. There are 2 variables which keep track of messages:
Modifier and Type | Class and Description |
---|---|
static interface |
NakReceiverWindow.Listener
Deprecated.
|
Constructor and Description |
---|
NakReceiverWindow(Address sender,
Retransmitter.RetransmitCommand cmd,
long highest_delivered_seqno,
TimeScheduler sched)
Deprecated.
Creates a new instance with the given retransmit command
|
NakReceiverWindow(Address sender,
Retransmitter.RetransmitCommand cmd,
long highest_delivered_seqno,
TimeScheduler sched,
boolean use_range_based_retransmitter)
Deprecated.
|
NakReceiverWindow(Address sender,
Retransmitter.RetransmitCommand cmd,
long highest_delivered_seqno,
TimeScheduler sched,
boolean use_range_based_retransmitter,
int num_rows,
int msgs_per_row,
double resize_factor,
long max_compaction_time,
boolean automatic_purging)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(long seqno,
Message msg)
Deprecated.
Adds a message according to its seqno (sequence number).
|
void |
compact()
Deprecated.
|
void |
destroy()
Deprecated.
Destroys the NakReceiverWindow.
|
Message |
get(long seqno)
Deprecated.
Returns the message from xmit_table
|
java.util.List<Message> |
get(long from,
long to)
Deprecated.
Returns a list of messages in the range [from ..
|
long[] |
getDigest()
Deprecated.
Returns the lowest, highest delivered and highest received seqnos
|
long |
getHighestDelivered()
Deprecated.
Returns the highest sequence number of a message consumed by the application (by
remove() ). |
long |
getHighestReceived()
Deprecated.
Returns the highest sequence number received so far (which may be
higher than the highest seqno delivered so far; e.g., for
1,2,3,5,6 it would be 6.
|
int |
getMissingMessages()
Deprecated.
|
int |
getPendingXmits()
Deprecated.
|
java.util.concurrent.atomic.AtomicBoolean |
getProcessing()
Deprecated.
|
int |
getRetransmitTableCapacity()
Deprecated.
|
double |
getRetransmitTableFillFactor()
Deprecated.
|
long |
getRetransmitTableOffset()
Deprecated.
|
int |
getRetransmitTableSize()
Deprecated.
|
java.lang.String |
printLossRate()
Deprecated.
|
protected java.lang.String |
printMessages()
Deprecated.
Prints xmit_table.
|
java.lang.String |
printRetransmitStats()
Deprecated.
|
Message |
remove()
Deprecated.
|
Message |
remove(boolean acquire_lock,
boolean remove_msg)
Deprecated.
|
java.util.List<Message> |
removeMany(java.util.concurrent.atomic.AtomicBoolean processing)
Deprecated.
Removes as many messages as possible
|
java.util.List<Message> |
removeMany(java.util.concurrent.atomic.AtomicBoolean processing,
boolean remove_msgs,
int max_results)
Deprecated.
Removes as many messages as possible
|
long |
setHighestDelivered(long new_val)
Deprecated.
|
void |
setListener(NakReceiverWindow.Listener l)
Deprecated.
|
void |
setRetransmitTimeouts(Interval timeouts)
Deprecated.
|
void |
setXmitStaggerTimeout(long timeout)
Deprecated.
|
int |
size()
Deprecated.
|
long |
sizeOfAllMessages(boolean include_headers)
Deprecated.
Returns the number of bytes taken up by all of the messages in the RetransmitTable
|
void |
stable(long seqno)
Deprecated.
Delete all messages <= seqno (they are stable, that is, have been delivered by all members).
|
java.lang.String |
toString()
Deprecated.
|
protected static final Log log
public NakReceiverWindow(Address sender, Retransmitter.RetransmitCommand cmd, long highest_delivered_seqno, TimeScheduler sched)
sender
- The sender associated with this instancecmd
- The command used to retransmit a missing message, will
be invoked by the table. If null, the retransmit thread will not be startedhighest_delivered_seqno
- The next seqno to remove is highest_delivered_seqno +1sched
- the external scheduler to use for retransmission
requests of missing msgs. If it's not provided or is null, an internalpublic NakReceiverWindow(Address sender, Retransmitter.RetransmitCommand cmd, long highest_delivered_seqno, TimeScheduler sched, boolean use_range_based_retransmitter)
public NakReceiverWindow(Address sender, Retransmitter.RetransmitCommand cmd, long highest_delivered_seqno, TimeScheduler sched, boolean use_range_based_retransmitter, int num_rows, int msgs_per_row, double resize_factor, long max_compaction_time, boolean automatic_purging)
public java.util.concurrent.atomic.AtomicBoolean getProcessing()
public void setRetransmitTimeouts(Interval timeouts)
public void setXmitStaggerTimeout(long timeout)
public void setListener(NakReceiverWindow.Listener l)
public int getPendingXmits()
public int getRetransmitTableSize()
public int getRetransmitTableCapacity()
public double getRetransmitTableFillFactor()
public long getRetransmitTableOffset()
public void compact()
public boolean add(long seqno, Message msg)
There are 4 cases where messages are added:
public Message remove()
public Message remove(boolean acquire_lock, boolean remove_msg)
public java.util.List<Message> removeMany(java.util.concurrent.atomic.AtomicBoolean processing)
public java.util.List<Message> removeMany(java.util.concurrent.atomic.AtomicBoolean processing, boolean remove_msgs, int max_results)
remove_msgs
- Removes messages from xmit_tablemax_results
- Max number of messages to remove in one batchpublic void stable(long seqno)
public void destroy()
public long[] getDigest()
public long getHighestDelivered()
remove()
).
Note that this is different from the highest deliverable seqno. E.g. in 23,24,26,27,29, the highest
delivered message may be 22, whereas the highest deliverable message may be 24 !remove()
)public long setHighestDelivered(long new_val)
public long getHighestReceived()
getHighestDelivered()
public Message get(long seqno)
seqno
- public java.util.List<Message> get(long from, long to)
from
- to
- public int size()
public long sizeOfAllMessages(boolean include_headers)
include_headers
- public int getMissingMessages()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String printMessages()
public java.lang.String printLossRate()
public java.lang.String printRetransmitStats()
Copyright © 1998-2020 Red Hat. All Rights Reserved.