Skip to content

Commit

Permalink
Remove implementations in graph.go
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski committed Jan 12, 2023
1 parent 29c330d commit 4274247
Showing 1 changed file with 2 additions and 31 deletions.
33 changes: 2 additions & 31 deletions service/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"net/http"

"gonum.org/v1/gonum/graph/simple"
"gonum.org/v1/gonum/graph/topo"

"go.opentelemetry.io/collector/component"
)
Expand All @@ -33,40 +32,12 @@ type pipelinesGraph struct {
}

func (g *pipelinesGraph) StartAll(ctx context.Context, host component.Host) error {
nodes, err := topo.Sort(g.componentGraph)
if err != nil {
return err
}

// Start exporters first, and work towards receivers
for i := len(nodes) - 1; i >= 0; i-- {
comp, ok := nodes[i].(component.Component)
if !ok {
continue
}
if compErr := comp.Start(ctx, host); compErr != nil {
return compErr
}
}
// TODO actual implemenation
return nil
}

func (g *pipelinesGraph) ShutdownAll(ctx context.Context) error {
nodes, err := topo.Sort(g.componentGraph)
if err != nil {
return err
}

// Stop receivers first, and work towards exporters
for i := 0; i < len(nodes); i++ {
comp, ok := nodes[i].(component.Component)
if !ok {
continue
}
if compErr := comp.Shutdown(ctx); compErr != nil {
return compErr
}
}
// TODO actual implemenation
return nil
}

Expand Down

0 comments on commit 4274247

Please sign in to comment.