dag

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CountLookback lookback = "CountLookback"
View Source
const TimedeltaLookback lookback = "TimedeltaLookback"

Variables

This section is empty.

Functions

func LayeredTopoSort

func LayeredTopoSort(g graph.Directed) ([][]graph.Node, error)

LayeredTopoSort returns the nodes of the directed graph g grouped into layers, where each layer contains nodes that can be processed in parallel

Types

type AlgoDep

type AlgoDep struct {
	AlgoId   int64
	Lookback Lookback
}

func (AlgoDep) LookbackType

func (d AlgoDep) LookbackType() (error, lookback)

func (AlgoDep) NeedsLookback

func (d AlgoDep) NeedsLookback() bool

type Lookback

type Lookback struct {
	Count     int
	Timedelta int
}

type Node

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

Node represents an algorithm in the DAG

func (Node) AlgoDeps

func (n Node) AlgoDeps() iter.Seq[AlgoDep]

func (Node) AlgoId

func (n Node) AlgoId() int64

func (Node) ID

func (n Node) ID() int64

ID satisfies the graph.Node interface.

func (Node) LenAlgoDeps

func (n Node) LenAlgoDeps() int

type Plan

type Plan struct {
	Stages             []Stage
	AffectedProcessors []int64
}

Plan represents the full execution plan: a sequence of stages

func BuildPlan

func BuildPlan(
	algoExecPaths []string,
	windowExecPaths []string,
	procExecPaths []string,
	lookbackCounts []string,
	lookbackTimedeltas []string,
	targetWindowId int64,
) (Plan, error)

BuildPlan builds a parallel execution Plan from the DAG represented by algoExecPaths, windowExecPaths, and procExecPaths.

type ProcessorTask

type ProcessorTask struct {
	ProcId int64
	Nodes  []Node
}

ProcessorTask represents a set of tasks (nodes) assigned to a single processor

type Stage

type Stage struct {
	Tasks []ProcessorTask
}

Stage represents a set of processor tasks that can be executed in parallel

Jump to

Keyboard shortcuts

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