@Deprecated
public class RetransmitTable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
automatic_purging
Deprecated.
By default, rows are only nulled and highest_seqno_purged is adjusted when
purge(long) is called. |
protected static long |
DEFAULT_MAX_COMPACTION_TIME
Deprecated.
|
protected static double |
DEFAULT_RESIZE_FACTOR
Deprecated.
|
protected long |
highest_seqno
Deprecated.
The highest seqno in the table
|
protected long |
highest_seqno_purged
Deprecated.
The highest seqno purged
|
protected long |
last_compaction_timestamp
Deprecated.
The time when the last compaction took place.
|
protected static Log |
log
Deprecated.
|
protected Message[][] |
matrix
Deprecated.
|
protected long |
max_compaction_time
Deprecated.
Time (in ms) after which a compaction should take place.
|
protected int |
msgs_per_row
Deprecated.
Must be a power of 2 for efficient modular arithmetic
|
protected int |
num_rows
Deprecated.
|
protected long |
offset
Deprecated.
The first seqno, at matrix[0][0]
|
protected double |
resize_factor
Deprecated.
|
protected int |
size
Deprecated.
|
Constructor and Description |
---|
RetransmitTable()
Deprecated.
|
RetransmitTable(int num_rows,
int msgs_per_row,
long offset)
Deprecated.
|
RetransmitTable(int num_rows,
int msgs_per_row,
long offset,
double resize_factor)
Deprecated.
|
RetransmitTable(int num_rows,
int msgs_per_row,
long offset,
double resize_factor,
long max_compaction_time,
boolean automatic_purging)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
int |
capacity()
Deprecated.
Returns the total capacity in the matrix
|
void |
clear()
Deprecated.
Removes all elements.
|
void |
compact()
Deprecated.
Moves the contents of matrix down by the number of purged rows and resizes the matrix accordingly.
|
protected int |
computeIndex(long seqno)
Deprecated.
Computes and returns the index within a row for seqno
|
protected int |
computeRow(long seqno)
Deprecated.
Computes and returns the row index for seqno
|
int |
computeSize()
Deprecated.
Iterate from highest_seqno_purged to highest_seqno and add up non-null values
|
java.lang.String |
dump()
Deprecated.
Dumps the seqnos in the table as a list
|
java.lang.String |
dumpMatrix()
Deprecated.
Dumps the non-null in the table in a pseudo graphic way
|
Message |
get(long seqno)
Deprecated.
|
java.util.List<Message> |
get(long from,
long to)
Deprecated.
|
double |
getFillFactor()
Deprecated.
Returns the ratio between size and capacity, as a percentage
|
long |
getHighest()
Deprecated.
|
long |
getHighestPurged()
Deprecated.
|
int |
getLength()
Deprecated.
|
long |
getMaxCompactionTime()
Deprecated.
|
int |
getNullMessages(long from,
long to)
Deprecated.
Returns the number of null elements in the range [from ..
|
long |
getOffset()
Deprecated.
|
protected Message[] |
getRow(int index)
Deprecated.
Returns a row.
|
boolean |
isAutomaticPurging()
Deprecated.
|
boolean |
isEmpty()
Deprecated.
|
protected void |
move(int num_rows)
Deprecated.
Moves contents of matrix num_rows down.
|
void |
purge(long seqno)
Deprecated.
Removes all messages less than or equal to seqno from the table.
|
boolean |
put(long seqno,
Message msg)
Deprecated.
Adds a new message to the index computed as a function of seqno
|
Message |
putIfAbsent(long seqno,
Message msg)
Deprecated.
Adds a message if the element at the given index is null.
|
Message |
remove(long seqno)
Deprecated.
Removes the message with seqno from the table, nulls the index
|
protected void |
resize(long seqno)
Deprecated.
Moves rows down the matrix, by removing purged rows.
|
void |
setAutomaticPurging(boolean automatic_purging)
Deprecated.
|
void |
setMaxCompactionTime(long max_compaction_time)
Deprecated.
|
int |
size()
Deprecated.
Returns the numbers of messages in the table
|
long |
sizeOfAllMessages(boolean include_headers)
Deprecated.
Computes the size of all messages currently in the table.
|
java.lang.String |
toString()
Deprecated.
|
protected final int num_rows
protected final int msgs_per_row
protected final double resize_factor
protected Message[][] matrix
protected long offset
protected int size
protected long highest_seqno_purged
protected long highest_seqno
protected long max_compaction_time
protected long last_compaction_timestamp
compact()
takes place and sees that the
last compaction is more than max_compaction_time ms ago, a compaction will take placeprotected boolean automatic_purging
purge(long)
is called.
When automatic_purging is enabled (default is off), rows are purged and highest_seqno_purged is adjusted
on remove(long)
protected static final long DEFAULT_MAX_COMPACTION_TIME
protected static final double DEFAULT_RESIZE_FACTOR
protected static final Log log
public RetransmitTable()
public RetransmitTable(int num_rows, int msgs_per_row, long offset)
public RetransmitTable(int num_rows, int msgs_per_row, long offset, double resize_factor)
public RetransmitTable(int num_rows, int msgs_per_row, long offset, double resize_factor, long max_compaction_time, boolean automatic_purging)
public int getLength()
public long getOffset()
public int capacity()
public int size()
public boolean isEmpty()
public long getHighest()
public long getHighestPurged()
public long getMaxCompactionTime()
public void setMaxCompactionTime(long max_compaction_time)
public boolean isAutomaticPurging()
public void setAutomaticPurging(boolean automatic_purging)
public double getFillFactor()
public boolean put(long seqno, Message msg)
seqno
- msg
- public Message putIfAbsent(long seqno, Message msg)
seqno
- msg
- public Message get(long seqno)
public java.util.List<Message> get(long from, long to)
public Message remove(long seqno)
public void clear()
public void purge(long seqno)
seqno
- protected void resize(long seqno)
protected void move(int num_rows)
public void compact()
public int computeSize()
public int getNullMessages(long from, long to)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String dump()
public java.lang.String dumpMatrix()
public long sizeOfAllMessages(boolean include_headers)
include_headers
- If true, Message.size()
is used, which will include the size of all
headers and the dest and src addresses. Else Message.getLength()
is used to compute.
Note that the latter is way more efficient.protected Message[] getRow(int index)
index
- protected int computeRow(long seqno)
protected int computeIndex(long seqno)
Copyright © 1998-2020 Red Hat. All Rights Reserved.