Package org.jgroups.protocols
Class FRAG.FragmentationTable
java.lang.Object
org.jgroups.protocols.FRAG.FragmentationTable
- Enclosing class:
FRAG
Keeps track of the fragments that are received.
Reassembles fragements into entire messages when all fragments have been received.
The fragmentation holds a an array of byte arrays for a unique sender
The first dimension of the array is the order of the fragmentation, in case the arrive out of order
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classinner class represents an entry for a message each entry holds an array of byte arrays sorted once all the byte buffer entries have been filled the fragmentation is considered complete. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
sender
-
table
-
-
Constructor Details
-
FragmentationTable
FragmentationTable(Address sender)
-
-
Method Details
-
add
public byte[] add(long id, int frag_id, int tot_frags, byte[] fragment) Creates a new entry if not yet present. Adds the fragment. If all fragements for a given message have been received, an entire message is reassembled and returned. Otherwise null is returned.- Parameters:
id- - the message ID, unique for a senderfrag_id- the index of this fragmentation (0..tot_frags-1)tot_frags- the total number of fragmentations expectedfragment- - the byte buffer for this fragment
-
toString
-