Class PeriodicImpulse

java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PBegin,PCollection<Instant>>
org.apache.beam.sdk.transforms.PeriodicImpulse
All Implemented Interfaces:
Serializable, HasDisplayData

public class PeriodicImpulse extends PTransform<PBegin,PCollection<Instant>>
A PTransform which produces a sequence of elements at fixed runtime intervals.

If applyWindowing() is specified, each element will be assigned to its own fixed window.

See PeriodicSequence.

See Also:
  • Method Details

    • create

      public static PeriodicImpulse create()
    • startAt

      public PeriodicImpulse startAt(Instant startTime)
      Assign a timestamp when the pipeliene starts to produce data.

      Cannot be used along with stopAfter(org.joda.time.Duration).

    • stopAt

      public PeriodicImpulse stopAt(Instant stopTime)
      Assign a timestamp when the pipeliene stops producing data.

      Cannot be used along with stopAfter(org.joda.time.Duration).

    • stopAfter

      @Internal public PeriodicImpulse stopAfter(Duration duration)
      For internal use only; no backwards-compatibility guarantees.

      Assign a time interval at which the pipeliene produces data. This is different from setting startAt(org.joda.time.Instant) and stopAt(org.joda.time.Instant), as the first timestamp is determined at run time (pipeline starts processing).

    • withInterval

      public PeriodicImpulse withInterval(Duration interval)
    • applyWindowing

      public PeriodicImpulse applyWindowing()
    • catchUpToNow

      @Internal public PeriodicImpulse catchUpToNow(boolean catchUpToNow)
      For internal use only; no backwards-compatibility guarantees.

      The default behavior is that PeriodicImpulse emits all instants until Instant.now(), then starts firing at the specified interval. If this is set to false, the PeriodicImpulse will perform the interval wait before firing each instant.

    • expand

      public PCollection<Instant> expand(PBegin input)
      Description copied from class: PTransform
      Override this method to specify how this PTransform should be expanded on the given InputT.

      NOTE: This method should not be called directly. Instead apply the PTransform should be applied to the InputT using the apply method.

      Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).

      Specified by:
      expand in class PTransform<PBegin,PCollection<Instant>>