def

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SchemaTypes = []SchemaType{
	PROTOBUF,
	CUSTOM,
}

Functions

This section is empty.

Types

type GraphNode

type GraphNode struct {
	Type     string                 `json:"type" yaml:"type"`
	NodeType string                 `json:"nodeType" yaml:"nodeType"`
	Props    map[string]interface{} `json:"props" yaml:"props"`
	// UI is a placeholder for ui properties
	UI map[string]interface{} `json:"ui" yaml:"ui"`
}

type OptimizeControl added in v2.2.0

type OptimizeControl struct {
	DisableOptimizeRules []string `json:"disableOptimizeRules" yaml:"disableOptimizeRules"`
}

func (*OptimizeControl) IsOptimizeEnabled added in v2.2.0

func (oc *OptimizeControl) IsOptimizeEnabled(name string) bool

type PlanOptimizeStrategy added in v2.1.0

type PlanOptimizeStrategy struct {
	EnableIncrementalWindow bool             `json:"enableIncrementalWindow" yaml:"enableIncrementalWindow"`
	EnableAliasPushdown     bool             `json:"enableAliasPushdown,omitempty" yaml:"enableAliasPushdown,omitempty"`
	DisableAliasRefCal      bool             `json:"disableAliasRefCal,omitempty" yaml:"disableAliasRefCal,omitempty"`
	OptimizeControl         *OptimizeControl `json:"optimizeControl,omitempty" yaml:"optimizeControl,omitempty"`
	WindowOption            *WindowOption    `json:"windowOption,omitempty" yaml:"windowOption,omitempty"`
}

func (*PlanOptimizeStrategy) IsAliasRefCalEnable added in v2.1.0

func (p *PlanOptimizeStrategy) IsAliasRefCalEnable() bool

func (*PlanOptimizeStrategy) IsOptimizeEnabled added in v2.2.0

func (p *PlanOptimizeStrategy) IsOptimizeEnabled(name string) bool

func (*PlanOptimizeStrategy) IsSlidingWindowSendTwiceEnable added in v2.2.0

func (p *PlanOptimizeStrategy) IsSlidingWindowSendTwiceEnable() bool

type PrintableTopo

type PrintableTopo struct {
	Sources []string                 `json:"sources" yaml:"sources"`
	Edges   map[string][]interface{} `json:"edges" yaml:"edges"`
}

type Qos

type Qos int
const (
	AtMostOnce Qos = iota
	AtLeastOnce
	ExactlyOnce
)

type RestartStrategy

type RestartStrategy struct {
	Attempts     int               `json:"attempts,omitempty" yaml:"attempts,omitempty"`
	Delay        cast.DurationConf `json:"delay,omitempty" yaml:"delay,omitempty"`
	Multiplier   float64           `json:"multiplier,omitempty" yaml:"multiplier,omitempty"`
	MaxDelay     cast.DurationConf `json:"maxDelay,omitempty" yaml:"maxDelay,omitempty"`
	JitterFactor float64           `json:"jitterFactor,omitempty" yaml:"jitterFactor,omitempty"`
}

type Rule

type Rule struct {
	Triggered bool                     `json:"triggered" yaml:"triggered"`
	Id        string                   `json:"id,omitempty" yaml:"id,omitempty"`
	Name      string                   `json:"name,omitempty" yaml:"name,omitempty"`       // The display name of a rule
	Version   string                   `json:"version,omitempty" yaml:"version,omitempty"` // The display name of a rule
	Sql       string                   `json:"sql,omitempty" yaml:"sql,omitempty"`
	Graph     *RuleGraph               `json:"graph,omitempty" yaml:"graph,omitempty"`
	Actions   []map[string]interface{} `json:"actions,omitempty" yaml:"actions,omitempty"`
	Options   *RuleOption              `json:"options,omitempty" yaml:"options,omitempty"`
	Tags      []string                 `json:"tags,omitempty" yaml:"tags,omitempty"`
}

Rule the definition of the business logic Sql and Graph are mutually exclusive, at least one of them should be set

func GetDefaultRule

func GetDefaultRule(name, sql string) *Rule

func (*Rule) GetNextScheduleStartTime

func (r *Rule) GetNextScheduleStartTime() int64

func (*Rule) IsDurationRule added in v2.2.0

func (r *Rule) IsDurationRule() bool

func (*Rule) IsScheduleRule

func (r *Rule) IsScheduleRule() bool

func (*Rule) IsTagsMatch added in v2.2.0

func (r *Rule) IsTagsMatch(tags []string) bool

type RuleGraph

type RuleGraph struct {
	Nodes map[string]*GraphNode `json:"nodes" yaml:"nodes"`
	Topo  *PrintableTopo        `json:"topo" yaml:"topo"`
}

type RuleOption

type RuleOption struct {
	Debug                     bool                     `json:"debug" yaml:"debug"`
	LogFilename               string                   `json:"logFilename,omitempty" yaml:"logFilename,omitempty"`
	IsEventTime               bool                     `json:"isEventTime" yaml:"isEventTime"`
	LateTol                   cast.DurationConf        `json:"lateTolerance,omitempty" yaml:"lateTolerance,omitempty"`
	Concurrency               int                      `json:"concurrency" yaml:"concurrency"`
	BufferLength              int                      `json:"bufferLength" yaml:"bufferLength"`
	SendMetaToSink            bool                     `json:"sendMetaToSink" yaml:"sendMetaToSink"`
	SendNil                   bool                     `json:"sendNilField" yaml:"sendNilField"`
	SendError                 bool                     `json:"sendError" yaml:"sendError"`
	Qos                       Qos                      `json:"qos,omitempty" yaml:"qos,omitempty"`
	CheckpointInterval        cast.DurationConf        `json:"checkpointInterval,omitempty" yaml:"checkpointInterval,omitempty"`
	RestartStrategy           *RestartStrategy         `json:"restartStrategy,omitempty" yaml:"restartStrategy,omitempty"`
	Cron                      string                   `json:"cron,omitempty" yaml:"cron,omitempty"`
	Duration                  string                   `json:"duration,omitempty" yaml:"duration,omitempty"`
	CronDatetimeRange         []schedule.DatetimeRange `json:"cronDatetimeRange,omitempty" yaml:"cronDatetimeRange,omitempty"`
	PlanOptimizeStrategy      *PlanOptimizeStrategy    `json:"planOptimizeStrategy,omitempty" yaml:"planOptimizeStrategy,omitempty"`
	NotifySub                 bool                     `json:"notifySub,omitempty" yaml:"notifySub,omitempty"`
	DisableBufferFullDiscard  bool                     `json:"disableBufferFullDiscard,omitempty" yaml:"disableBufferFullDiscard,omitempty"`
	EnableSaveStateBeforeStop bool                     `json:"enableSaveStateBeforeStop,omitempty" yaml:"enableSaveStateBeforeStop,omitempty"`
}

type SchemaType

type SchemaType string
const (
	PROTOBUF SchemaType = "protobuf"
	CUSTOM   SchemaType = "custom"
)

type SourceMeta

type SourceMeta struct {
	SourceName string `json:"sourceName"` // the name of the stream or table
	SourceType string `json:"sourceType"` // stream or table
}

SourceMeta is the metadata of a source node. It describes what existed stream/table to refer to. It is part of the Props in the GraphNode and it is optional

type WindowOption added in v2.2.0

type WindowOption struct {
	EnableSendSlidingWindowTwice bool `json:"enableSendSlidingWindowTwice,omitempty" yaml:"enableSendSlidingWindowTwice,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL