Interface ComputationContext

    • Method Detail

      • setTimer

        void setTimer​(String key,
                      long time)
        Register a timer callback for some point in the future
        key - Name of the timer callback.
        time - The (ms since epoch) at which the callback should be fired
      • produceRecord

        default void produceRecord​(String streamName,
                                   String key,
                                   byte[] data)
        Emit a record downstream. Records are send effectively on checkpoint using askForCheckpoint().
        streamName - The name of the stream on which the record should be emitted.
        key - The key associated with the record. Only relevant when routing method is `GROUP_BY`.
        data - The binary blob to send downstream.
      • setSourceLowWatermark

        void setSourceLowWatermark​(long watermark)
        Set the low watermark for a source computation.
      • askForCheckpoint

        void askForCheckpoint()
        Ask for checkpoint in order to send records, save input stream offset positions.
      • cancelAskForCheckpoint

        void cancelAskForCheckpoint()
        Finally cancel the request to checkpoint the positions.
      • askForTermination

        void askForTermination()
        Ask to terminate this computation.
      • isSpareComputation

        boolean isSpareComputation()
        true if the computation is a spare instance without any Stream partition assigned. A spare computation will not receive any record and its timer will not be executed.