Class TimerReceiverFactory


  • public class TimerReceiverFactory
    extends java.lang.Object
    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

      Constructors 
      Constructor Description
      TimerReceiverFactory​(StageBundleFactory stageBundleFactory, java.util.function.BiConsumer<org.apache.beam.sdk.util.construction.Timer<?>,​org.apache.beam.runners.core.TimerInternals.TimerData> timerDataConsumer, org.apache.beam.sdk.coders.Coder windowCoder)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <K> org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.construction.Timer<K>> create​(java.lang.String transformId, java.lang.String timerFamilyId)  
      static org.apache.beam.sdk.values.KV<java.lang.String,​java.lang.String> decodeTimerDataTimerId​(java.lang.String timerDataTimerId)
      Decodes a string into the transform and timer family ids.
      static java.lang.String encodeToTimerDataTimerId​(java.lang.String transformId, java.lang.String timerFamilyId)
      Encodes transform and timer family ids into a single string which retains the human readable format len(transformId):transformId:timerId.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TimerReceiverFactory

        public TimerReceiverFactory​(StageBundleFactory stageBundleFactory,
                                    java.util.function.BiConsumer<org.apache.beam.sdk.util.construction.Timer<?>,​org.apache.beam.runners.core.TimerInternals.TimerData> timerDataConsumer,
                                    org.apache.beam.sdk.coders.Coder windowCoder)
    • Method Detail

      • create

        public <K> org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.construction.Timer<K>> create​(java.lang.String transformId,
                                                                                                                     java.lang.String timerFamilyId)
      • encodeToTimerDataTimerId

        public static java.lang.String encodeToTimerDataTimerId​(java.lang.String transformId,
                                                                java.lang.String timerFamilyId)
        Encodes transform and timer family ids into a single string which retains the human readable format len(transformId):transformId:timerId. See decodeTimerDataTimerId(java.lang.String) for decoding.
      • decodeTimerDataTimerId

        public static org.apache.beam.sdk.values.KV<java.lang.String,​java.lang.String> decodeTimerDataTimerId​(java.lang.String timerDataTimerId)
        Decodes a string into the transform and timer family ids. See encodeToTimerDataTimerId(java.lang.String, java.lang.String) for encoding.