Documentation ¶
Overview ¶
Package timers contains structs for setting pipeline timers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ProviderType represents the type of timer provider. ProviderType = reflect.TypeOf((*Provider)(nil)).Elem() )
Functions ¶
func WithOutputTimestamp ¶
WithOutputTimestamp sets the output timestamp for the timer.
Types ¶
type EventTime ¶
type EventTime struct {
Family string
}
EventTime represents the event time timer.
func InEventTime ¶
InEventTime creates and returns a new EventTime timer object.
func (EventTime) Set ¶
Set sets the timer for a event-time timestamp. Calling this method repeatedly for the same key will cause it overwrite previously set timer.
func (EventTime) Timers ¶
func (et EventTime) Timers() map[string]TimeDomain
Timers returns mapping of timer family ID and its time domain.
type PipelineTimer ¶
type PipelineTimer interface {
Timers() map[string]TimeDomain
}
PipelineTimer interface represents valid timer type.
type ProcessingTime ¶
type ProcessingTime struct {
Family string
}
ProcessingTime represents the processing time timer.
func InProcessingTime ¶
func InProcessingTime(family string) ProcessingTime
InProcessingTime creates and returns a new ProcessingTime timer object.
func (ProcessingTime) ClearTag ¶
func (pt ProcessingTime) ClearTag(p Provider, tag string)
ClearTag clears this timer for the given tag.
func (ProcessingTime) Set ¶
func (pt ProcessingTime) Set(p Provider, FiringTimestamp time.Time, opts ...timerOptions)
Set sets the timer for processing time domain. Calling this method repeatedly for the same key will cause it overwrite previously set timer.
func (ProcessingTime) Timers ¶
func (pt ProcessingTime) Timers() map[string]TimeDomain
Timers returns mapping of timer family ID and its time domain.
type Provider ¶
type Provider interface {
Set(t TimerMap)
}
Provider represents a timer provider interface.
The methods are not intended for end user use, and is subject to change.
type TimeDomain ¶
type TimeDomain int32
TimeDomain represents different time domains to set timer.
const ( // UnspecifiedTimeDomain represents unspecified time domain. UnspecifiedTimeDomain TimeDomain = 0 // EventTimeDomain is time from the perspective of the data EventTimeDomain TimeDomain = 1 // ProcessingTimeDomain is time from the perspective of the // execution of your pipeline ProcessingTimeDomain TimeDomain = 2 )