@InterfaceAudience.Private
@InterfaceStability.Evolving
public class ProcedureFairRunQueues<TKey,TQueue extends ProcedureFairRunQueues.FairObject>
extends Object
This class is a container of queues that allows to select a queue
in a round robin fashion, considering priority of the queue.
the quantum is just how many poll() will return the same object.
e.g. if quantum is 1 and you have A and B as object you'll get: A B A B
e.g. if quantum is 2 and you have A and B as object you'll get: A A B B A A B B
then the object priority is just a priority * quantum
Example:
- three queues (A, B, C) with priorities (1, 1, 2)
- The first poll() will return A
- The second poll() will return B
- The third and forth poll() will return C
- and so on again and again.