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

## Class Trigger.OnMergeContext

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.TriggerContext
  - - com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.OnMergeContext

Enclosing class:
  Trigger<W extends BoundedWindow>

    public abstract class Trigger.OnMergeContext
    extends Trigger.TriggerContext

Extended `Trigger.TriggerContext` containing information accessible to the `Trigger.onMerge(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.OnMergeContext)` operational hook.

### Constructor Summary

Constructors
Constructor and Description
`OnMergeContext()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract Trigger.OnMergeContext` `forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)` Create an `OnMergeContext` for executing the given trigger.
`abstract void` `setTimer(Instant timestamp, com.google.cloud.dataflow.sdk.util.TimeDomain domain)` Sets a timer to fire when the watermark or processing time is beyond the given timestamp.
`abstract com.google.cloud.dataflow.sdk.util.state.MergingStateAccessor<?,W>` `state()` Returns the interface for accessing persistent state.
`abstract Trigger.MergingTriggerInfo<W>` `trigger()` Returns the interface for accessing trigger info.

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

`currentEventTime, currentProcessingTime, currentSynchronizedProcessingTime, deleteTimer, window`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### OnMergeContext

    public OnMergeContext()

### Method Detail

#### setTimer

    public abstract void setTimer(Instant timestamp,
                                  com.google.cloud.dataflow.sdk.util.TimeDomain domain)

Sets a timer to fire when the watermark or processing time is beyond the given timestamp. Timers are not guaranteed to fire immediately, but will be delivered at some time afterwards.

As with `state()`, timers are implicitly scoped to the current window. All timer firings for a window will be received, but the implementation should choose to ignore those that are not applicable.

Parameters:
  `timestamp` - the time at which the trigger should be re-evaluated
  `domain` - the domain that the `timestamp` applies to

#### forTrigger

    public abstract Trigger.OnMergeContext forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)

Create an `OnMergeContext` for executing the given trigger.

Specified by:
  `forTrigger` in class `Trigger.TriggerContext`

#### state

    public abstract com.google.cloud.dataflow.sdk.util.state.MergingStateAccessor<?,W> state()

Description copied from class: `Trigger.TriggerContext`
Returns the interface for accessing persistent state.

Specified by:
  `state` in class `Trigger.TriggerContext`

#### trigger

    public abstract Trigger.MergingTriggerInfo<W> trigger()

Description copied from class: `Trigger.TriggerContext`
Returns the interface for accessing trigger info.

Specified by:
  `trigger` in class `Trigger.TriggerContext`