server

package
v2.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 84 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcOsRelease    string = "/etc/os-release"
	UsrLibOsRelease string = "/usr/lib/os-release"
)
View Source
const (
	ContentType     = "Content-Type"
	ContentTypeJSON = "application/json"
)
View Source
const ProcessErr = "process error"
View Source
const QueryRuleId = "internal-ekuiper_query_rule"

Variables

View Source
var (
	NativeSourcePlugin   = []string{"random", "zmq", "sql", "video", "kafka"}
	NativeSinkPlugin     = []string{"image", "influx", "influx2", "zmq", "kafka", "sql"}
	NativeFunctionPlugin = []string{"accumulateWordCount", "countPlusOne", "echo", "geohash", "image", "labelImage", "tfLite"}
)

Functions

func InitConfManagers

func InitConfManagers()

func Read

func Read() (osrelease map[string]string, err error)

Read and return os-release, trying EtcOsRelease, followed by UsrLibOsRelease. err will contain an error message if neither file exists or failed to parse

func ReadFile

func ReadFile(filename string) (osrelease map[string]string, err error)

Similar to Read(), but takes the name of a file to load instead

func ReadString

func ReadString(content string) (osrelease map[string]string, err error)

ReadString is similar to Read(), but takes a string to load instead

func StartCPUProfiling

func StartCPUProfiling(ctx context.Context, cpuProfile Profiler) error

func StartUp

func StartUp(Version string)

Types

type ConfManager

type ConfManager interface {
	Import(context.Context, map[string]string) map[string]string
	PartialImport(context.Context, map[string]string) map[string]string
	Export() map[string]string
	Status() map[string]string
	Reset()
}

type Configuration

type Configuration struct {
	Streams          map[string]string `json:"streams"`
	Tables           map[string]string `json:"tables"`
	Rules            map[string]string `json:"rules"`
	NativePlugins    map[string]string `json:"nativePlugins"`
	PortablePlugins  map[string]string `json:"portablePlugins"`
	SourceConfig     map[string]string `json:"sourceConfig"`
	SinkConfig       map[string]string `json:"sinkConfig"`
	ConnectionConfig map[string]string `json:"connectionConfig"`
	Service          map[string]string `json:"Service"`
	Schema           map[string]string `json:"Schema"`
	Uploads          map[string]string `json:"uploads"`
	Scripts          map[string]string `json:"scripts"`
}

type ConnectionRequest

type ConnectionRequest struct {
	ID    string                 `json:"id"`
	Typ   string                 `json:"typ"`
	Props map[string]interface{} `json:"props"`
}

type ConnectionResponse

type ConnectionResponse struct {
	ID       string         `json:"id"`
	Typ      string         `json:"typ"`
	Props    map[string]any `json:"props"`
	IsNamed  bool           `json:"isNamed"`
	Status   string         `json:"status,omitempty"`
	Err      string         `json:"err,omitempty"`
	RefCount int            `json:"refCount,omitempty"`
}

type DatasourceExport

type DatasourceExport struct {
	SQL string `json:"sql" yaml:"sql"`
}

type ImportConfigurationStatus

type ImportConfigurationStatus struct {
	ErrorMsg       string
	ConfigResponse Configuration
}

type InstallScriptGetter

type InstallScriptGetter interface {
	InstallScript(s string) (string, string)
}

type MetaConfiguration

