Class Containers


  • public class Containers
    extends java.lang.Object
    To support the largest 2^48 different keys,we almost need 2^18 Container arrays which holds 2^31 - 8 Container
    • Constructor Summary

      Constructors 
      Constructor Description
      Containers()
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long addContainer​(Container container)
      add a Container
      void deserialize​(java.io.DataInput dataInput)
      Deserialize the byte stream to init this Containers
      void deserialize​(java.nio.ByteBuffer byteBuffer)
      Deserialize the byte stream to init this Containers
      Container getContainer​(long idx)
      get the Container with the corresponding container index
      long getContainerSize()
      the number of all the holding containers
      ContainerIterator iterator()
      a iterator of the Containers
      void remove​(long containerIdx)
      remove the container index Container
      void replace​(int firstLevelIdx, int secondLevelIdx, Container freshContainer)
      replace with a fresh Container
      void replace​(long containerIdx, Container freshContainer)
      replace the container index one with a fresh Container
      void serialize​(java.io.DataOutput dataOutput)
      Serialize the Containers
      void serialize​(java.nio.ByteBuffer byteBuffer)
      Serialize the Containers
      long serializedSizeInBytes()
      Report the number of bytes required for serialization.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Containers

        public Containers()
        Constructor
    • Method Detail

      • remove

        public void remove​(long containerIdx)
        remove the container index Container
        Parameters:
        containerIdx - the container index
      • getContainer

        public Container getContainer​(long idx)
        get the Container with the corresponding container index
        Parameters:
        idx - the container index
        Returns:
        the corresponding Container
      • addContainer

        public long addContainer​(Container container)
        add a Container
        Parameters:
        container - a Container
        Returns:
        the container index
      • iterator

        public ContainerIterator iterator()
        a iterator of the Containers
        Returns:
        a iterator
      • replace

        public void replace​(long containerIdx,
                            Container freshContainer)
        replace the container index one with a fresh Container
        Parameters:
        containerIdx - the container index to replace
        freshContainer - the fresh one
      • replace

        public void replace​(int firstLevelIdx,
                            int secondLevelIdx,
                            Container freshContainer)
        replace with a fresh Container
        Parameters:
        firstLevelIdx - the first level array index
        secondLevelIdx - the second level array index
        freshContainer - a fresh container
      • getContainerSize

        public long getContainerSize()
        the number of all the holding containers
        Returns:
        the container number
      • serializedSizeInBytes

        public long serializedSizeInBytes()
        Report the number of bytes required for serialization.
        Returns:
        The size in bytes
      • serialize

        public void serialize​(java.io.DataOutput dataOutput)
                       throws java.io.IOException
        Serialize the Containers
        Parameters:
        dataOutput - The destination DataOutput
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • serialize

        public void serialize​(java.nio.ByteBuffer byteBuffer)
                       throws java.io.IOException
        Serialize the Containers
        Parameters:
        byteBuffer - The destination ByteBuffer
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • deserialize

        public void deserialize​(java.io.DataInput dataInput)
                         throws java.io.IOException
        Deserialize the byte stream to init this Containers
        Parameters:
        dataInput - The DataInput
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • deserialize

        public void deserialize​(java.nio.ByteBuffer byteBuffer)
                         throws java.io.IOException
        Deserialize the byte stream to init this Containers
        Parameters:
        byteBuffer - The DataInput
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.