Interface EventExaminer<EventT,StateT extends MutableState<EventT,?>>
- Type Parameters:
EventT
-StateT
-
- All Superinterfaces:
Serializable
Classes extending this interface will be called by
OrderedEventProcessor
to examine every
incoming event.-
Method Summary
Modifier and TypeMethodDescriptioncreateStateOnInitialEvent
(EventT event) If the event was the first event for a given key, create the state to hold the required data needed for processing.boolean
isInitialEvent
(long sequenceNumber, EventT event) Is this event the first expected event for the given key and window if the per key sequence is used? In case of global sequence it determines the first global sequence event.boolean
isLastEvent
(long sequenceNumber, EventT event) Is this event the last expected event for a given key and window?
-
Method Details
-
isInitialEvent
Is this event the first expected event for the given key and window if the per key sequence is used? In case of global sequence it determines the first global sequence event.- Parameters:
sequenceNumber
- the sequence number of the event as defined by the key of the input PCollection toOrderedEventProcessor
event
- being processed- Returns:
- true if this is the initial sequence.
-
createStateOnInitialEvent
If the event was the first event for a given key, create the state to hold the required data needed for processing. This data will be persisted in a Beam state.- Parameters:
event
- the first event in the sequence.- Returns:
- the state to persist.
-
isLastEvent
Is this event the last expected event for a given key and window?Note, this method is not used yet with global sequences.
- Parameters:
sequenceNumber
- of the eventevent
- being processed- Returns:
- true if the last event. There are cases where it's impossible to know whether it's the last event. False should be returned in those cases.
-