type MetaConfiguration struct {
	SourceConfig     map[string]map[string]any `json:"sourceConfig,omitempty" yaml:"sourceConfig,omitempty"`
	SinkConfig       map[string]map[string]any `json:"sinkConfig,omitempty" yaml:"sinkConfig,omitempty"`
	ConnectionConfig map[string]map[string]any `json:"connectionConfig,omitempty" yaml:"connectionConfig,omitempty"`
	// plugins
	NativePlugins   map[string]*plugin.IOPlugin `json:"nativePlugins,omitempty" yaml:"nativePlugins,omitempty"`
	PortablePlugins map[string]*plugin.IOPlugin `json:"portablePlugins,omitempty" yaml:"portablePlugins,omitempty"`
	// others
	Service map[string]*service.ServiceCreationRequest `json:"service,omitempty" yaml:"service,omitempty"`
	Schema  map[string]*schema.Info                    `json:"schema,omitempty" yaml:"schema,omitempty"`
	Uploads map[string]*fileContent                    `json:"uploads,omitempty" yaml:"uploads,omitempty"`
	// rules related
	Streams map[string]*DatasourceExport `json:"streams" yaml:"streams"`
	Tables  map[string]*DatasourceExport `json:"tables,omitempty" yaml:"tables,omitempty"`
	Rules   map[string]*def.Rule         `json:"rules" yaml:"rules"`
}

func GenMetaConfiguration

func GenMetaConfiguration() (*MetaConfiguration, error)

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) GetCpuUsage

func (m *Metrics) GetCpuUsage() string

func (*Metrics) GetMemoryUsage

func (m *Metrics) GetMemoryUsage() string

type Profiler

type Profiler interface {
	StartCPUProfiler(context.Context, time.Duration) error
	EnableWindowAggregator(int)
	GetWindowData() cpuprofile.DataSetAggregateMap
}

type RuleMigrationProcessor

type RuleMigrationProcessor struct {
	// contains filtered or unexported fields
}

func (*RuleMigrationProcessor) ConfigurationPartialExport

func (p *RuleMigrationProcessor) ConfigurationPartialExport(rules []string) ([]byte, error)

type RuleRegistry

type RuleRegistry struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*RuleRegistry) CreateRule

func (rr *RuleRegistry) CreateRule(name, ruleJson string) (id string, err error)

func (*RuleRegistry) DeleteRule

func (rr *RuleRegistry) DeleteRule(name string) error

func (*RuleRegistry) GetAllRuleStatus

func (rr *RuleRegistry) GetAllRuleStatus() (string, error)

func (*RuleRegistry) GetAllRulesWithStatus

func (rr *RuleRegistry) GetAllRulesWithStatus() ([]map[string]any, error)

func (*RuleRegistry) GetRuleStatus

func (rr *RuleRegistry) GetRuleStatus(name string) (string, error)

func (*RuleRegistry) GetRuleStatusV2

func (rr *RuleRegistry) GetRuleStatusV2(name string) (map[string]any, error)

func (*RuleRegistry) GetRuleTopo

func (rr *RuleRegistry) GetRuleTopo(name string) (string, error)

func (*RuleRegistry) RecoverRule

func (rr *RuleRegistry) RecoverRule(r *def.Rule) string

RecoverRule loads in imported rule. Unlike creation, 1. it suppose the rule is valid thus, it will always create the rule state in registry 2. It does not handle rule saving to db.

func (*RuleRegistry) RestartRule

func (rr *RuleRegistry) RestartRule(name string) error

func (*RuleRegistry) StartRule

func (rr *RuleRegistry) StartRule(name string) error

func (*RuleRegistry) StopRule

func (rr *RuleRegistry) StopRule(name string) error

func (*RuleRegistry) UpdateRule

func (rr *RuleRegistry) UpdateRule(ruleId, ruleJson string) error

UpdateRule validates the new rule, then update the db, then restart the rule

func (*RuleRegistry) ValidateRule

func (rr *RuleRegistry) ValidateRule(name, ruleJson string) ([]string, bool, error)

type RuleStatusMetricsValue

type RuleStatusMetricsValue int
const (
	RuleStoppedByError RuleStatusMetricsValue = -1
	RuleStopped        RuleStatusMetricsValue = 0
	RuleRunning        RuleStatusMetricsValue = 1
)

type Server

type Server int

func (*Server) CreatePlugin

