Package com.hazelcast.collection
Interface IQueue<E>
-
- Type Parameters:
E
- queue item type
- All Superinterfaces:
BaseQueue<E>
,java.util.concurrent.BlockingQueue<E>
,java.util.Collection<E>
,DistributedObject
,ICollection<E>
,java.lang.Iterable<E>
,java.util.Queue<E>
public interface IQueue<E> extends java.util.concurrent.BlockingQueue<E>, BaseQueue<E>, ICollection<E>
Concurrent, blocking, distributed, observable queue.The IQueue is not a partitioned data-structure. All the content of an IQueue is stored in a single machine (and in the backup). The IQueue will not scale by adding more members to the cluster.
- See Also:
BaseQueue
,Queue
,BlockingQueue
,TransactionalQueue
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocalQueueStats
getLocalQueueStats()
Returns LocalQueueStats for this queue.E
poll()
Retrieves and removes the head of this queue, or returnsnull
if this queue is empty.E
poll(long timeout, java.util.concurrent.TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.E
take()
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.-
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, drainTo, drainTo, offer, offer, put, remainingCapacity, remove
-
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getDestroyContextForTenant, getPartitionKey, getServiceName
-
Methods inherited from interface com.hazelcast.collection.ICollection
addItemListener, getName, removeItemListener
-
-
-
-
Method Detail
-
poll
E poll()
Retrieves and removes the head of this queue, or returnsnull
if this queue is empty.
-
poll
E poll(long timeout, @Nonnull java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
poll
in interfaceBaseQueue<E>
- Specified by:
poll
in interfacejava.util.concurrent.BlockingQueue<E>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the head of this queue, or
null
if the specified waiting time elapses before an element is available - Throws:
java.lang.InterruptedException
- if interrupted while waiting
-
take
@Nonnull E take() throws java.lang.InterruptedException
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
-
getLocalQueueStats
LocalQueueStats getLocalQueueStats()
Returns LocalQueueStats for this queue. LocalQueueStats is the statistics for the local portion of this queue.- Returns:
- this queue's local statistics.
-
-