com.hazelcast.jet.core

## Interface WatermarkEmissionPolicy

- All Superinterfaces:
    Serializable
  Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

      @FunctionalInterface
      public interface WatermarkEmissionPolicy
      extends Serializable

  A policy object that decides when the watermark has advanced enough to require emitting a new watermark item. For example, a sliding/tumbling window processor doesn't need to observe more than one watermark item per frame.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static WatermarkEmissionPolicy` | `NULL_EMIT_POLICY` The null-object.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static WatermarkEmissionPolicy` | `emitByFrame(SlidingWindowPolicy wDef)` Returns a watermark emission policy that ensures that the value of the emitted watermark belongs to a frame higher than the previous watermark's frame, as per the supplied `WindowDefinition`.
    `static WatermarkEmissionPolicy` | `emitByMinStep(long minStep)` Returns a watermark emission policy that ensures that each emitted watermark's value is at least `minStep` more than the previous one.
    `static WatermarkEmissionPolicy` | `noThrottling()` Returns a policy that does no throttling: emits each watermark.
    `static WatermarkEmissionPolicy` | `noWatermarks()` Returns a policy that doesn't emit watermarks.
    `long` | `throttleWm(long currentWm, long lastEmittedWm)` Decides which watermark to emit based on the supplied `currentWm` value and `lastEmittedWm`.

- - ### Field Detail

    - #### NULL_EMIT_POLICY

          static final WatermarkEmissionPolicy NULL_EMIT_POLICY

      The null-object. Its method throws an exception.

  - ### Method Detail

    - #### throttleWm

          long throttleWm(long currentWm,
                          long lastEmittedWm)

      Decides which watermark to emit based on the supplied `currentWm` value and `lastEmittedWm`. We expect the `currentWm > lastEmittedWm`.

    - #### noThrottling

          @Nonnull
          static WatermarkEmissionPolicy noThrottling()

      Returns a policy that does no throttling: emits each watermark. Since the timestamps are typically quite dense (in milliseconds), this emission policy will pass through many watermark items that have no useful effect in terms of updating the state of accumulating vertices. It is useful primarily in testing scenarios or some specific cases where it is known that no watermark throttling is needed.

    - #### noWatermarks

          @Nonnull
          static WatermarkEmissionPolicy noWatermarks()

      Returns a policy that doesn't emit watermarks. Use it in pipelines that contain timestamped stages, but no windowing stage.

    - #### emitByMinStep

          @Nonnull
          static WatermarkEmissionPolicy emitByMinStep(long minStep)

      Returns a watermark emission policy that ensures that each emitted watermark's value is at least `minStep` more than the previous one. This is a general, scenario-agnostic throttling policy.

    - #### emitByFrame

          @Nonnull
          static WatermarkEmissionPolicy emitByFrame(SlidingWindowPolicy wDef)

      Returns a watermark emission policy that ensures that the value of the emitted watermark belongs to a frame higher than the previous watermark's frame, as per the supplied `WindowDefinition`. This emission policy should be employed to drive a downstream processor that computes a sliding/tumbling window (`Processors.accumulateByFrameP(java.util.List<com.hazelcast.jet.function.DistributedFunction<?, ? extends K>>, java.util.List<com.hazelcast.jet.function.DistributedToLongFunction<?>>, com.hazelcast.jet.core.TimestampKind, com.hazelcast.jet.core.SlidingWindowPolicy, com.hazelcast.jet.aggregate.AggregateOperation<A, ?>)` or `Processors.aggregateToSlidingWindowP(java.util.List<com.hazelcast.jet.function.DistributedFunction<?, ? extends K>>, java.util.List<com.hazelcast.jet.function.DistributedToLongFunction<?>>, com.hazelcast.jet.core.TimestampKind, com.hazelcast.jet.core.SlidingWindowPolicy, com.hazelcast.jet.aggregate.AggregateOperation<A, R>, com.hazelcast.jet.function.KeyedWindowResultFunction<? super K, ? super R, OUT>)`).

Copyright © 2018. All rights reserved.