forked from liuhr/my2sql
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
32 lines (28 loc) · 750 Bytes
/
main.go
File metadata and controls
32 lines (28 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"sync"
my "my2sql/base"
)
func main() {
my.GConfCmd.IfSetStopParsPoint = false
my.GConfCmd.ParseCmdOptions()
defer my.GConfCmd.CloseFH()
if my.GConfCmd.WorkType != "stats" {
my.G_HandlingBinEventIndex = &my.BinEventHandlingIndx{EventIdx: 1, Finished: false}
}
var wg, wgGenSql sync.WaitGroup
wg.Add(1)
go my.ProcessBinEventStats(my.GConfCmd, &wg)
if my.GConfCmd.WorkType != "stats" {
wg.Add(1)
go my.PrintExtraInfoForForwardRollbackupSql(my.GConfCmd, &wg)
for i := uint(1); i <= my.GConfCmd.Threads; i++ {
wgGenSql.Add(1)
go my.GenForwardRollbackSqlFromBinEvent(i, my.GConfCmd, &wgGenSql)
}
}
my.ParserAllBinEventsFromRepl(my.GConfCmd)
wgGenSql.Wait()
close(my.GConfCmd.SqlChan)
wg.Wait()
}