graph

package
v0.0.0-...-9e48b22 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	sync.RWMutex
	NumOfSuccess  int
	VertexCount   int
	Size          int
	VertexArray   []*Vertex
	AdjMatrix     []int
	DynamicJobCnt int
}

func NewGraph

func NewGraph(size int) *Graph

func (*Graph) AddDynamicJobCnt

func (g *Graph) AddDynamicJobCnt(cnt int)

func (*Graph) AddVertex

func (g *Graph) AddVertex(Vertex *Vertex)

func (*Graph) CheckCycle

func (g *Graph) CheckCycle(checkEnd int) (bool, []int)

func (*Graph) DFS

func (g *Graph) DFS(stack *list.List, onStack map[int]bool, visited map[int]bool) error

func (*Graph) DirectedTraverse

func (g *Graph) DirectedTraverse(start int) ([]int, error)

func (*Graph) FindChildren

func (g *Graph) FindChildren(vertex int) []int

func (*Graph) FindChildrenByName

func (g *Graph) FindChildrenByName(jobName string) []*Vertex

func (*Graph) FindDependents

func (g *Graph) FindDependents(vertex int) []int

func (*Graph) FindDependentsByName

func (g *Graph) FindDependentsByName(jobName string) []int

func (*Graph) FindVertex

func (g *Graph) FindVertex(vertex int) *Vertex

func (*Graph) FindVertexByName

func (g *Graph) FindVertexByName(jobName string) *Vertex

func (*Graph) GetNumOfSuccess

func (g *Graph) GetNumOfSuccess() int

func (*Graph) GetRootVertex

func (g *Graph) GetRootVertex() []*Vertex

func (*Graph) IsDAG

func (g *Graph) IsDAG() bool

func (*Graph) PlusNumOfSuccess

func (g *Graph) PlusNumOfSuccess()

func (*Graph) SetAdjMatrix

func (g *Graph) SetAdjMatrix() bool

type JobInfo

type JobInfo struct {
	Finished   bool
	Job        *batch.Job
	TaskType   genev1alpha1.TaskType
	DynamicJob *genev1alpha1.Task
}

JobInfo stores job information for running

func NewJobInfo

func NewJobInfo(job *batch.Job, finished bool, taskType genev1alpha1.TaskType, dynamicJob *genev1alpha1.Task) *JobInfo

type Vertex

type Vertex struct {
	Data     *JobInfo
	Children []*Vertex
	// contains filtered or unexported fields
}

func NewVertex

func NewVertex(data *JobInfo, flag bool, children ...*Vertex) *Vertex

func (*Vertex) AddChild

func (n *Vertex) AddChild(vertex *Vertex)

func (*Vertex) GetDynamicJobCnt

func (n *Vertex) GetDynamicJobCnt() int

func (*Vertex) GetDynamicSuccJobCnt

func (n *Vertex) GetDynamicSuccJobCnt() int

func (*Vertex) IncDynamicJobSuccCnt

func (n *Vertex) IncDynamicJobSuccCnt()

func (*Vertex) IsDynamic

func (n *Vertex) IsDynamic() bool

func (*Vertex) SetDynamicJobCnt

func (n *Vertex) SetDynamicJobCnt(cnt int)

Jump to

Keyboard shortcuts

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