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

[wrangler|workflow] extract *wrangler.streamMigrater to workflow.StreamMigrator #8008

Merged
merged 6 commits into from
May 7, 2021

Conversation

ajm188
Copy link
Contributor

@ajm188 ajm188 commented Apr 30, 2021

Description

This PR moves the bulk of the stream_migrater.go code in package wrangler to package workflow, and then replaces the guts of the *wrangler.streamMigrater struct with a pointer to the new type, and delegates all other function calls through to the new type (in order to minimize the number of callsites I needed to update, which I will come back to in the next PR).

Note: the private *wrangler.trafficSwitcher and *wrangler.streamMigrater types depend on each other, so in order to not have to move both at once, and create a huge diff, I've temporarily defined a workflow.ITrafficSwitcher interface, which covers every function of *workflow.trafficSwitcher that the StreamMigrator code depends on. This is extremely temporary, and, in the next next PR, I will migrate *trafficSwitcher, at which point we won't need that interface anymore.

This also moves the private streamType enum.

Related Issue(s)

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Delegate the external interface used by other components in `package
wrangler` to use the `workflow.StreamMigrator` under the hood.

Also, delete the templatize tests, but keep the other streamMigrater
tests, because they invoke streamMigrater only indirectly.

Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

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

lgtm

@ajm188 ajm188 merged commit f420983 into vitessio:master May 7, 2021
@ajm188 ajm188 deleted the am_extract_stream_migrator branch May 7, 2021 01:14
@ajm188 ajm188 added this to In progress in Vtctld Service via automation May 7, 2021
@ajm188 ajm188 moved this from In progress to Done in Vtctld Service May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants