Interface DoFnInvoker.ArgumentProvider<InputT,OutputT>
-
- All Known Implementing Classes:
DoFnInvoker.BaseArgumentProvider
,DoFnInvoker.DelegatingArgumentProvider
,DoFnInvoker.FakeArgumentProvider
- Enclosing interface:
- DoFnInvoker<InputT,OutputT>
@Internal public static interface DoFnInvoker.ArgumentProvider<InputT,OutputT>
Interface for runner implementors to provide implementations of extra context information.The methods on this interface are called by
DoFnInvoker
before invoking an annotatedDoFn.StartBundle
,DoFn.ProcessElement
orDoFn.FinishBundle
method that has indicated it needs the given extra context.In the case of
DoFn.ProcessElement
it is called once per invocation ofDoFn.ProcessElement
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DoFn.BundleFinalizer
bundleFinalizer()
Provide aDoFn.BundleFinalizer
for being able to register a callback after the bundle has been successfully persisted by the runner.InputT
element(DoFn<InputT,OutputT> doFn)
Provide a reference to the input element.DoFn.FinishBundleContext
finishBundleContext(DoFn<InputT,OutputT> doFn)
Provide aDoFn.FinishBundleContext
to use with the givenDoFn
.java.lang.Object
key()
Provide a reference to the input element key inKV
pair.DoFn.OnTimerContext
onTimerContext(DoFn<InputT,OutputT> doFn)
Provide aDoFn.OnTimerContext
to use with the givenDoFn
.DoFn.OutputReceiver<OutputT>
outputReceiver(DoFn<InputT,OutputT> doFn)
Provide aDoFn.OutputReceiver
for outputting to the default output.DoFn.OutputReceiver<Row>
outputRowReceiver(DoFn<InputT,OutputT> doFn)
Provide aDoFn.OutputReceiver
for outputting rows to the default output.PaneInfo
paneInfo(DoFn<InputT,OutputT> doFn)
Provides aPaneInfo
.PipelineOptions
pipelineOptions()
ProvidePipelineOptions
.DoFn.ProcessContext
processContext(DoFn<InputT,OutputT> doFn)
Provide aDoFn.ProcessContext
to use with the givenDoFn
.java.lang.Object
restriction()
If this is a splittableDoFn
, returns the associated restriction with the current call.RestrictionTracker<?,?>
restrictionTracker()
If this is a splittableDoFn
, returns the associatedRestrictionTracker
with the current call.java.lang.Object
schemaElement(int index)
Provide a reference to the selected schema field corresponding to the input argument specified by index.java.lang.Object
sideInput(java.lang.String tagId)
Provide a reference to the input sideInput with the specified tag.DoFn.StartBundleContext
startBundleContext(DoFn<InputT,OutputT> doFn)
Provide aDoFn.StartBundleContext
to use with the givenDoFn
.State
state(java.lang.String stateId, boolean alwaysFetched)
Returns the state cell for the givenDoFn.StateId
.DoFn.MultiOutputReceiver
taggedOutputReceiver(DoFn<InputT,OutputT> doFn)
Provide aDoFn.MultiOutputReceiver
for outputting to the default output.TimeDomain
timeDomain(DoFn<InputT,OutputT> doFn)
Provide a reference to the time domain for a timer firing.Timer
timer(java.lang.String timerId)
Returns the timer for the givenDoFn.TimerId
.TimerMap
timerFamily(java.lang.String tagId)
Returns the timerMap for the givenDoFn.TimerFamily
.java.lang.String
timerId(DoFn<InputT,OutputT> doFn)
Returns the timer id for the current timer of aDoFn.TimerFamily
.org.joda.time.Instant
timestamp(DoFn<InputT,OutputT> doFn)
Provide a reference to the input element timestamp.WatermarkEstimator<?>
watermarkEstimator()
If this is a splittableDoFn
, returns the associatedWatermarkEstimator
with the current call.java.lang.Object
watermarkEstimatorState()
If this is a splittableDoFn
, returns the associated watermark estimator state with the current call.BoundedWindow
window()
Construct theBoundedWindow
to use within aDoFn
that needs it.
-
-
-
Method Detail
-
window
BoundedWindow window()
Construct theBoundedWindow
to use within aDoFn
that needs it. This is called if theDoFn.ProcessElement
method has a parameter of typeBoundedWindow
.- Returns:
BoundedWindow
of the element currently being processed.
-
pipelineOptions
PipelineOptions pipelineOptions()
ProvidePipelineOptions
.
-
startBundleContext
DoFn.StartBundleContext startBundleContext(DoFn<InputT,OutputT> doFn)
Provide aDoFn.StartBundleContext
to use with the givenDoFn
.
-
finishBundleContext
DoFn.FinishBundleContext finishBundleContext(DoFn<InputT,OutputT> doFn)
Provide aDoFn.FinishBundleContext
to use with the givenDoFn
.
-
processContext
DoFn.ProcessContext processContext(DoFn<InputT,OutputT> doFn)
Provide aDoFn.ProcessContext
to use with the givenDoFn
.
-
onTimerContext
DoFn.OnTimerContext onTimerContext(DoFn<InputT,OutputT> doFn)
Provide aDoFn.OnTimerContext
to use with the givenDoFn
.
-
key
java.lang.Object key()
Provide a reference to the input element key inKV
pair.
-
sideInput
java.lang.Object sideInput(java.lang.String tagId)
Provide a reference to the input sideInput with the specified tag.
-
schemaElement
java.lang.Object schemaElement(int index)
Provide a reference to the selected schema field corresponding to the input argument specified by index.
-
timestamp
org.joda.time.Instant timestamp(DoFn<InputT,OutputT> doFn)
Provide a reference to the input element timestamp.
-
timeDomain
TimeDomain timeDomain(DoFn<InputT,OutputT> doFn)
Provide a reference to the time domain for a timer firing.
-
outputReceiver
DoFn.OutputReceiver<OutputT> outputReceiver(DoFn<InputT,OutputT> doFn)
Provide aDoFn.OutputReceiver
for outputting to the default output.
-
outputRowReceiver
DoFn.OutputReceiver<Row> outputRowReceiver(DoFn<InputT,OutputT> doFn)
Provide aDoFn.OutputReceiver
for outputting rows to the default output.
-
taggedOutputReceiver
DoFn.MultiOutputReceiver taggedOutputReceiver(DoFn<InputT,OutputT> doFn)
Provide aDoFn.MultiOutputReceiver
for outputting to the default output.
-
bundleFinalizer
DoFn.BundleFinalizer bundleFinalizer()
Provide aDoFn.BundleFinalizer
for being able to register a callback after the bundle has been successfully persisted by the runner.
-
restriction
java.lang.Object restriction()
If this is a splittableDoFn
, returns the associated restriction with the current call.
-
restrictionTracker
RestrictionTracker<?,?> restrictionTracker()
If this is a splittableDoFn
, returns the associatedRestrictionTracker
with the current call.
-
watermarkEstimatorState
java.lang.Object watermarkEstimatorState()
If this is a splittableDoFn
, returns the associated watermark estimator state with the current call.
-
watermarkEstimator
WatermarkEstimator<?> watermarkEstimator()
If this is a splittableDoFn
, returns the associatedWatermarkEstimator
with the current call.
-
state
State state(java.lang.String stateId, boolean alwaysFetched)
Returns the state cell for the givenDoFn.StateId
.
-
timer
Timer timer(java.lang.String timerId)
Returns the timer for the givenDoFn.TimerId
.
-
timerFamily
TimerMap timerFamily(java.lang.String tagId)
Returns the timerMap for the givenDoFn.TimerFamily
.
-
timerId
java.lang.String timerId(DoFn<InputT,OutputT> doFn)
Returns the timer id for the current timer of aDoFn.TimerFamily
.
-
-