Interface ProcessTableFunction.Context
-
- All Known Subinterfaces:
ProcessTableFunction.OnTimerContext
- Enclosing class:
- ProcessTableFunction<T>
@PublicEvolving public static interface ProcessTableFunction.ContextContext that can be added as a first argument to the eval() method for additional information about the input tables and other services provided by the framework.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearAll()Clears the virtual partition including timers and state.voidclearAllState()Clears all state entries within the virtual partition once the eval() method returns.voidclearAllTimers()Clears all timers within the virtual partition.voidclearState(String stateName)Clears the given state entry within the virtual partition once the eval() method returns.ChangelogModegetChangelogMode()Returns theChangelogModethat the framework expects from this function.TableSemanticstableSemanticsFor(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 Detail
-
timeContext
<TimeType> ProcessTableFunction.TimeContext<TimeType> timeContext(Class<TimeType> conversionClass)
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
TableSemantics tableSemanticsFor(String argName)
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
void clearState(String stateName)
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
-
-