Interface WaterMarkQueue<T>

  • Type Parameters:
    T - The object
    All Superinterfaces:
    BlockingQueue<T>, Collection<T>, Iterable<T>, Queue<T>
    All Known Implementing Classes:
    DefaultWaterMarkQueue

    public interface WaterMarkQueue<T>
    extends BlockingQueue<T>
    This queue acts as a queue with a mark. The methods exposed by the BlockingQueue interface will add elements up to the mark. We call this mark the waterMark. After the water mark the all the insertion operations will fails as if the queue is bounded by this waterMark. After this to add values to the queue the offerAfter method should be called.
    • Method Detail

      • offerAfter

        boolean offerAfter​(T object)
        Offer the element after the water mark.
        Parameters:
        object - object to be inserted
        Returns:
        true if the insert is successful