Class TimerReceiverFactory
java.lang.Object
org.apache.beam.runners.fnexecution.control.TimerReceiverFactory
A factory that passes timers to
timerDataConsumer
.
The constructed timers uses len(transformId):transformId:timerId
as the timer id to
prevent string collisions. See encodeToTimerDataTimerId(java.lang.String, java.lang.String)
and decodeTimerDataTimerId(java.lang.String)
for functions to aid with encoding and decoding.
If the incoming timer is being cleared, the TimerInternals.TimerData
sets the fire and hold
timestamps to BoundedWindow.TIMESTAMP_MAX_VALUE
.
-
Constructor Summary
ConstructorsConstructorDescriptionTimerReceiverFactory
(StageBundleFactory stageBundleFactory, BiConsumer<org.apache.beam.sdk.util.construction.Timer<?>, org.apache.beam.runners.core.TimerInternals.TimerData> timerDataConsumer, Coder windowCoder) -
Method Summary
Modifier and TypeMethodDescription<K> FnDataReceiver
<org.apache.beam.sdk.util.construction.Timer<K>> decodeTimerDataTimerId
(String timerDataTimerId) Decodes a string into the transform and timer family ids.static String
encodeToTimerDataTimerId
(String transformId, String timerFamilyId) Encodes transform and timer family ids into a single string which retains the human readable formatlen(transformId):transformId:timerId
.
-
Constructor Details
-
TimerReceiverFactory
public TimerReceiverFactory(StageBundleFactory stageBundleFactory, BiConsumer<org.apache.beam.sdk.util.construction.Timer<?>, org.apache.beam.runners.core.TimerInternals.TimerData> timerDataConsumer, Coder windowCoder)
-
-
Method Details
-
create
public <K> FnDataReceiver<org.apache.beam.sdk.util.construction.Timer<K>> create(String transformId, String timerFamilyId) -
encodeToTimerDataTimerId
Encodes transform and timer family ids into a single string which retains the human readable formatlen(transformId):transformId:timerId
. SeedecodeTimerDataTimerId(java.lang.String)
for decoding. -
decodeTimerDataTimerId
Decodes a string into the transform and timer family ids. SeeencodeToTimerDataTimerId(java.lang.String, java.lang.String)
for encoding.
-