scheduler

package
v0.0.0-...-98ba599 Latest Latest
Warning

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

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

Documentation

Overview

Package scheduler is a generated protocol buffer package.

It is generated from these files:

pkg/scheduler/scheduler.proto

It has these top-level messages:

Schedule
AbortAction
RunTaskAction
PrepareTaskAction

Index

Constants

This section is empty.

Variables

View Source
var DefaultPolicy = NewHorizonPolicy()

Functions

func RegisterSchedulerServer

func RegisterSchedulerServer(s *grpc.Server, srv SchedulerServer)

Types

type AbortAction

type AbortAction struct {
	Reason string `protobuf:"bytes,1,opt,name=reason" json:"reason,omitempty"`
}

func (*AbortAction) Descriptor

func (*AbortAction) Descriptor() ([]byte, []int)

func (*AbortAction) GetReason

func (m *AbortAction) GetReason() string

func (*AbortAction) ProtoMessage

func (*AbortAction) ProtoMessage()

func (*AbortAction) Reset

func (m *AbortAction) Reset()

func (*AbortAction) String

func (m *AbortAction) String() string

type HorizonPolicy

type HorizonPolicy struct {
}

HorizonPolicy is the default policy of the workflow engine. It solely schedules tasks that are on the scheduling horizon.

The scheduling horizon is the set of tasks that only depend on tasks that have already completed. If a task has failed this policy simply fails the workflow

func NewHorizonPolicy

func NewHorizonPolicy() *HorizonPolicy

func (*HorizonPolicy) Evaluate

func (p *HorizonPolicy) Evaluate(invocation *types.WorkflowInvocation) (*Schedule, error)

type InvocationScheduler

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

func NewInvocationScheduler

func NewInvocationScheduler(policy Policy) *InvocationScheduler

func (*InvocationScheduler) Evaluate

func (ws *InvocationScheduler) Evaluate(invocation *types.WorkflowInvocation) (*Schedule, error)

type Policy

type Policy interface {
	Evaluate(invocation *types.WorkflowInvocation) (*Schedule, error)
}

type PrepareTaskAction

type PrepareTaskAction struct {
	TaskID     string                     `protobuf:"bytes,1,opt,name=taskID" json:"taskID,omitempty"`
	ExpectedAt *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=expectedAt" json:"expectedAt,omitempty"`
}

func (*PrepareTaskAction) Descriptor

func (*PrepareTaskAction) Descriptor() ([]byte, []int)

func (*PrepareTaskAction) GetExpectedAt

func (m *PrepareTaskAction) GetExpectedAt() *google_protobuf.Timestamp

func (*PrepareTaskAction) GetExpectedAtTime

func (m *PrepareTaskAction) GetExpectedAtTime() time.Time

func (*PrepareTaskAction) GetTaskID

func (m *PrepareTaskAction) GetTaskID() string

func (*PrepareTaskAction) ProtoMessage

func (*PrepareTaskAction) ProtoMessage()

func (*PrepareTaskAction) Reset

func (m *PrepareTaskAction) Reset()

func (*PrepareTaskAction) String

func (m *PrepareTaskAction) String() string

type PrewarmAllPolicy

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

PrewarmAllPolicy is the policy with the most aggressive form of prewarming.

The policy, like the HorizonPolicy, schedules all tasks on the scheduling horizon optimistically. Similarly, it also fails workflow invocations immediately if a task has failed

However, on top of the HorizonPolicy, this policy prewarms tasks aggressively. Any unstarted task not on the scheduling horizon will be prewarmed.

This policy does not try to infer runtimes or cold starts; instead, it prewarms with a static duration.

func NewPrewarmAllPolicy

func NewPrewarmAllPolicy(coldstartDuration time.Duration) *PrewarmAllPolicy

func (*PrewarmAllPolicy) Evaluate

func (p *PrewarmAllPolicy) Evaluate(invocation *types.WorkflowInvocation) (*Schedule, error)

