Skip navigation links
ACS-2016.6
alma.acs.util.stringqueue

Class EntriesQueue

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int MAX_QUEUE_LENGTH
      The max number of entries kept in memory.
      static int PAGE_LEN
      The number of QueueEntry to read/write from/to disk on each I/O
      static int THRESHOLD
      When in the LinkedBlockingQueue there are less entries then the THRESHOLD then the entries in the buffer are flushed in the queue
    • Constructor Summary

      Constructors 
      Constructor and Description
      EntriesQueue() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clear()
      Clear the queue and the file (if any)
      QueueEntry get()
      Get the next value from the queue.
      boolean isEmpty() 
      void put(QueueEntry entry)
      Put an entry in Cache.
      int size()
      Return the number of cache entries waiting in queue
      • Methods inherited from class java.lang.Object

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

      • MAX_QUEUE_LENGTH

        public static final int MAX_QUEUE_LENGTH
        The max number of entries kept in memory.
        See Also:
        Constant Field Values
      • THRESHOLD

        public static final int THRESHOLD
        When in the LinkedBlockingQueue there are less entries then the THRESHOLD then the entries in the buffer are flushed in the queue
        See Also:
        Constant Field Values
    • Constructor Detail

      • EntriesQueue

        public EntriesQueue()
    • Method Detail

      • put

        public void put(QueueEntry entry)
                 throws java.io.IOException
        Put an entry in Cache.

        If the cache is full the entry is added to the buffer.

        Parameters:
        entry - The not null QueueEntry to add to the queue
        Throws:
        java.io.IOException - In case of I/O error while flushing the cache on disk
      • get

        public QueueEntry get()
                       throws java.io.IOException
        Get the next value from the queue.
        Returns:
        The next item in the queue or null if the queue is empty
        Throws:
        java.io.IOException - In case of error during I/O
      • clear

        public void clear()
        Clear the queue and the file (if any)
      • size

        public int size()
        Return the number of cache entries waiting in queue
      • isEmpty

        public boolean isEmpty()
        Returns:
        true if the queue is empty; false otherwise.
Generated at 2016-07-04