public abstract class DoFn.ProcessContext extends DoFn.Context
DoFn.processElement(com.google.cloud.dataflow.sdk.transforms.DoFn<I, O>.ProcessContext).| Constructor and Description |
|---|
DoFn.ProcessContext() |
| Modifier and Type | Method and Description |
|---|---|
abstract I |
element()
Returns the input element to be processed.
|
abstract DoFn.KeyedState |
keyedState()
Returns this
DoFn's state associated with the input
element's key. |
abstract <T> T |
sideInput(PCollectionView<T> view)
Returns the value of the side input for the window corresponding to the
window of the main input element.
|
abstract Instant |
timestamp()
Returns the timestamp of the input element.
|
abstract BoundedWindow |
window()
Returns the window into which the input element has been assigned.
|
createAggregator, createAggregator, getPipelineOptions, output, outputWithTimestamp, sideOutput, sideOutputWithTimestamppublic abstract I element()
public abstract <T> T sideInput(PCollectionView<T> view)
See
WindowFn.getSideInputWindow(com.google.cloud.dataflow.sdk.transforms.windowing.BoundedWindow)
for how this corresponding window is determined.
java.lang.IllegalArgumentException - if this is not a side inputParDo.withSideInputs(com.google.cloud.dataflow.sdk.values.PCollectionView<?>...)public abstract DoFn.KeyedState keyedState()
DoFn's state associated with the input
element's key. This state can be used by the DoFn to
store whatever information it likes with that key. Unlike
DoFn instance variables, this state is persistent and
can be arbitrarily large; it is more expensive than instance
variable state, however. It is particularly intended for
streaming computations.
Requires that this DoFn implements
DoFn.RequiresKeyedState.
Each ParDo invocation with this DoFn as an
argument will maintain its own KeyedState maps, one per
key.
java.lang.UnsupportedOperationException - if this DoFn does
not implement DoFn.RequiresKeyedState.public abstract Instant timestamp()
See Window
for more information.
public abstract BoundedWindow window()
See Window
for more information.
java.lang.UnsupportedOperationException - if this DoFn does
not implement DoFn.RequiresWindowAccess.