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

importccl: refactor import processor to use ProcessorBase #57124

Merged
merged 2 commits into from
Dec 14, 2020

Conversation

pbardea
Copy link
Contributor

@pbardea pbardea commented Nov 25, 2020

This commit refactors the import processor to use ProcessorBase.
Although this processor doesn't have any inputs and the main utility
that ProcessorBase provides is management of draining inputs, there is
still some utility for this processor to embed a ProcessorBase. As
tracing and other infrastructural improvements are made to
ProcessorBase, this allows the import processor to stay up to date with
these changes.

The way that this processor works is that it kicks off a goroutine on
start that will begin the import and start sending progress updates over
an internally maintained channel. Next() will continually read from that
channel until it is fully consumed, and then read the returned summary
generated by the goroutine.

Import is build this way so that it can manage concurrency internally to
the processor.

Relates to #57293.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

This commit refactors the import processor to use ProcessorBase.
Although this processor doesn't have any inputs and the main utility
that ProcessorBase provides is management of draining inputs, there is
still some utility for this processor to embed a ProcessorBase. As
tracing and other infrastructural improvements are made to
ProcessorBase, this allows the import processor to stay up to date with
these changes.

The way that this processor works is that it kicks off a goroutine on
start that will begin the import and start sending progress updates over
an internally maintained channel. Next() will continually read from that
channel until it is fully consumed, and then read the returned summary
generated by the goroutine.

Import is build this way so that it can manage concurrency internally to
the processor.

Release note: None
@pbardea pbardea force-pushed the import-processor-base branch from 89201fb to 9a675f0 Compare November 25, 2020 21:55
@pbardea pbardea marked this pull request as ready for review November 30, 2020 14:52
@pbardea pbardea requested review from a team, adityamaru and dt and removed request for a team November 30, 2020 14:52
@pbardea
Copy link
Contributor Author

pbardea commented Nov 30, 2020

The changes to the other processors are very similar, I can add them onto this PR as other commits but feedback on the general approach would be appreciated.

I think since there is so much similarity between the approaches, it makes sense to make a general async processor, but thought it would be easier to review if I first make the changes to all of the processors and then factor out the common logic into a common processor. Thoughts appreciated!

@pbardea pbardea linked an issue Dec 1, 2020 that may be closed by this pull request
3 tasks
@pbardea
Copy link
Contributor Author

pbardea commented Dec 14, 2020

TFTR
bors r+

@craig
Copy link
Contributor

craig bot commented Dec 14, 2020

Build succeeded:

@craig craig bot merged commit dffc015 into cockroachdb:master Dec 14, 2020
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.

bulkio: refactor bulk processors to use ProcessorBase
3 participants