Class BlockingQueueLogObserver<OffsetT extends java.io.Serializable,​ContextT extends LogObserver.OnNextContext<OffsetT>>

    • Constructor Detail

      • BlockingQueueLogObserver

        private BlockingQueueLogObserver​(java.lang.String name,
                                         long limit,
                                         long startingWatermark,
                                         int capacity)
    • Method Detail

      • onIdle

        void onIdle​(long watermark)
      • take

        @Nullable
        StreamElement take()
        Take next element without blocking.
        Returns:
        element that was taken without blocking or null otherwise
      • takeBlocking

        @Nullable
        StreamElement takeBlocking​(long timeout,
                                   java.util.concurrent.TimeUnit unit)
                            throws java.lang.InterruptedException
        Take next element waiting for input if necessary.
        Returns:
        element that was taken or null on end of input
        Throws:
        java.lang.InterruptedException
      • takeBlocking

        @Nullable
        StreamElement takeBlocking()
                            throws java.lang.InterruptedException
        Take next element waiting for input if necessary.
        Returns:
        element that was taken or null on end of input
        Throws:
        java.lang.InterruptedException
      • peekElement

        public boolean peekElement()
        Peek element or return null if queue is empty.
        Returns:
        true if queue is not empty after the call
      • peekElement

        public boolean peekElement​(long timeout,
                                   java.util.concurrent.TimeUnit unit)
                            throws java.lang.InterruptedException
        Peek element or return null if queue is empty within given timeout
        Parameters:
        timeout - the timeout
        unit - time unit of timeout
        Throws:
        java.lang.InterruptedException - when interrupted
      • getError

        @Nullable
        java.lang.Throwable getError()
      • getWatermark

        long getWatermark()
      • stop

        void stop()
      • stop

        void stop​(boolean nack)
      • clearIncomingQueue

        void clearIncomingQueue()
      • updateAndLogWatermark

        private void updateAndLogWatermark​(long newWatermark)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • readResolve

        java.lang.Object readResolve()