Skip to content

Commit

Permalink
colexecbase: rename to colexecop
Browse files Browse the repository at this point in the history
This commit renames `colexecbase` package to `colexecop` since latter
better reflect its purpose.

Release note: None
  • Loading branch information
yuzefovich committed Feb 24, 2021
1 parent 0ff2475 commit a9b582f
Show file tree
Hide file tree
Showing 194 changed files with 1,548 additions and 1,554 deletions.
2 changes: 1 addition & 1 deletion pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ ALL_TESTS = [
"//pkg/sql/colexec/colexecwindow:colexecwindow_test",
"//pkg/sql/colexec/execgen:execgen_test",
"//pkg/sql/colexec:colexec_test",
"//pkg/sql/colexecbase:colexecbase_test",
"//pkg/sql/colexecerror:colexecerror_test",
"//pkg/sql/colexecop:colexecop_test",
"//pkg/sql/colflow/colrpc:colrpc_test",
"//pkg/sql/colflow:colflow_test",
"//pkg/sql/colmem:colmem_test",
Expand Down
2 changes: 1 addition & 1 deletion pkg/col/coldatatestutils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/col/coldata",
"//pkg/sql/colexecbase",
"//pkg/sql/colexecerror",
"//pkg/sql/colexecop",
"//pkg/sql/colmem",
"//pkg/sql/execinfra",
"//pkg/sql/rowenc",
Expand Down
4 changes: 2 additions & 2 deletions pkg/col/coldatatestutils/random_testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"time"

"github.com/cockroachdb/cockroach/pkg/col/coldata"
"github.com/cockroachdb/cockroach/pkg/sql/colexecbase"
"github.com/cockroachdb/cockroach/pkg/sql/colexecerror"
"github.com/cockroachdb/cockroach/pkg/sql/colexecop"
"github.com/cockroachdb/cockroach/pkg/sql/colmem"
"github.com/cockroachdb/cockroach/pkg/sql/execinfra"
"github.com/cockroachdb/cockroach/pkg/sql/rowenc"
Expand Down Expand Up @@ -321,7 +321,7 @@ type RandomDataOp struct {
nulls bool
}

var _ colexecbase.Operator = &RandomDataOp{}
var _ colexecop.Operator = &RandomDataOp{}

// NewRandomDataOp creates a new RandomDataOp.
func NewRandomDataOp(
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ go_library(
"//pkg/sql/catalog/tabledesc",
"//pkg/sql/catalog/typedesc",
"//pkg/sql/colexec",
"//pkg/sql/colexecbase",
"//pkg/sql/colexecerror",
"//pkg/sql/colexecop",
"//pkg/sql/colflow",
"//pkg/sql/contention",
"//pkg/sql/covering",
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/colcontainer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ go_test(
"//pkg/col/coldataext",
"//pkg/col/coldatatestutils",
"//pkg/settings/cluster",
"//pkg/sql/colexecbase",
"//pkg/sql/colexecop",
"//pkg/sql/colmem",
"//pkg/sql/execinfra",
"//pkg/sql/pgwire/pgcode",
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/colcontainer/diskqueue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/col/coldata"
"github.com/cockroachdb/cockroach/pkg/col/coldatatestutils"
"github.com/cockroachdb/cockroach/pkg/sql/colcontainer"
"github.com/cockroachdb/cockroach/pkg/sql/colexecbase"
"github.com/cockroachdb/cockroach/pkg/sql/colexecop"
"github.com/cockroachdb/cockroach/pkg/sql/execinfra"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror"
Expand Down Expand Up @@ -231,7 +231,7 @@ func BenchmarkDiskQueue(b *testing.B) {
rng, _ := randutil.NewPseudoRand()
typs := []*types.T{types.Int}
batch := coldatatestutils.RandomBatch(testAllocator, rng, typs, coldata.BatchSize(), 0, 0)
op := colexecbase.NewRepeatableBatchSource(testAllocator, batch, typs)
op := colexecop.NewRepeatableBatchSource(testAllocator, batch, typs)
ctx := context.Background()
for i := 0; i < b.N; i++ {
op.ResetBatchesToReturn(numBatches)
Expand Down
8 changes: 4 additions & 4 deletions pkg/sql/colcontainer/partitionedqueue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/cockroachdb/cockroach/pkg/col/coldata"
"github.com/cockroachdb/cockroach/pkg/sql/colcontainer"
"github.com/cockroachdb/cockroach/pkg/sql/colexecbase"
"github.com/cockroachdb/cockroach/pkg/sql/colexecop"
"github.com/cockroachdb/cockroach/pkg/sql/types"
"github.com/cockroachdb/cockroach/pkg/storage/fs"
"github.com/cockroachdb/cockroach/pkg/testutils/colcontainerutils"
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestPartitionedDiskQueue(t *testing.T) {
ctx = context.Background()
typs = []*types.T{types.Int}
batch = testAllocator.NewMemBatchWithMaxCapacity(typs)
sem = &colexecbase.TestingSemaphore{}
sem = &colexecop.TestingSemaphore{}
)
batch.SetLength(coldata.BatchSize())

Expand Down Expand Up @@ -170,7 +170,7 @@ func TestPartitionedDiskQueueSimulatedExternal(t *testing.T) {
// maxPartitions+1 are created. The +1 is the file descriptor of the
// new partition being written to when closedForWrites from maxPartitions
// and writing the merged result to a single new partition.
sem := colexecbase.NewTestingSemaphore(maxPartitions + 1)
sem := colexecop.NewTestingSemaphore(maxPartitions + 1)
p := colcontainer.NewPartitionedDiskQueue(typs, queueCfg, sem, colcontainer.PartitionerStrategyCloseOnNewPartition, testDiskAcc)

// Define sortRepartition to be able to call this helper function
Expand Down Expand Up @@ -250,7 +250,7 @@ func TestPartitionedDiskQueueSimulatedExternal(t *testing.T) {
// The limit for a hash join is maxPartitions + 2. maxPartitions is the
// number of partitions partitioned to and 2 represents the file descriptors
// for the left and right side in the case of a repartition.
sem := colexecbase.NewTestingSemaphore(maxPartitions + 2)
sem := colexecop.NewTestingSemaphore(maxPartitions + 2)
p := colcontainer.NewPartitionedDiskQueue(typs, queueCfg, sem, colcontainer.PartitionerStrategyDefault, testDiskAcc)

// joinRepartition will perform the partitioning that happens during a hash
Expand Down
6 changes: 3 additions & 3 deletions pkg/sql/colexec/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//pkg/sql/colexecbase:EXECGEN.bzl", "eg_go_filegroup", "gen_eg_go_rules")
load("//pkg/sql/colexecop:EXECGEN.bzl", "eg_go_filegroup", "gen_eg_go_rules")
load(":COLEXEC.bzl", "gen_sort_partitioner_rule")

go_library(
Expand Down Expand Up @@ -56,8 +56,8 @@ go_library(
"//pkg/sql/colexec/colexecmisc",
"//pkg/sql/colexec/colexecutils",
"//pkg/sql/colexec/execgen", # keep
"//pkg/sql/colexecbase",
"//pkg/sql/colexecerror",
"//pkg/sql/colexecop",
"//pkg/sql/colmem",
"//pkg/sql/execinfra",
"//pkg/sql/execinfrapb",
Expand Down Expand Up @@ -138,8 +138,8 @@ go_test(
"//pkg/sql/colexec/colexecmisc",
"//pkg/sql/colexec/colexectestutils",
"//pkg/sql/colexec/colexecutils",
"//pkg/sql/colexecbase",
"//pkg/sql/colexecerror",
"//pkg/sql/colexecop",
"//pkg/sql/colmem",
"//pkg/sql/execinfra",
"//pkg/sql/execinfrapb",
Expand Down
10 changes: 5 additions & 5 deletions pkg/sql/colexec/aggregators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecagg"
"github.com/cockroachdb/cockroach/pkg/sql/colexec/colexectestutils"
"github.com/cockroachdb/cockroach/pkg/sql/colexecbase"
"github.com/cockroachdb/cockroach/pkg/sql/colexecerror"
"github.com/cockroachdb/cockroach/pkg/sql/colexecop"
"github.com/cockroachdb/cockroach/pkg/sql/execinfrapb"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/types"
Expand Down Expand Up @@ -72,15 +72,15 @@ type aggregatorTestCase struct {
// aggType is a helper struct that allows tests to test both the ordered and
// hash aggregators at the same time.
type aggType struct {
new func(*colexecagg.NewAggregatorArgs) (colexecbase.ResettableOperator, error)
new func(*colexecagg.NewAggregatorArgs) (colexecop.ResettableOperator, error)
name string
}

var aggTypes = []aggType{
{
// This is a wrapper around NewHashAggregator so its signature is
// compatible with NewOrderedAggregator.
new: func(args *colexecagg.NewAggregatorArgs) (colexecbase.ResettableOperator, error) {
new: func(args *colexecagg.NewAggregatorArgs) (colexecop.ResettableOperator, error) {
return NewHashAggregator(args, nil /* newSpillingQueueArgs */)
},
name: "hash",
Expand Down Expand Up @@ -726,7 +726,7 @@ func TestAggregators(t *testing.T) {
verifier = colexectestutils.UnorderedVerifier
}
colexectestutils.RunTestsWithTyps(t, testAllocator, []colexectestutils.Tuples{tc.input}, [][]*types.T{tc.typs}, tc.expected, verifier,
func(input []colexecbase.Operator) (colexecbase.Operator, error) {
func(input []colexecop.Operator) (colexecop.Operator, error) {
return agg.new(&colexecagg.NewAggregatorArgs{
Allocator: testAllocator,
MemAccount: testMemAcc,
Expand Down Expand Up @@ -1022,7 +1022,7 @@ func benchmarkAggregateFunction(
// Exhaust aggregator until all batches have been read.
for b := a.Next(ctx); b.Length() != 0; b = a.Next(ctx) {
}
if err = a.(colexecbase.Closer).Close(ctx); err != nil {
if err = a.(colexecop.Closer).Close(ctx); err != nil {
b.Fatal(err)
}
source.Reset(ctx)
Expand Down
12 changes: 6 additions & 6 deletions pkg/sql/colexec/aggregators_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/colconv"
"github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecagg"
"github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils"
"github.com/cockroachdb/cockroach/pkg/sql/colexecbase"
"github.com/cockroachdb/cockroach/pkg/sql/colexecerror"
"github.com/cockroachdb/cockroach/pkg/sql/colexecop"
"github.com/cockroachdb/cockroach/pkg/sql/colmem"
"github.com/cockroachdb/cockroach/pkg/sql/execinfrapb"
"github.com/cockroachdb/cockroach/pkg/sql/rowenc"
Expand Down Expand Up @@ -156,7 +156,7 @@ func (b *aggregatorHelperBase) restoreState() ([]coldata.Vec, int, []int) {
// handling of a FILTER clause of a single aggregate function for the hash
// aggregation.
type filteringSingleFunctionHashHelper struct {
filter colexecbase.Operator
filter colexecop.Operator
filterInput *singleBatchOperator
}

Expand Down Expand Up @@ -492,19 +492,19 @@ func (h *distinctOrderedAggregatorHelper) performAggregation(
}
}

// singleBatchOperator is a helper colexecbase.Operator that returns the
// singleBatchOperator is a helper colexecop.Operator that returns the
// provided vectors as a batch on the first call to Next() and zero batch on
// all consequent calls (until it is reset). It must be reset before it can be
// used for the first time.
type singleBatchOperator struct {
colexecbase.ZeroInputNode
colexecbase.NonExplainable
colexecop.ZeroInputNode
colexecop.NonExplainable

nexted bool
batch coldata.Batch
}

var _ colexecbase.Operator = &singleBatchOperator{}
var _ colexecop.Operator = &singleBatchOperator{}

func newSingleBatchOperator(
allocator *colmem.Allocator, typs []*types.T, maxBatchSize int,
Expand Down
Loading

0 comments on commit a9b582f

Please sign in to comment.