Package org.jgroups.protocols
Class FRAG.FragmentationTable
- java.lang.Object
-
- org.jgroups.protocols.FRAG.FragmentationTable
-
- Enclosing class:
- FRAG
static class FRAG.FragmentationTable extends java.lang.ObjectKeeps 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 Classes Modifier and Type Class Description (package private) static classFRAG.FragmentationTable.FragEntryinner 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 Modifier and Type Field Description private Addresssenderprivate java.util.Map<java.lang.Long,FRAG.FragmentationTable.FragEntry>table
-
Constructor Summary
Constructors Constructor Description FragmentationTable(Address sender)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]add(long id, int frag_id, int tot_frags, byte[] fragment)Creates a new entry if not yet present.java.lang.StringtoString()
-
-
-
Field Detail
-
sender
private final Address sender
-
table
private final java.util.Map<java.lang.Long,FRAG.FragmentationTable.FragEntry> table
-
-
Constructor Detail
-
FragmentationTable
FragmentationTable(Address sender)
-
-
Method Detail
-
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-