Package com.hazelcast.collection
Interface IQueue<E>
- Type Parameters:
E- queue item type
- All Superinterfaces:
BaseQueue<E>,BlockingQueue<E>,Collection<E>,DistributedObject,ICollection<E>,Iterable<E>,Queue<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:
-
Method Summary
Modifier and TypeMethodDescriptionReturns LocalQueueStats for this queue.poll()Retrieves and removes the head of this queue, or returnsnullif this queue is empty.Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.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, removeMethods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface com.hazelcast.core.DistributedObject
destroy, getDestroyContextForTenant, getPartitionKey, getServiceNameMethods inherited from interface com.hazelcast.collection.ICollection
addItemListener, getName, removeItemListener
-
Method Details
-
poll
E poll()Retrieves and removes the head of this queue, or returnsnullif this queue is empty. -
poll
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:
pollin interfaceBaseQueue<E>- Specified by:
pollin interfaceBlockingQueue<E>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
take
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.- Specified by:
takein interfaceBaseQueue<E>- Specified by:
takein interfaceBlockingQueue<E>- Returns:
- the head of this queue
- Throws:
InterruptedException- if interrupted while waiting
-
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.
-