public class PeriodicImpulse extends PTransform<PBegin,PCollection<Instant>>
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.
annotations, displayData, name, resourceHints| Modifier and Type | Method and Description |
|---|---|
PeriodicImpulse |
applyWindowing() |
PeriodicImpulse |
catchUpToNow(boolean catchUpToNow)
For internal use only; no backwards-compatibility guarantees.
|
static PeriodicImpulse |
create() |
PCollection<Instant> |
expand(PBegin input)
Override this method to specify how this
PTransform should be expanded on the given
InputT. |
PeriodicImpulse |
startAt(Instant startTime)
Assign a timestamp when the pipeliene starts to produce data.
|
PeriodicImpulse |
stopAfter(Duration duration)
For internal use only; no backwards-compatibility guarantees.
|
PeriodicImpulse |
stopAt(Instant stopTime)
Assign a timestamp when the pipeliene stops producing data.
|
PeriodicImpulse |
withInterval(Duration interval) |
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validatepublic static PeriodicImpulse create()
public PeriodicImpulse startAt(Instant startTime)
Cannot be used along with stopAfter(org.joda.time.Duration).
public PeriodicImpulse stopAt(Instant stopTime)
Cannot be used along with stopAfter(org.joda.time.Duration).
@Internal public PeriodicImpulse stopAfter(Duration duration)
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).
public PeriodicImpulse withInterval(Duration interval)
public PeriodicImpulse applyWindowing()
@Internal public PeriodicImpulse catchUpToNow(boolean catchUpToNow)
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.
public PCollection<Instant> expand(PBegin input)
PTransformPTransform 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).
expand in class PTransform<PBegin,PCollection<Instant>>