Class ZkDistributedQueue

  • All Implemented Interfaces:
    DistributedQueue
    Direct Known Subclasses:
    OverseerTaskQueue

    public class ZkDistributedQueue
    extends Object
    implements DistributedQueue
    A ZK-based distributed queue. Optimized for single-consumer, multiple-producer: if there are multiple consumers on the same ZK queue, the results should be correct but inefficient.

    This implementation (with help from subclass OverseerTaskQueue) is used for the /overseer/collection-queue-work queue used for Collection and Config Set API calls to the Overseer.

    Implementation note: In order to enqueue a message into this queue, a CreateMode.EPHEMERAL_SEQUENTIAL response node is created and watched at /overseer/collection-queue-work/qnr-monotonically_increasng_id, then a corresponding CreateMode.PERSISTENT request node reusing the same id is created at /overseer/collection-queue-work/qn-response_id.