Package org.apache.beam.sdk.transforms
Class Contextful<ClosureT>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.Contextful<ClosureT>
-
- All Implemented Interfaces:
java.io.Serializable
@Experimental(CONTEXTFUL) public final class Contextful<ClosureT> extends java.lang.Object implements java.io.Serializable
Pair of a bit of user code (a "closure") and theRequirements
needed to run it.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Contextful.Fn<InputT,OutputT>
A function from an input to an output that may additionally accessContextful.Fn.Context
when computing the result.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <InputT,OutputT>
Contextful<Contextful.Fn<InputT,OutputT>>fn(Contextful.Fn<InputT,OutputT> fn, Requirements requirements)
Same withof(ClosureT, org.apache.beam.sdk.transforms.Requirements)
but with better type inference behavior for the case ofContextful.Fn
.static <InputT,OutputT>
Contextful<Contextful.Fn<InputT,OutputT>>fn(ProcessFunction<InputT,OutputT> fn)
static <InputT,OutputT>
Contextful<Contextful.Fn<InputT,OutputT>>fn(SerializableFunction<InputT,OutputT> fn)
Binary compatibility adapter forfn(ProcessFunction)
.ClosureT
getClosure()
Returns the closure.Requirements
getRequirements()
Returns the requirements needed to run the closure.static <ClosureT> Contextful<ClosureT>
of(ClosureT closure, Requirements requirements)
Constructs a pair of the given closure and its requirements.java.lang.String
toString()
-
-
-
Method Detail
-
getClosure
public ClosureT getClosure()
Returns the closure.
-
getRequirements
public Requirements getRequirements()
Returns the requirements needed to run the closure.
-
of
public static <ClosureT> Contextful<ClosureT> of(ClosureT closure, Requirements requirements)
Constructs a pair of the given closure and its requirements.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
fn
public static <InputT,OutputT> Contextful<Contextful.Fn<InputT,OutputT>> fn(ProcessFunction<InputT,OutputT> fn)
-
fn
public static <InputT,OutputT> Contextful<Contextful.Fn<InputT,OutputT>> fn(SerializableFunction<InputT,OutputT> fn)
Binary compatibility adapter forfn(ProcessFunction)
.
-
fn
public static <InputT,OutputT> Contextful<Contextful.Fn<InputT,OutputT>> fn(Contextful.Fn<InputT,OutputT> fn, Requirements requirements)
Same withof(ClosureT, org.apache.beam.sdk.transforms.Requirements)
but with better type inference behavior for the case ofContextful.Fn
.
-
-