Class LogStreamProcessor

    • Field Detail

      • needRegister

        protected final boolean needRegister
      • OBJECT_MAPPER

        protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
    • Method Detail

      • waitForAssignments

        public boolean waitForAssignments​(Duration timeout)
                                   throws InterruptedException
        Description copied from interface: StreamProcessor
        Wait for the computations to have assigned partitions ready to process records. The processor must be started. This is useful for writing unit test.

        Returns true if all computations have assigned partitions during the timeout delay.

        Specified by:
        waitForAssignments in interface StreamProcessor
        Throws:
        InterruptedException
      • toJson

        public String toJson​(Map<String,​String> meta)
        Description copied from interface: StreamProcessor
        Returns a JSON representation of the processor, this includes the list of streams and computations with their settings along with the topology.
        Specified by:
        toJson in interface StreamProcessor
      • stopComputation

        public boolean stopComputation​(Name computation)
        Description copied from interface: StreamProcessor
        Stop a computation thread pool.
        Specified by:
        stopComputation in interface StreamProcessor
        Returns:
        true if computation thread pool was found and stopped.
      • stop

        public boolean stop​(Duration timeout)
        Description copied from interface: StreamProcessor
        Try to stop computations gracefully after processing a record or a timer within the timeout duration. If this can not be done within the timeout, shutdown and returns false.
        Specified by:
        stop in interface StreamProcessor
      • drainAndStop

        public boolean drainAndStop​(Duration timeout)
        Description copied from interface: StreamProcessor
        Stop computations when input streams are empty. The timeout is applied for each computation, the total duration can be up to nb computations * timeout

        Returns true if computations are stopped during the timeout delay.

        Specified by:
        drainAndStop in interface StreamProcessor
      • getLowWatermark

        public long getLowWatermark()
        Description copied from interface: StreamProcessor
        Returns the low watermark for all the computations of the topology. Any message with an offset below the low watermark has been processed. The returned watermark is local to this processing node.
        Specified by:
        getLowWatermark in interface StreamProcessor
      • getLowWatermark

        public long getLowWatermark​(String computationName)
        Description copied from interface: StreamProcessor
        Returns the low watermark for the computation. Any message with an offset below the low watermark has been processed by this computation and its ancestors. The returned watermark is local to this processing node, if the computation is distributed the global low watermark is the minimum of all nodes low watermark.
        Specified by:
        getLowWatermark in interface StreamProcessor
      • isDone

        public boolean isDone​(long timestamp)
        Description copied from interface: StreamProcessor
        Returns true if all messages with a lower timestamp has been processed by the topology.
        Specified by:
        isDone in interface StreamProcessor