Class FRAG.FragmentationTable.FragEntry

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

static class FRAG.FragmentationTable.FragEntry extends Object
inner 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
    (package private) byte[][]
     
    (package private) long
     
    (package private) int
     
    (package private) int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FragEntry(long msg_id, int tot_frags)
    Creates a new entry
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Assembles all the fragmentations into one buffer this method does not check if the fragmentation is complete
    int
     
    boolean
    returns true if this fragmentation is complete ie, all fragmentations have been received for this buffer
    void
    set(int frag_id, byte[] frag)
    adds on fragmentation buffer to the message
    debug only

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • tot_frags

      int tot_frags
    • fragments

      byte[][] fragments
    • number_of_frags_recvd

      int number_of_frags_recvd
    • msg_id

      long msg_id
  • Constructor Details

    • FragEntry

      FragEntry(long msg_id, int tot_frags)
      Creates a new entry
      Parameters:
      tot_frags - the number of fragments to expect for this message
  • Method Details

    • set

      public void set(int frag_id, byte[] frag)
      adds on fragmentation buffer to the message
      Parameters:
      frag_id - the number of the fragment being added 0..(tot_num_of_frags - 1)
      frag - the byte buffer containing the data for this fragmentation, should not be null
    • isComplete

      public boolean isComplete()
      returns true if this fragmentation is complete ie, all fragmentations have been received for this buffer
    • assembleBuffer

      public byte[] assembleBuffer()
      Assembles all the fragmentations into one buffer this method does not check if the fragmentation is complete
      Returns:
      the complete message in one buffer
    • toString

      public String toString()
      debug only
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object