Tanzu GemFire Distributed Types Java API Reference
Interface DCircularQueue<E>
- Type Parameters:
E- the type of elements in this queue
- All Superinterfaces:
Collection<E>,DType,Iterable<E>,Queue<E>
An implementation of a
Queue that provides a first-in first-out queue with a
fixed size that replaces its oldest element if full. Most operations are forwarded to the
backend cluster where the actual data is maintained. Objects added to a queue need to be
serializable either as Java Serializable or one of GemFire's serializable types such as
DataSerializable.
Note that iteration methods will serialize the whole structure to the client and perform the
iteration locally. Iterators do not support remove() and will throw an
UnsupportedOperationException.
- Implementation_Note
- The backing queue does not allow null elements to be added.
-
Method Summary
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Method Details
-
add
Adds the given element to this queue. If the queue is full, the least recently added element is discarded so that a new element can be inserted.- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceQueue<E>- Parameters:
e- the element to add- Returns:
- true, always
- Throws:
NullPointerException- if the given element is null
-
offer
Adds the given element to this queue. If the queue is full, the least recently added element is discarded so that a new element can be inserted.- Specified by:
offerin interfaceQueue<E>- Parameters:
e- the element to add- Returns:
- true, always
- Throws:
NullPointerException- if the given element is null
-
iterator
Note that iteration occurs on the client. As such, the entire structure will be serialized to the client and then discarded once iteration is complete.
removeoperations are NOT supported for iteration over this structure and will throw anUnsupportedOperationException.
-