com.google.cloud.dataflow.sdk.transforms.windowing

## Class AfterWatermark.FromEndOfWindow<W extends BoundedWindow>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>
  - - com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.OnceTrigger<W>
    - - com.google.cloud.dataflow.sdk.transforms.windowing.AfterWatermark.FromEndOfWindow<W>

All Implemented Interfaces:
  TriggerBuilder<W>, Serializable

Enclosing class:
  AfterWatermark<W extends BoundedWindow>

    public static class AfterWatermark.FromEndOfWindow<W extends BoundedWindow>
    extends Trigger.OnceTrigger<W>

A watermark trigger targeted relative to the end of the window.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.Trigger

`Trigger.MergingTriggerInfo<W extends BoundedWindow>, Trigger.OnceTrigger<W extends BoundedWindow>, Trigger.OnElementContext, Trigger.OnMergeContext, Trigger.TriggerContext, Trigger.TriggerInfo<W extends BoundedWindow>`

### Field Summary

### Fields inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.Trigger

`subTriggers`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object obj)`
`AfterWatermark.FromEndOfWindow<W>` `getContinuationTrigger(List<Trigger<W>> continuationTriggers)` Return the `Trigger.getContinuationTrigger()` of this `Trigger`.
`Instant` `getWatermarkThatGuaranteesFiring(W window)` Returns a bound in watermark time by which this trigger would have fired at least once for a given window had there been input data.
`int` `hashCode()`
`void` `onElement(Trigger.OnElementContext c)` Called immediately after an element is first incorporated into a window.
`void` `onMerge(Trigger.OnMergeContext c)` Called immediately after windows have been merged.
`protected void` `onOnlyFiring(Trigger.TriggerContext context)` Called exactly once by `Trigger.OnceTrigger.onFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext)` when the trigger is fired.
`boolean` `shouldFire(Trigger.TriggerContext context)` Returns `true` if the current state of the trigger indicates that its condition is satisfied and it is ready to fire.
`String` `toString()`
`AfterWatermark.AfterWatermarkEarly<W>` `withEarlyFirings(Trigger.OnceTrigger<W> earlyFirings)` Creates a new `Trigger` like the this, except that it fires repeatedly whenever the given `Trigger` fires before the watermark has passed the end of the window.
`AfterWatermark.AfterWatermarkLate<W>` `withLateFirings(Trigger.OnceTrigger<W> lateFirings)` Creates a new `Trigger` like the this, except that it fires repeatedly whenever the given `Trigger` fires after the watermark has passed the end of the window.

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.OnceTrigger

`getContinuationTrigger, onFire`

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.Trigger

`buildTrigger, clear, isCompatible, orFinally, prefetchOnElement, prefetchOnFire, prefetchOnMerge, prefetchShouldFire, subTriggers`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Method Detail

#### withEarlyFirings

    public AfterWatermark.AfterWatermarkEarly<W> withEarlyFirings(Trigger.OnceTrigger<W> earlyFirings)

Creates a new `Trigger` like the this, except that it fires repeatedly whenever the given `Trigger` fires before the watermark has passed the end of the window.

#### withLateFirings

    public AfterWatermark.AfterWatermarkLate<W> withLateFirings(Trigger.OnceTrigger<W> lateFirings)

Creates a new `Trigger` like the this, except that it fires repeatedly whenever the given `Trigger` fires after the watermark has passed the end of the window.

#### onElement

    public void onElement(Trigger.OnElementContext c)
                   throws Exception

Description copied from class: `Trigger`
Called immediately after an element is first incorporated into a window.

Specified by:
  `onElement` in class `Trigger<W extends BoundedWindow>`
Throws:
  `Exception`

#### onMerge

    public void onMerge(Trigger.OnMergeContext c)
                 throws Exception

Description copied from class: `Trigger`
Called immediately after windows have been merged.

Leaf triggers should update their state by inspecting their status and any state in the merging windows. Composite triggers should update their state by calling `ExecutableTrigger.invokeOnMerge(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.OnMergeContext)` on their sub-triggers, and applying appropriate logic.

A trigger such as `AfterWatermark.pastEndOfWindow()` may no longer be finished; it is the responsibility of the trigger itself to record this fact. It is forbidden for a trigger to become finished due to `Trigger.onMerge(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.OnMergeContext)`, as it has not yet fired the pending elements that led to it being ready to fire.

The implementation does not need to clear out any state associated with the old windows.

Specified by:
  `onMerge` in class `Trigger<W extends BoundedWindow>`
Throws:
  `Exception`

#### getWatermarkThatGuaranteesFiring

    public Instant getWatermarkThatGuaranteesFiring(W window)

Description copied from class: `Trigger`
Returns a bound in watermark time by which this trigger would have fired at least once for a given window had there been input data. This is a static property of a trigger that does not depend on its state.

For triggers that do not fire based on the watermark advancing, returns `BoundedWindow.TIMESTAMP_MAX_VALUE`.

This estimate is used to determine that there are no elements in a side-input window, which causes the default value to be used instead.

Specified by:
  `getWatermarkThatGuaranteesFiring` in class `Trigger<W extends BoundedWindow>`

#### getContinuationTrigger

    public AfterWatermark.FromEndOfWindow<W> getContinuationTrigger(List<Trigger<W>> continuationTriggers)

Description copied from class: `Trigger`
Return the `Trigger.getContinuationTrigger()` of this `Trigger`. For convenience, this is provided the continuation trigger of each of the sub-triggers.

Specified by:
  `getContinuationTrigger` in class `Trigger<W extends BoundedWindow>`

#### toString

    public String toString()

Overrides:
  `toString` in class `Trigger<W extends BoundedWindow>`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Trigger<W extends BoundedWindow>`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Trigger<W extends BoundedWindow>`

#### shouldFire

    public boolean shouldFire(Trigger.TriggerContext context)
                       throws Exception

Description copied from class: `Trigger`
Returns `true` if the current state of the trigger indicates that its condition is satisfied and it is ready to fire.

Specified by:
  `shouldFire` in class `Trigger<W extends BoundedWindow>`
Throws:
  `Exception`

#### onOnlyFiring

    protected void onOnlyFiring(Trigger.TriggerContext context)
                         throws Exception

Description copied from class: `Trigger.OnceTrigger`
Called exactly once by `Trigger.OnceTrigger.onFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext)` when the trigger is fired. By default, invokes `Trigger.OnceTrigger.onFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext)` on all subtriggers for which `Trigger.shouldFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext)` is `true`.

Specified by:
  `onOnlyFiring` in class `Trigger.OnceTrigger<W extends BoundedWindow>`
Throws:
  `Exception`