Skip to content

Commit

Permalink
scstage: rename package import
Browse files Browse the repository at this point in the history
For no good reason, scgraph was imported as scgraph2. This commit fixes
this.

Release note: None
  • Loading branch information
Marius Posta committed Apr 11, 2022
1 parent 3c9a373 commit 6d0d912
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/sql/schemachanger/scplan/internal/scstage/stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop"
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb"
scgraph2 "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph"
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph"
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl"
"github.com/cockroachdb/errors"
)
Expand Down Expand Up @@ -75,7 +75,7 @@ func (s Stage) String() string {
}

// ValidateStages checks that the plan is valid.
func ValidateStages(ts scpb.TargetState, stages []Stage, g *scgraph2.Graph) error {
func ValidateStages(ts scpb.TargetState, stages []Stage, g *scgraph.Graph) error {
if len(stages) == 0 {
return nil
}
Expand Down Expand Up @@ -141,9 +141,9 @@ func validateAdjacentStagesStates(previous, next Stage) error {
return nil
}

func validateStageSubgraph(ts scpb.TargetState, stage Stage, g *scgraph2.Graph) error {
func validateStageSubgraph(ts scpb.TargetState, stage Stage, g *scgraph.Graph) error {
// Transform the ops in a non-repeating sequence of their original op edges.
var queue []*scgraph2.OpEdge
var queue []*scgraph.OpEdge
for _, op := range stage.EdgeOps {
oe := g.GetOpEdgeFromOp(op)
if oe == nil {
Expand All @@ -169,8 +169,8 @@ func validateStageSubgraph(ts scpb.TargetState, stage Stage, g *scgraph2.Graph)
current[i] = n
}
{
edgesTo := make(map[*screl.Node][]scgraph2.Edge, g.Order())
_ = g.ForEachEdge(func(e scgraph2.Edge) error {
edgesTo := make(map[*screl.Node][]scgraph.Edge, g.Order())
_ = g.ForEachEdge(func(e scgraph.Edge) error {
edgesTo[e.To()] = append(edgesTo[e.To()], e)
return nil
})
Expand Down Expand Up @@ -211,7 +211,7 @@ func validateStageSubgraph(ts scpb.TargetState, stage Stage, g *scgraph2.Graph)

// Prevent making progress on this target if there are unmet dependencies.
var hasUnmetDeps bool
if err := g.ForEachDepEdgeTo(oe.To(), func(de *scgraph2.DepEdge) error {
if err := g.ForEachDepEdgeTo(oe.To(), func(de *scgraph.DepEdge) error {
hasUnmetDeps = hasUnmetDeps || !fulfilled[de.From()]
return nil
}); err != nil {
Expand Down

0 comments on commit 6d0d912

Please sign in to comment.