Class ThresholdBlockingQueue<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- io.nflow.engine.internal.executor.ThresholdBlockingQueue<E>
-
- All Implemented Interfaces:
Iterable<E>,Collection<E>,BlockingQueue<E>,Queue<E>
public class ThresholdBlockingQueue<E> extends AbstractQueue<E> implements BlockingQueue<E>
-
-
Constructor Summary
Constructors Constructor Description ThresholdBlockingQueue(int capacity, int notifyThreshHold)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdrainTo(Collection<? super E> c)intdrainTo(Collection<? super E> c, int maxElements)Iterator<E>iterator()voidnotifyIfNotFull()booleanoffer(E e)booleanoffer(E e, long timeout, TimeUnit unit)Epeek()Epoll()Epoll(long timeout, TimeUnit unit)voidput(E e)intremainingCapacity()intsize()Etake()voidwaitUntilQueueSizeLowerThanThreshold(org.joda.time.DateTime waitUntil)-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, remove
-
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
-
-
-
Method Detail
-
notifyIfNotFull
public void notifyIfNotFull()
-
waitUntilQueueSizeLowerThanThreshold
public void waitUntilQueueSizeLowerThanThreshold(org.joda.time.DateTime waitUntil) throws InterruptedException- Throws:
InterruptedException
-
offer
public boolean offer(E e)
-
iterator
public Iterator<E> iterator()
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin classAbstractCollection<E>
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein classAbstractCollection<E>
-
put
public void put(E e) throws InterruptedException
- Specified by:
putin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
offer
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
offerin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
take
public E take() throws InterruptedException
- Specified by:
takein interfaceBlockingQueue<E>- Throws:
InterruptedException
-
poll
public E poll(long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
pollin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacityin interfaceBlockingQueue<E>
-
drainTo
public int drainTo(Collection<? super E> c)
- Specified by:
drainToin interfaceBlockingQueue<E>
-
drainTo
public int drainTo(Collection<? super E> c, int maxElements)
- Specified by:
drainToin interfaceBlockingQueue<E>
-
-