Package com.oracle.coherence.concurrent
Class Queues
java.lang.Object
com.oracle.coherence.concurrent.Queues
A factory to obtain various types of
NamedBlockingQueue
and NamedMapBlockingDeque
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
cacheNameForDeque
(String sName) Return the name of the cache used to hold queue content fpr a given deque name.static String
cacheNameForPagedQueue
(String sName) Return the name of the cache used to hold queue content fpr a given paged queue name.static String
cacheNameForQueue
(String sName) Return the name of the cache used to hold queue content fpr a given queue name.static <E> NamedBlockingDeque
<E> Return aNamedBlockingDeque
.static <E> NamedBlockingDeque
<E> Return aNamedBlockingDeque
.static <E> NamedBlockingQueue
<E> pagedQueue
(String sName) Return a pagedNamedBlockingQueue
.static <E> NamedBlockingQueue
<E> pagedQueue
(String sName, Session session) Return a pagedNamedBlockingQueue
.static <E> NamedBlockingQueue
<E> Return aNamedBlockingQueue
.static <E> NamedBlockingQueue
<E> Return aNamedBlockingQueue
.protected static Session
session()
Return CoherenceSession
for the concurrent module.
-
Field Details
-
QUEUE_CACHE_PREFIX
The prefix use for simple queue cache names.- See Also:
-
PAGED_QUEUE_CACHE_PREFIX
The prefix use for paged queue cache names.- See Also:
-
SESSION_NAME
The session name.
-
-
Constructor Details
-
Queues
public Queues()
-
-
Method Details
-
deque
Return aNamedBlockingDeque
. 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
Return aNamedBlockingDeque
. 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 returnsession
- theSession
to use to obtain the underlying cache- Returns:
- a
NamedBlockingDeque
with the specified name
-
queue
Return aNamedBlockingQueue
. 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
Return aNamedBlockingQueue
. 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 returnsession
- theSession
to use to obtain the underlying cache- Returns:
- a
NamedBlockingQueue
with the specified name
-
pagedQueue
Return a pagedNamedBlockingQueue
. 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
Return a pagedNamedBlockingQueue
. 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 returnsession
- theSession
to use to obtain the underlying cache- Returns:
- a
NamedBlockingQueue
with the specified name
-
cacheNameForQueue
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
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
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
Return CoherenceSession
for the concurrent module.- Returns:
- Coherence
Session
for the concurrent module
-