Class FRAG.FragmentationTable

java.lang.Object
org.jgroups.protocols.FRAG.FragmentationTable
Enclosing class:
FRAG

static class FRAG.FragmentationTable extends Object
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
  • Field Details

  • 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 sender
      frag_id - the index of this fragmentation (0..tot_frags-1)
      tot_frags - the total number of fragmentations expected
      fragment - - the byte buffer for this fragment
    • toString

      public String toString()
      Overrides:
      toString in class Object