MCPcopy
hub / github.com/github/gh-ost / NewMigrationContext

Function NewMigrationContext

go/base/context.go:310–337  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308}
309
310func 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
339func (mctx *MigrationContext) SetConnectionConfig(storageEngine string) error {
340 var transactionIsolation string

Calls 4

NewConnectionConfigFunction · 0.92
NewInstanceKeyMapFunction · 0.92
NewLoadMapFunction · 0.85
NewDefaultLoggerFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…