Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execinfra: extract out some packages to break dependencies #79938

Merged
merged 2 commits into from
Apr 18, 2022

Conversation

yuzefovich
Copy link
Member

execinfra: shrink the package down a bit

This commit refactors execinfra package by extracting some things in
order to break the dependency of colexecop on it. Two main pieces had
to be refactored:

  • stats.go file is now moved into execstats since it seems to be
    a much more suitable place. This required inlining GetTraceData
    function helper and breaking a dependency of ShouldCollectStats helper
    on execinfra.FlowCtx.
  • operator.go which defines OpNode interface (implemented by both
    columnar operators and row-by-row processors) has been moved (and
    renamed to op_node.go) to a new package execopnode.

Release note: None

execinfra: extract Releasable interface into a separate package

This commit extracts execinfra.Releasable interface into a new
execreleasable package in order to break the dependency of several
packages of the vectorized engine on execinfra. This will allow those
packages (e.g. colexecproj) to start being built sooner which will
shorten the build time.

Addresses: #79357.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

This commit refactors `execinfra` package by extracting some things in
order to break the dependency of `colexecop` on it. Two main pieces had
to be refactored:
- `stats.go` file is now moved into `execstats` since it seems to be
a much more suitable place. This required inlining `GetTraceData`
function helper and breaking a dependency of `ShouldCollectStats` helper
on `execinfra.FlowCtx`.
- `operator.go` which defines `OpNode` interface (implemented by both
columnar operators and row-by-row processors) has been moved (and
renamed to `op_node.go`) to a new package `execopnode`.

Release note: None
@yuzefovich yuzefovich force-pushed the colexecop-execinfra-dep branch from bbe9bfe to 54aac03 Compare April 14, 2022 03:18
This commit extracts `execinfra.Releasable` interface into a new
`execreleasable` package in order to break the dependency of several
packages of the vectorized engine on `execinfra`. This will allow those
packages (e.g. `colexecproj`) to start being built sooner which will
shorten the build time.

Release note: None
@yuzefovich yuzefovich force-pushed the colexecop-execinfra-dep branch from 54aac03 to 7a3b7e8 Compare April 14, 2022 03:34
@yuzefovich yuzefovich marked this pull request as ready for review April 14, 2022 03:50
@yuzefovich yuzefovich requested a review from a team as a code owner April 14, 2022 03:50
@yuzefovich yuzefovich requested review from a team, msirek and michae2 April 14, 2022 03:50
@yuzefovich
Copy link
Member Author

This PR makes it so that the vectorized engine packages are no longer on the critical path.

Copy link
Contributor

@msirek msirek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep these build time improvement PRs coming!
:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @michae2)

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 8 of 73 files at r1, 3 of 41 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @michae2 and @yuzefovich)


pkg/sql/colexec/builtin_funcs.go, line 42 at r2 (raw file):

var _ colexecop.Operator = &defaultBuiltinFuncOperator{}
var _ execreleasable.Releasable = &defaultBuiltinFuncOperator{}

nit: is there any other name that would also make sense to change it to? Just thinking of something that would not have this usage of releasable.Releasable

Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @maryliag and @michae2)


pkg/sql/colexec/builtin_funcs.go, line 42 at r2 (raw file):

Previously, maryliag (Marylia Gutierrez) wrote…

nit: is there any other name that would also make sense to change it to? Just thinking of something that would not have this usage of releasable.Releasable

Yeah, I'm not fond of it either but couldn't come up with anything better. My only other ideas were execinfrabase of execbase, but IMO those are even worse. Any other ideas?

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @michae2 and @yuzefovich)


pkg/sql/colexec/builtin_funcs.go, line 42 at r2 (raw file):

Previously, yuzefovich (Yahor Yuzefovich) wrote…

Yeah, I'm not fond of it either but couldn't come up with anything better. My only other ideas were execinfrabase of execbase, but IMO those are even worse. Any other ideas?

I can't think of anything either, so let's keep this way. We can always revisit later :)

@yuzefovich
Copy link
Member Author

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 18, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Apr 18, 2022

Build succeeded:

@craig craig bot merged commit ecb24ef into cockroachdb:master Apr 18, 2022
@yuzefovich yuzefovich deleted the colexecop-execinfra-dep branch April 18, 2022 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants