()
| 308 | } |
| 309 | |
| 310 | func NewMigrationContext() *MigrationContext { |
| 311 | ctx, cancelFunc := context.WithCancel(context.Background()) |
| 312 | return &MigrationContext{ |
| 313 | Uuid: uuid.NewString(), |
| 314 | defaultNumRetries: 60, |
| 315 | ChunkSize: 1000, |
| 316 | InspectorConnectionConfig: mysql.NewConnectionConfig(), |
| 317 | ApplierConnectionConfig: mysql.NewConnectionConfig(), |
| 318 | MaxLagMillisecondsThrottleThreshold: 1500, |
| 319 | CutOverLockTimeoutSeconds: 3, |
| 320 | DMLBatchSize: 10, |
| 321 | etaNanoseonds: ETAUnknown, |
| 322 | maxLoad: NewLoadMap(), |
| 323 | criticalLoad: NewLoadMap(), |
| 324 | throttleMutex: &sync.Mutex{}, |
| 325 | throttleHTTPMutex: &sync.Mutex{}, |
| 326 | throttleControlReplicaKeys: mysql.NewInstanceKeyMap(), |
| 327 | configMutex: &sync.Mutex{}, |
| 328 | pointOfInterestTimeMutex: &sync.Mutex{}, |
| 329 | lastHeartbeatOnChangelogMutex: &sync.Mutex{}, |
| 330 | ColumnRenameMap: make(map[string]string), |
| 331 | PanicAbort: make(chan error), |
| 332 | ctx: ctx, |
| 333 | cancelFunc: cancelFunc, |
| 334 | abortMutex: &sync.Mutex{}, |
| 335 | Log: NewDefaultLogger(), |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | func (mctx *MigrationContext) SetConnectionConfig(storageEngine string) error { |
| 340 | var transactionIsolation string |
searching dependent graphs…