T - The type of elements this Window is applied topublic static class Window.Bound<T> extends PTransform<PCollection<T>,PCollection<T>>
PTransform that windows the elements of a PCollection<T>,
into finite windows according to a user-specified WindowFn<T, B>.name| Modifier and Type | Method and Description |
|---|---|
Window.Bound<T> |
accumulatingFiredPanes()
Returns a new
Window PTransform that uses the registered WindowFn and
Triggering behavior, and that accumulates elements in a pane after they are triggered. |
PCollection<T> |
apply(PCollection<T> input)
Applies this
PTransform on the given InputT, and returns its
Output. |
Window.Bound<T> |
discardingFiredPanes()
Returns a new
Window PTransform that uses the registered WindowFn and
Triggering behavior, and that discards elements in a pane after they are triggered. |
protected Coder<?> |
getDefaultOutputCoder(PCollection<T> input)
Returns the default
Coder to use for the output of this
single-output PTransform when applied to the given input. |
protected String |
getKindString()
Returns the name to use by default for this
PTransform
(not including the names of any enclosing PTransforms). |
Window.Bound<T> |
named(String name)
Returns a new
Window PTransform that's like this
PTransform but with the specified name. |
Window.Bound<T> |
triggering(TriggerBuilder<?> trigger)
Sets a non-default trigger for this
Window PTransform. |
void |
validate(PCollection<T> input)
Called before invoking apply (which may be intercepted by the runner) to
verify this transform is fully specified and applicable to the specified
input.
|
Window.Bound<T> |
withAllowedLateness(org.joda.time.Duration allowedLateness)
Override the amount of lateness allowed for data elements in the pipeline.
|
Window.Bound<T> |
withAllowedLateness(org.joda.time.Duration allowedLateness,
Window.ClosingBehavior behavior)
Override the amount of lateness allowed for data elements in the pipeline.
|
getDefaultOutputCoder, getDefaultOutputCoder, getName, toStringpublic Window.Bound<T> named(String name)
Window PTransform that's like this
PTransform but with the specified name. Does not
modify this PTransform.
See the discussion of Naming in
ParDo for more
explanation.
@Experimental(value=TRIGGER) public Window.Bound<T> triggering(TriggerBuilder<?> trigger)
Window PTransform.
Elements that are assigned to a specific window will be output when
the trigger fires.
Trigger
has more details on the available triggers.
Must also specify allowed lateness using withAllowedLateness(org.joda.time.Duration) and accumulation
mode using either discardingFiredPanes() or accumulatingFiredPanes().
@Experimental(value=TRIGGER) public Window.Bound<T> discardingFiredPanes()
Window PTransform that uses the registered WindowFn and
Triggering behavior, and that discards elements in a pane after they are triggered.
Does not modify this transform. The resulting PTransform is sufficiently
specified to be applied, but more properties can still be specified.
@Experimental(value=TRIGGER) public Window.Bound<T> accumulatingFiredPanes()
Window PTransform that uses the registered WindowFn and
Triggering behavior, and that accumulates elements in a pane after they are triggered.
Does not modify this transform. The resulting PTransform is sufficiently
specified to be applied, but more properties can still be specified.
@Experimental(value=TRIGGER) public Window.Bound<T> withAllowedLateness(org.joda.time.Duration allowedLateness)
Window operation, this will be applied at
the next GroupByKey. Any elements that are later than this as decided by
the system-maintained watermark will be dropped.
This value also determines how long state will be kept around for old windows. Once no elements will be added to a window (because this duration has passed) any state associated with the window will be cleaned up.
Depending on the trigger this may not produce a pane with PaneInfo.isLast. See
Window.ClosingBehavior.FIRE_IF_NON_EMPTY for more details.
@Experimental(value=TRIGGER) public Window.Bound<T> withAllowedLateness(org.joda.time.Duration allowedLateness, Window.ClosingBehavior behavior)
Window operation, this will be applied at
the next GroupByKey. Any elements that are later than this as decided by
the system-maintained watermark will be dropped.
This value also determines how long state will be kept around for old windows. Once no elements will be added to a window (because this duration has passed) any state associated with the window will be cleaned up.
public void validate(PCollection<T> input)
PTransformBy default, does nothing.
validate in class PTransform<PCollection<T>,PCollection<T>>public PCollection<T> apply(PCollection<T> input)
PTransformPTransform on the given InputT, and returns its
Output.
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).
The default implementation throws an exception. A derived class must
either implement apply, or else each runner must supply a custom
implementation via
PipelineRunner.apply(com.google.cloud.dataflow.sdk.transforms.PTransform<InputT, OutputT>, InputT).
apply in class PTransform<PCollection<T>,PCollection<T>>protected Coder<?> getDefaultOutputCoder(PCollection<T> input)
PTransformCoder to use for the output of this
single-output PTransform when applied to the given input.getDefaultOutputCoder in class PTransform<PCollection<T>,PCollection<T>>protected String getKindString()
PTransformPTransform
(not including the names of any enclosing PTransforms).
By default, returns the base name of this PTransform's class.
The caller is responsible for ensuring that names of applied
PTransforms are unique, e.g., by adding a uniquifying
suffix when needed.
getKindString in class PTransform<PCollection<T>,PCollection<T>>