func (t *Server) CreatePlugin(arg *model.PluginDesc, reply *string) error

func (*Server) CreateQuery

func (t *Server) CreateQuery(sql string, reply *string) error

func (*Server) CreateRule

func (t *Server) CreateRule(rule *model.RPCArgDesc, reply *string) error

func (*Server) CreateSchema

func (t *Server) CreateSchema(arg *model.RPCTypedArgDesc, reply *string) error

func (*Server) CreateService

func (t *Server) CreateService(arg *model.RPCArgDesc, reply *string) error

func (*Server) DescPlugin

func (t *Server) DescPlugin(arg *model.PluginDesc, reply *string) error

func (*Server) DescRule

func (t *Server) DescRule(name string, reply *string) error

func (*Server) DescSchema

func (t *Server) DescSchema(arg *model.RPCTypedArgDesc, reply *string) error

func (*Server) DescService

func (t *Server) DescService(name string, reply *string) error

func (*Server) DescServiceFunc

func (t *Server) DescServiceFunc(name string, reply *string) error

func (*Server) DescUdf

func (t *Server) DescUdf(arg string, reply *string) error

func (*Server) DropPlugin

func (t *Server) DropPlugin(arg *model.PluginDesc, reply *string) error

func (*Server) DropRule

func (t *Server) DropRule(name string, reply *string) error

func (*Server) DropSchema

func (t *Server) DropSchema(arg *model.RPCTypedArgDesc, reply *string) error

func (*Server) DropService

func (t *Server) DropService(name string, reply *string) error

func (*Server) Export

func (t *Server) Export(file string, reply *string) error

func (*Server) ExportConfiguration

func (t *Server) ExportConfiguration(arg *model.ExportDataDesc, reply *string) error

func (*Server) GetQueryResult

func (t *Server) GetQueryResult(_ string, reply *string) error

*

  • qid is not currently used.

func (*Server) GetStatusImport

func (t *Server) GetStatusImport(_ int, reply *string) error

func (*Server) GetStatusRule

func (t *Server) GetStatusRule(name string, reply *string) error

func (*Server) GetTopoRule

func (t *Server) GetTopoRule(name string, reply *string) error

func (*Server) Import

func (t *Server) Import(file string, reply *string) error

func (*Server) ImportConfiguration

func (t *Server) ImportConfiguration(arg *model.ImportDataDesc, reply *string) error

func (*Server) RegisterPlugin

func (t *Server) RegisterPlugin(arg *model.PluginDesc, reply *string) error

func (*Server) RestartRule

func (t *Server) RestartRule(name string, reply *string) error

func (*Server) ShowPlugins

func (t *Server) ShowPlugins(arg int, reply *string) error

func (*Server) ShowRules

func (t *Server) ShowRules(_ int, reply *string) error

func (*Server) ShowSchemas

func (t *Server) ShowSchemas(schemaType string, reply *string) error

func (*Server) ShowServiceFuncs

func (t *Server) ShowServiceFuncs(_ int, reply *string) error

func (*Server) ShowServices

func (t *Server) ShowServices(_ int, reply *string) error

func (*Server) ShowUdfs

func (t *Server) ShowUdfs(_ int, reply *string) error

func (*Server) StartRule

func (t *Server) StartRule(name string, reply *string) error

func (*Server) StopRule

func (t *Server) StopRule(name string, reply *string) error

func (*Server) Stream

func (t *Server) Stream(stream string, reply *string) error

func (*Server) ValidateRule

func (t *Server) ValidateRule(rule *model.RPCArgDesc, reply *string) error

type SetTracerRequest

type SetTracerRequest struct {
	ServiceName  string `json:"service_name"`
	Action       string `json:"action"`
	CollectorUrl string `json:"collector_url"`
}

type UpdateRuleStateType

type UpdateRuleStateType int
const (
	UpdateRuleState UpdateRuleStateType = iota
	UpdateRuleOffset
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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