Interface ProcessTableFunction.Context
- All Known Subinterfaces:
ProcessTableFunction.OnTimerContext
- Enclosing class:
- ProcessTableFunction<T>
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearAll()Clears the virtual partition including timers and state.voidClears all state entries within the virtual partition once the eval() method returns.voidClears all timers within the virtual partition.voidclearState(String stateName) Clears the given state entry within the virtual partition once the eval() method returns.Returns theChangelogModethat the framework expects from this function.tableSemanticsFor(String argName) Returns additional information about the semantics of a table argument.<TimeType> ProcessTableFunction.TimeContext<TimeType>timeContext(Class<TimeType> conversionClass) Returns a specializedProcessTableFunction.TimeContextto work with time and timers.
-
Method Details
-
timeContext
Returns a specializedProcessTableFunction.TimeContextto work with time and timers.Time and timer timestamps can be represented as either
Instant,LocalDateTime, orLong. Time and timers are based on milliseconds since epoch and do not take the local session timezone into consideration.Note: A timer context is always scoped under the currently processed event (either the current input row or a firing timer).
- Parameters:
conversionClass- representation of time and timer timestamps- Returns:
- the context for time and timer services
-
tableSemanticsFor
Returns additional information about the semantics of a table argument.- Parameters:
argName- name of the table argument; either reflectively extracted or manually defined viaArgumentHint.name().
-
clearState
Clears the given state entry within the virtual partition once the eval() method returns.Semantically this is equal to setting all fields of the state entry to null shortly before the eval() method returns.
- Parameters:
stateName- name of the state entry; either reflectively extracted or manually defined viaStateHint.name().
-
clearAllState
void clearAllState()Clears all state entries within the virtual partition once the eval() method returns.Semantically, this is equal to calling
clearState(String)on all state entries. -
clearAllTimers
void clearAllTimers()Clears all timers within the virtual partition. -
clearAll
void clearAll()Clears the virtual partition including timers and state. -
getChangelogMode
ChangelogMode getChangelogMode()Returns theChangelogModethat the framework expects from this function.By default, a PTF can only emit insert-only (append-only) changes and this method will therefore return
ChangelogMode.insertOnly(). If the PTF needs to emit update or delete changes, it should implementChangelogFunction.- Returns:
- the produced
ChangelogMode
-