Documentation ¶
Index ¶
- Constants
- Variables
- func BuiltIns() (*interpreter.Scope, semantic.DeclarationScope)
- func DefaultFunctionSignature() semantic.FunctionSignature
- func FinalizeRegistration()
- func FmtJSON(f *formatter)
- func Formatted(q *Spec, opts ...FormatOption) fmt.Formatter
- func NumberOfOperations() int
- func RegisterBuiltIn(name, script string)
- func RegisterFunction(name string, c CreateOperationSpec, sig semantic.FunctionSignature)
- func RegisterOpSpec(k OperationKind, c NewOperationSpec)
- type Administration
- type AfterAtLeastCountTriggerSpec
- type AfterProcessingTimeTriggerSpec
- type AfterWatermarkTriggerSpec
- type Arguments
- type CreateOperationSpec
- type Domain
- type Duration
- type Edge
- type FormatOption
- type NewOperationSpec
- type Operation
- type OperationID
- type OperationKind
- type OperationSpec
- type Option
- type OrFinallyTriggerSpec
- type Priority
- type RepeatedTriggerSpec
- type ResourceManagement
- type Spec
- type TableObject
- type Time
- type TriggerKind
- type TriggerSpec
Constants ¶
const (
TableParameter = "table"
)
Variables ¶
var ( MinTime = Time{ Absolute: time.Unix(0, math.MinInt64), } MaxTime = Time{ Absolute: time.Unix(0, math.MaxInt64), } Now = Time{ IsRelative: true, } )
var DefaultTrigger = AfterWatermarkTriggerSpec{}
var TableObjectType = semantic.NewObjectType(map[string]semantic.Type{ tableIDKey: semantic.String, tableKindKey: semantic.String, tableSpecKey: semantic.EmptyObject, tableParentsKey: semantic.NewArrayType(semantic.EmptyObject), })
Functions ¶
func BuiltIns ¶ added in v0.0.6
func BuiltIns() (*interpreter.Scope, semantic.DeclarationScope)
func DefaultFunctionSignature ¶ added in v0.0.5
func DefaultFunctionSignature() semantic.FunctionSignature
DefaultFunctionSignature returns a FunctionSignature for standard functions which accept a table piped argument. It is safe to modify the returned signature.
func FinalizeRegistration ¶ added in v0.0.5
func FinalizeRegistration()
FinalizeRegistration must be called to complete registration. Future calls to RegisterFunction or RegisterBuiltIn will panic.
func NumberOfOperations ¶
func NumberOfOperations() int
func RegisterBuiltIn ¶ added in v0.0.4
func RegisterBuiltIn(name, script string)
RegisterBuiltIn adds any variable declarations in the script to the builtin scope.
func RegisterFunction ¶ added in v0.0.4
func RegisterFunction(name string, c CreateOperationSpec, sig semantic.FunctionSignature)
RegisterFunction adds a new builtin top level function.
func RegisterOpSpec ¶
func RegisterOpSpec(k OperationKind, c NewOperationSpec)
RegisterOpSpec registers an operation spec with a given kind. If the kind has already been registered the call panics.
TODO:(nathanielc) make this part of RegisterMethod/RegisterFunction
Types ¶
type Administration ¶ added in v0.0.4
type Administration struct {
// contains filtered or unexported fields
}
func (*Administration) AddParent ¶ added in v0.0.4
func (a *Administration) AddParent(np TableObject)
AddParent instructs the evaluation Context that a new edge should be created from the parent to the current operation. Duplicate parents will be removed, so the caller need not concern itself with which parents have already been added.
func (*Administration) AddParentFromArgs ¶ added in v0.0.5
func (a *Administration) AddParentFromArgs(args Arguments) error
AddParentFromArgs reads the args for the `table` argument and adds the value as a parent.
type AfterAtLeastCountTriggerSpec ¶
type AfterAtLeastCountTriggerSpec struct {
Count int
}
func (AfterAtLeastCountTriggerSpec) Kind ¶
func (AfterAtLeastCountTriggerSpec) Kind() TriggerKind
type AfterProcessingTimeTriggerSpec ¶
type AfterProcessingTimeTriggerSpec struct {
Duration Duration
}
func (AfterProcessingTimeTriggerSpec) Kind ¶
func (AfterProcessingTimeTriggerSpec) Kind() TriggerKind
type AfterWatermarkTriggerSpec ¶
type AfterWatermarkTriggerSpec struct {
AllowedLateness Duration
}
func (AfterWatermarkTriggerSpec) Kind ¶
func (AfterWatermarkTriggerSpec) Kind() TriggerKind
type Arguments ¶ added in v0.0.4
type Arguments struct {
interpreter.Arguments
}
func (Arguments) GetDuration ¶ added in v0.0.4
func (Arguments) GetRequiredDuration ¶ added in v0.0.4
func (Arguments) GetRequiredTime ¶ added in v0.0.4
type CreateOperationSpec ¶
type CreateOperationSpec func(args Arguments, a *Administration) (OperationSpec, error)
type Domain ¶ added in v0.0.6
type Domain interface { interpreter.Domain ToSpec() *Spec }
type Duration ¶
Duration is a marshalable duration type. TODO make this the real duration parsing not just time.ParseDuration
func (Duration) MarshalText ¶
func (*Duration) UnmarshalText ¶
type Edge ¶
type Edge struct { Parent OperationID `json:"parent"` Child OperationID `json:"child"` }
Edge is a data flow relationship between a parent and a child
type FormatOption ¶
type FormatOption func(*formatter)
TODO(nathanielc): Add better options for formatting plans as Graphviz dot format.
type NewOperationSpec ¶ added in v0.0.4
type NewOperationSpec func() OperationSpec
type Operation ¶
type Operation struct { ID OperationID `json:"id"` Spec OperationSpec `json:"spec"` }
Operation denotes a single operation in a query.
func (Operation) MarshalJSON ¶
func (*Operation) UnmarshalJSON ¶
type OperationID ¶
type OperationID string
OperationID is a unique ID within a query for the operation.
type OperationSpec ¶
type OperationSpec interface { // Kind returns the kind of the operation. Kind() OperationKind }
OperationSpec specifies an operation as part of a query.
type OrFinallyTriggerSpec ¶
type OrFinallyTriggerSpec struct { Main TriggerSpec Finally TriggerSpec }
func (OrFinallyTriggerSpec) Kind ¶
func (OrFinallyTriggerSpec) Kind() TriggerKind
type Priority ¶ added in v0.0.3
type Priority int32
Priority is an integer that represents the query priority. Any positive 32bit integer value may be used. Special constants are provided to represent the extreme high and low priorities.
func (Priority) MarshalText ¶ added in v0.0.3
func (*Priority) UnmarshalText ¶ added in v0.0.3
type RepeatedTriggerSpec ¶
type RepeatedTriggerSpec struct {
Trigger TriggerSpec
}
func (RepeatedTriggerSpec) Kind ¶
func (RepeatedTriggerSpec) Kind() TriggerKind
type ResourceManagement ¶ added in v0.0.3
type ResourceManagement struct { // Priority or the query. // Queries with a lower value will move to the front of the priority queue. // A zero value indicates the highest priority. Priority Priority `json:"priority"` // ConcurrencyQuota is the number of concurrency workers allowed to process this query. // A zero value indicates the planner can pick the optimal concurrency. ConcurrencyQuota int `json:"concurrency_quota"` // MemoryBytesQuota is the number of bytes of RAM this query may consume. // There is a small amount of overhead memory being consumed by a query that will not be counted towards this limit. // A zero value indicates unlimited. MemoryBytesQuota int64 `json:"memory_bytes_quota"` }
ResourceManagement defines how the query should consume avaliable resources.
type Spec ¶ added in v0.0.4
type Spec struct { Operations []*Operation `json:"operations"` Edges []Edge `json:"edges"` Resources ResourceManagement `json:"resources"` // contains filtered or unexported fields }
Spec specifies a query.
func (*Spec) Children ¶ added in v0.0.4
func (q *Spec) Children(id OperationID) []*Operation
Children returns a list of children for a given operation. If the query is invalid no children will be returned.
func (*Spec) Functions ¶ added in v0.0.4
Functions return the names of all functions used in the plan
func (*Spec) Parents ¶ added in v0.0.4
func (q *Spec) Parents(id OperationID) []*Operation
Parents returns a list of parents for a given operation. If the query is invalid no parents will be returned.
type TableObject ¶ added in v0.0.6
type TableObject struct {
interpreter.Object
}
func NewTableObject ¶ added in v0.0.6
func NewTableObject(t interpreter.Object) (TableObject, error)
func (TableObject) ID ¶ added in v0.0.6
func (t TableObject) ID() OperationID
func (TableObject) Kind ¶ added in v0.0.6
func (t TableObject) Kind() OperationKind
func (TableObject) Operation ¶ added in v0.0.6
func (t TableObject) Operation() *Operation
func (TableObject) Spec ¶ added in v0.0.6
func (t TableObject) Spec() OperationSpec
func (TableObject) String ¶ added in v0.0.6
func (t TableObject) String() string
func (TableObject) ToSpec ¶ added in v0.0.6
func (t TableObject) ToSpec() *Spec
type Time ¶
Time represents either a relavite or absolute time. If Time is its zero value then it represents a time.Time{}. To represent the now time you must set IsRelative to true.
func ToQueryTime ¶ added in v0.0.4
func ToQueryTime(value interpreter.Value) (Time, error)
func (Time) MarshalText ¶
func (*Time) UnmarshalText ¶
type TriggerKind ¶
type TriggerKind int
const ( AfterWatermark TriggerKind = iota Repeated AfterProcessingTime AfterAtLeastCount OrFinally )
type TriggerSpec ¶
type TriggerSpec interface {
Kind() TriggerKind
}