Package org.jppf.queue
Interface JPPFQueue<T,U,V>
- Type Parameters:
T- the type of jobs that are queued.U- the type of input bundles the jobs are split into.V- the type of resulting bundles the jobs are split into.
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
AbstractJPPFQueue
Implementation of a generic non-blocking queue, to allow asynchronous access from a large number of threads.
- Author:
- Laurent Cohen
-
Method Summary
Modifier and TypeMethodDescriptionAdd an object to the queue, and notify all listeners about it.intGet the maximum bundle size for the bundles present in the queue.booleanisEmpty()Determine whether the queue is empty or not.nextBundle(T bundleWrapper, int nbTasks, ExecutorChannel<V> channel) Get the next bundle in the queue.removeBundle(T bundleWrapper) Remove the specified bundle from the queue.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
addBundle
Add an object to the queue, and notify all listeners about it.- Parameters:
bundleWrapper- the object to add to the queue.- Returns:
- the job the bundle is a part of.
-
nextBundle
Get the next bundle in the queue.- Parameters:
bundleWrapper- the bundle to either remove or extract a sub-bundle from.nbTasks- the maximum number of tasks to get out of the bundle.channel- the channel on which the bindle will be executed.- Returns:
- the most recent object that was added to the queue.
-
isEmpty
boolean isEmpty()Determine whether the queue is empty or not.- Returns:
- true if the queue is empty, false otherwise.
-
getMaxBundleSize
int getMaxBundleSize()Get the maximum bundle size for the bundles present in the queue.- Returns:
- the bundle size as an int.
-
removeBundle
Remove the specified bundle from the queue.- Parameters:
bundleWrapper- the bundle to remove.- Returns:
- the bundle that was removed.
-