Skip to content

Commit

Permalink
Merge pull request #97597 from rhu713/restore-it-remove-generics
Browse files Browse the repository at this point in the history
release-22.2: backupccl: remove generic iterator
  • Loading branch information
Rui Hu authored Mar 6, 2023
2 parents 1e8e8dc + 8f49212 commit d7283d9
Show file tree
Hide file tree
Showing 10 changed files with 484 additions and 227 deletions.
1 change: 0 additions & 1 deletion pkg/ccl/backupccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ go_test(
"//pkg/testutils/sqlutils",
"//pkg/testutils/testcluster",
"//pkg/util",
"//pkg/util/bulk",
"//pkg/util/ctxgroup",
"//pkg/util/encoding",
"//pkg/util/hlc",
Expand Down
14 changes: 10 additions & 4 deletions pkg/ccl/backupccl/backup_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
"github.com/cockroachdb/cockroach/pkg/sql/sqlutil"
"github.com/cockroachdb/cockroach/pkg/sql/stats"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
"github.com/cockroachdb/cockroach/pkg/util/bulk"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/ioctx"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
Expand Down Expand Up @@ -285,9 +285,15 @@ func checkStats(

it := bm.NewStatsIter(ctx)
defer it.Close()
metaStats, err := bulk.CollectToSlice(it)
if err != nil {
t.Fatal(err)
var metaStats []*stats.TableStatisticProto

for ; ; it.Next() {
if ok, err := it.Valid(); err != nil {
t.Fatal(err)
} else if !ok {
break
}
metaStats = append(metaStats, it.Value())
}

require.Equal(t, expectedStats, metaStats)
Expand Down
2 changes: 0 additions & 2 deletions pkg/ccl/backupccl/backupinfo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ go_library(
"//pkg/sql/stats",
"//pkg/storage",
"//pkg/util",
"//pkg/util/bulk",
"//pkg/util/ctxgroup",
"//pkg/util/encoding",
"//pkg/util/hlc",
Expand Down Expand Up @@ -78,7 +77,6 @@ go_test(
"//pkg/sql/catalog/descpb",
"//pkg/testutils/serverutils",
"//pkg/testutils/testcluster",
"//pkg/util/bulk",
"//pkg/util/hlc",
"//pkg/util/leaktest",
"//pkg/util/randutil",
Expand Down
Loading

0 comments on commit d7283d9

Please sign in to comment.