Documentation
¶
Index ¶
- func AddHistory(dbName string, SchemaName string, TableName string, TableNames string, ...) (int, error)
- func CheckWhere(dbName, SchemaName, TableName, Where string) error
- func CheckWhere0(Uri string, SchemaName string, TableName string, Where string) error
- func DBConnect(uri string) mysql.MysqlConnection
- func DelHistory(dbName string, ID int) bool
- func GetTablePriKeyMinAndMaxVal(db mysql.MysqlConnection, schema, table, PriKey, where string) (minId uint64, maxId uint64)
- func KillHistory(dbName string, ID int) error
- func Start(dbName string, ID int) error
- func StopHistory(dbName string, ID int) error
- type HisotryStatus
- type History
- type HistoryProperty
- type TableInfoStruct
- type TableStatus
- type TableStruct
- type ThreadStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHistory ¶
func CheckWhere ¶ added in v1.2.2
func CheckWhere0 ¶ added in v1.2.2
func DBConnect ¶
func DBConnect(uri string) mysql.MysqlConnection
func DelHistory ¶
func GetTablePriKeyMinAndMaxVal ¶ added in v1.2.2
func GetTablePriKeyMinAndMaxVal(db mysql.MysqlConnection, schema, table, PriKey, where string) (minId uint64, maxId uint64)
func KillHistory ¶
func StopHistory ¶
Types ¶
type HisotryStatus ¶
type HisotryStatus string
const ( HISTORY_STATUS_ALL HisotryStatus = "All" HISTORY_STATUS_CLOSE HisotryStatus = "close" HISTORY_STATUS_RUNNING HisotryStatus = "running" HISTORY_STATUS_OVER HisotryStatus = "over" HISTORY_STATUS_HALFWAY HisotryStatus = "halfway" HISTORY_STATUS_KILLED HisotryStatus = "killed" HISTORY_STATUS_SELECT_OVER HisotryStatus = "selectOver" //拉取数据结束 HISTORY_STATUS_SELECT_STOPING HisotryStatus = "stoping" HISTORY_STATUS_SELECT_STOPED HisotryStatus = "stoped" )
type History ¶
type History struct { sync.RWMutex ID int DbName string SchemaName string TableName string Property HistoryProperty Status HisotryStatus NowStartI uint64 //当前第几条数据 ThreadPool []*ThreadStatus Fields []TableStruct `json:"-"` TableInfo TableInfoStruct `json:"-"` Uri string `json:"-"` ToServerIDList []int StartTime string OverTime string TablePriKeyMinId uint64 // 假如主键是自增id的情况下 这个值是当前自增id最小值 TablePriKeyMaxId uint64 // 假如主键是自增id的情况下 这个值是当前自增id最大值 TablePriKey string // 主键字段 TablePriArr []*string ToServerList []*toServer ToServerTheadCount int16 // 实际正在运行的同步协程数 ToServerTheadGroup *sync.WaitGroup TableNames string // 用 ; 隔开的表名 TableNameArr []*TableStatus // TableNames 分割后的数组 CurrentTableName string // 正在执行全量的表名 TableCount int // 要全量的总表数量 TableCountSuccess int // 已经成功的表数量 SelectRowsCount uint64 // 成功拉取多少条数据 // contains filtered or unexported fields }
func GetHistoryList ¶
func GetHistoryList(dbName, SchemaName, TableName string, status HisotryStatus) []History
func (*History) GetNextSql ¶ added in v1.2.2
func (*History) InitToServer ¶ added in v1.2.2
func (This *History) InitToServer()
func (*History) SyncWaitToServerOver ¶ added in v1.2.2
type HistoryProperty ¶
type TableInfoStruct ¶ added in v1.2.2
func GetSchemaTableInfo ¶ added in v1.2.2
func GetSchemaTableInfo(db mysql.MysqlConnection, schema string, table string) (tableInfo TableInfoStruct)
type TableStatus ¶
type TableStruct ¶
type TableStruct struct { COLUMN_NAME *string COLUMN_DEFAULT *string IS_NULLABLE *string COLUMN_TYPE *string COLUMN_KEY *string EXTRA *string COLUMN_COMMENT *string DATA_TYPE *string NUMERIC_PRECISION *uint64 NUMERIC_SCALE *uint64 }
func GetSchemaTableFieldList ¶
func GetSchemaTableFieldList(db mysql.MysqlConnection, schema string, table string) []TableStruct
type ThreadStatus ¶
Click to show internal directories.
Click to hide internal directories.