Class Queues

java.lang.Object
com.oracle.coherence.concurrent.Queues

public class Queues extends Object
A factory to obtain various types of NamedBlockingQueue and NamedMapBlockingDeque.
  • Field Details

    • QUEUE_CACHE_PREFIX

      public static final String QUEUE_CACHE_PREFIX
      The prefix use for simple queue cache names.
      See Also:
    • PAGED_QUEUE_CACHE_PREFIX

      public static final String PAGED_QUEUE_CACHE_PREFIX
      The prefix use for paged queue cache names.
      See Also:
    • SESSION_NAME

      public static final String SESSION_NAME
      The session name.
  • Constructor Details

    • Queues

      public Queues()
  • Method Details

    • deque

      public static <E> NamedBlockingDeque<E> deque(String sName)
      Return a NamedBlockingDeque.

      The queue implementation returned by this method has a maximum size of 2GB. If the queue reaches capacity it will not accept further elements until some have been removed by one of the poll methods.

      Type Parameters:
      E - the type of element in the queue
      Parameters:
      sName - the name of the queue to return
      Returns:
      a NamedBlockingDeque with the specified name
    • deque

      public static <E> NamedBlockingDeque<E> deque(String sName, Session session)
      Return a NamedBlockingDeque.

      The queue implementation returned by this method has a maximum size of 2GB. If the queue reaches capacity it will not accept further elements until some have been removed by one of the poll methods.

      Type Parameters:
      E - the type of element in the queue
      Parameters:
      sName - the name of the queue to return
      session - the Session to use to obtain the underlying cache
      Returns:
      a NamedBlockingDeque with the specified name
    • queue

      public static <E> NamedBlockingQueue<E> queue(String sName)
      Return a NamedBlockingQueue.

      The queue implementation returned by this method has a maximum size of 2GB. If the queue reaches capacity it will not accept further elements until some have been removed by one of the poll methods.

      Type Parameters:
      E - the type of element in the queue
      Parameters:
      sName - the name of the queue to return
      Returns:
      a NamedBlockingQueue with the specified name
    • queue

      public static <E> NamedBlockingQueue<E> queue(String sName, Session session)
      Return a NamedBlockingQueue.

      The queue implementation returned by this method has a maximum size of 2GB. If the queue reaches capacity it will not accept further elements until some have been removed by one of the poll methods.

      Type Parameters:
      E - the type of element in the queue
      Parameters:
      sName - the name of the queue to return
      session - the Session to use to obtain the underlying cache
      Returns:
      a NamedBlockingQueue with the specified name
    • pagedQueue

      public static <E> NamedBlockingQueue<E> pagedQueue(String sName)
      Return a paged NamedBlockingQueue.

      The queue implementation returned by this method has a maximum size of 2GB. If the queue reaches capacity it will not accept further elements until some have been removed by one of the poll methods.

      Type Parameters:
      E - the type of element in the queue
      Parameters:
      sName - the name of the queue to return
      Returns:
      a NamedBlockingQueue with the specified name
    • pagedQueue

      public static <E> NamedBlockingQueue<E> pagedQueue(String sName, Session session)
      Return a paged NamedBlockingQueue.

      The implementation of the queue returned distributes the queue elements over the cluster in pages. The size of the queue is limited to the amount of data that can be stored in the underlying caches.

      As a guide to the maximum size, this would be the partition count multiplied by the recommended maximum size of a cache partition. A cache partition should never exceed 2GB in total, but in practice should be a lot less than this to all for fast fail-over. If the recommended max partition size is around a 100MB, then for the default partition count of 257, this gives a queue size of around 25GB and for a partition count of 1087, this gives a queue size of around 108GB.

      Type Parameters:
      E - the type of element in the queue
      Parameters:
      sName - the name of the queue to return
      session - the Session to use to obtain the underlying cache
      Returns:
      a NamedBlockingQueue with the specified name
    • cacheNameForQueue

      public static String cacheNameForQueue(String sName)
      Return the name of the cache used to hold queue content fpr a given queue name.
      Parameters:
      sName - the name of the queue
      Returns:
      the name of the cache used to hold queue content fpr a given queue name
    • cacheNameForDeque

      public static String cacheNameForDeque(String sName)
      Return the name of the cache used to hold queue content fpr a given deque name.
      Parameters:
      sName - the name of the queue
      Returns:
      the name of the cache used to hold queue content fpr a given deque name
    • cacheNameForPagedQueue

      public static String cacheNameForPagedQueue(String sName)
      Return the name of the cache used to hold queue content fpr a given paged queue name.
      Parameters:
      sName - the name of the queue
      Returns:
      the name of the cache used to hold queue content fpr a given paged queue name
    • session

      protected static Session session()
      Return Coherence Session for the concurrent module.
      Returns:
      Coherence Session for the concurrent module