vitess.io/vitess@v0.16.2/go/vt/wrangler/switcher_interface.go (about) 1 /* 2 Copyright 2020 The Vitess Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package wrangler 18 19 import ( 20 "context" 21 "time" 22 23 "vitess.io/vitess/go/vt/vtctl/workflow" 24 25 topodatapb "vitess.io/vitess/go/vt/proto/topodata" 26 ) 27 28 type iswitcher interface { 29 lockKeyspace(ctx context.Context, keyspace, action string) (context.Context, func(*error), error) 30 cancelMigration(ctx context.Context, sm *workflow.StreamMigrator) 31 stopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) 32 stopSourceWrites(ctx context.Context) error 33 waitForCatchup(ctx context.Context, filteredReplicationWaitTime time.Duration) error 34 migrateStreams(ctx context.Context, sm *workflow.StreamMigrator) error 35 createReverseVReplication(ctx context.Context) error 36 createJournals(ctx context.Context, sourceWorkflows []string) error 37 allowTargetWrites(ctx context.Context) error 38 changeRouting(ctx context.Context) error 39 streamMigraterfinalize(ctx context.Context, ts *trafficSwitcher, workflows []string) error 40 startReverseVReplication(ctx context.Context) error 41 switchTableReads(ctx context.Context, cells []string, servedType []topodatapb.TabletType, direction workflow.TrafficSwitchDirection) error 42 switchShardReads(ctx context.Context, cells []string, servedType []topodatapb.TabletType, direction workflow.TrafficSwitchDirection) error 43 validateWorkflowHasCompleted(ctx context.Context) error 44 removeSourceTables(ctx context.Context, removalType workflow.TableRemovalType) error 45 dropSourceShards(ctx context.Context) error 46 dropSourceDeniedTables(ctx context.Context) error 47 freezeTargetVReplication(ctx context.Context) error 48 dropSourceReverseVReplicationStreams(ctx context.Context) error 49 dropTargetVReplicationStreams(ctx context.Context) error 50 removeTargetTables(ctx context.Context) error 51 dropTargetShards(ctx context.Context) error 52 deleteRoutingRules(ctx context.Context) error 53 deleteShardRoutingRules(ctx context.Context) error 54 addParticipatingTablesToKeyspace(ctx context.Context, keyspace, tableSpecs string) error 55 logs() *[]string 56 }