type PrewarmHorizonPolicy

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

PrewarmHorizonPolicy is the policy with the most aggressive form of prewarming.

The policy, like the HorizonPolicy, schedules all tasks on the scheduling horizon optimistically. Similarly, it also fails workflow invocations immediately if a task has failed

However, on top of the HorizonPolicy, tries to policy prewarms tasks aggressively. Any unstarted task on the prewarm horizon will be prewarmed.

This policy does not try to infer runtimes or cold starts; instead, it prewarms with a static duration.

func NewPrewarmHorizonPolicy

func NewPrewarmHorizonPolicy(coldstartDuration time.Duration) *PrewarmHorizonPolicy

func (*PrewarmHorizonPolicy) Evaluate

func (p *PrewarmHorizonPolicy) Evaluate(invocation *types.WorkflowInvocation) (*Schedule, error)

type RunTaskAction

type RunTaskAction struct {
	// Id of the task in the workflow
	TaskID string `protobuf:"bytes,1,opt,name=taskID" json:"taskID,omitempty"`
}

func (*RunTaskAction) Descriptor

func (*RunTaskAction) Descriptor() ([]byte, []int)

func (*RunTaskAction) GetTaskID

func (m *RunTaskAction) GetTaskID() string

func (*RunTaskAction) ProtoMessage

func (*RunTaskAction) ProtoMessage()

func (*RunTaskAction) Reset

func (m *RunTaskAction) Reset()

func (*RunTaskAction) String

func (m *RunTaskAction) String() string

type Schedule

type Schedule struct {
	InvocationId string                     `protobuf:"bytes,1,opt,name=invocationId" json:"invocationId,omitempty"`
	CreatedAt    *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=createdAt" json:"createdAt,omitempty"`
	Abort        *AbortAction               `protobuf:"bytes,4,opt,name=abort" json:"abort,omitempty"`
	RunTasks     []*RunTaskAction           `protobuf:"bytes,5,rep,name=runTasks" json:"runTasks,omitempty"`
	PrepareTasks []*PrepareTaskAction       `protobuf:"bytes,6,rep,name=prepareTasks" json:"prepareTasks,omitempty"`
}

func (*Schedule) Actions

func (m *Schedule) Actions() (actions []interface{})

func (*Schedule) AddPrepareTask

func (m *Schedule) AddPrepareTask(action *PrepareTaskAction)

func (*Schedule) AddRunTask

func (m *Schedule) AddRunTask(action *RunTaskAction)

func (*Schedule) Descriptor

func (*Schedule) Descriptor() ([]byte, []int)

func (*Schedule) GetAbort

func (m *Schedule) GetAbort() *AbortAction

func (*Schedule) GetCreatedAt

func (m *Schedule) GetCreatedAt() *google_protobuf.Timestamp

func (*Schedule) GetInvocationId

func (m *Schedule) GetInvocationId() string

func (*Schedule) GetPrepareTasks

func (m *Schedule) GetPrepareTasks() []*PrepareTaskAction

func (*Schedule) GetRunTasks

func (m *Schedule) GetRunTasks() []*RunTaskAction

func (*Schedule) ProtoMessage

func (*Schedule) ProtoMessage()

func (*Schedule) Reset

func (m *Schedule) Reset()

func (*Schedule) String

func (m *Schedule) String() string

type SchedulerClient

type SchedulerClient interface {
	Evaluate(ctx context.Context, in *fission_workflows_types1.WorkflowInvocation, opts ...grpc.CallOption) (*Schedule, error)
}

func NewSchedulerClient

func NewSchedulerClient(cc *grpc.ClientConn) SchedulerClient

type SchedulerServer

type SchedulerServer interface {
	Evaluate(context.Context, *fission_workflows_types1.WorkflowInvocation) (*Schedule, error)
}

Jump to

Keyboard shortcuts

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