dag

package
v0.0.0-...-1b9db15 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotStarted = iota
	Started
	Finished
	Failed
	UnknownStatus
)

Variables

View Source
var (
	InvalidNodeType = errors.New("invalid node type")
)
View Source
var JobReservedAttrs = map[string]int{
	"name":    1,
	"type":    1,
	"vars":    1,
	"input":   1,
	"output":  1,
	"mapper":  1,
	"reducer": 1,
	"script":  1,
	"hql":     1,
}

Functions

func ApplyVarToString

func ApplyVarToString(str string, vars map[string]string) (string, error)

Types

type Attrs

type Attrs map[string]string

func NewAttrs

func NewAttrs() Attrs

func (Attrs) Ammend

func (this Attrs) Ammend(more Attrs)

Only add missing values

func (Attrs) Extend

func (this Attrs) Extend(more Attrs)

func (Attrs) Set

func (this Attrs) Set(key string, value string)

type Builtins

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

func NewBuiltins

func NewBuiltins() *Builtins

func (*Builtins) SetBizdate

func (this *Builtins) SetBizdate(d string) error

func (*Builtins) SetJobReport

func (this *Builtins) SetJobReport(status string)

type DAG

type DAG struct {
	Name      string
	Builtins  *Builtins
	Jobs      map[string]*Job
	InDegrees map[string]int
	Relations map[string]map[string]*Relation
}

func LoadFromBytes

func LoadFromBytes(data []byte) (*DAG, error)

func LoadFromFile

func LoadFromFile(path string) (*DAG, error)

func NewDAG

func NewDAG(name string) *DAG

func (*DAG) AddJob

func (this *DAG) AddJob(job *Job)

func (*DAG) ResolveJob

func (this *DAG) ResolveJob(job *Job) error

func (*DAG) String

func (this *DAG) String() string

type DotSerializer

type DotSerializer struct{}

func NewDotSerializer

func NewDotSerializer() *DotSerializer

func (*DotSerializer) Deserialize

func (this *DotSerializer) Deserialize(data []byte) (*DAG, error)

func (*DotSerializer) Serialize

func (this *DotSerializer) Serialize(dag *DAG) ([]byte, error)

type Job

type Job struct {
	Name   string
	Type   JobType
	Status JobStatus
	Attrs  Attrs
	Prev   []string
	Post   []string
	Vars   map[string]string
}

func NewHiveJob

func NewHiveJob(name, output string) *Job

func NewJob

func NewJob() *Job

func (*Job) AddPost

func (this *Job) AddPost(name string)

func (*Job) AddPrev

func (this *Job) AddPrev(name string)

func (*Job) SetHiveHql

func (this *Job) SetHiveHql(hql string)

func (*Job) SetHiveScript

func (this *Job) SetHiveScript(script string)

func (*Job) String

func (this *Job) String() string

func (*Job) ValidateAttr

func (this *Job) ValidateAttr(keys []string) bool

type JobStatus

type JobStatus int

func ParseJobStatus

func ParseJobStatus(status string) JobStatus

func (JobStatus) String

func (status JobStatus) String() string

type JobType

type JobType int
const (
	DummyJob JobType = iota
	HadoopJob
	HiveJob
	OdpsJob
	ScriptJob
	UnknownJob
)

func ParseJobType

func ParseJobType(typ string) JobType

func (JobType) String

func (typ JobType) String() string

type Relation

type Relation struct {
	NonStrict bool
}

func NewRelation

func NewRelation() *Relation

type Serializer

type Serializer interface {
	Serialize(dag *DAG) ([]byte, error)
	Deserialize(data []byte) (*DAG, error)
}

Directories

Path Synopsis
ast

Jump to

Keyboard shortcuts

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