Documentation ¶
Index ¶
Constants ¶
View Source
const ( WorkerEventRowInsert = iota WorkerEventRowUpdate WorkerEventRowDelete WorkerEventDDL )
WorkerEvent type
View Source
const ( DispatchPolicyTableName = iota DispatchPolicyPrimaryKey )
Dispatch policy
View Source
const ( WorkerStatusNone = iota WorkerStatusRunning WorkerStatusAbnormal WorkerStatusExit )
Worker status
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DestinationConfig ¶
type DestinationConfig struct { Name string /* Database destination fields Current support database: mysql or other mysql protocol compatible database (tidb ...) */ // Backup database connection DBs []*mconn.DBConfig `json:"dbs" toml:"dbs"` Text bool `json:"text" toml:"text"` }
DestinationConfig is the data final destination config
type IJobExecutor ¶
type IJobExecutor interface { Attach(interface{}) error Begin() error Exec(*WorkerEvent) error Rollback() error Commit() error }
IJobExecutor define the interface of output destination
type WorkerConfig ¶
type WorkerConfig struct { WorkerCount int `json:"worker-count" toml:"worker-count"` Tos []DestinationConfig `json:"tos" toml:"tos"` // Multi destination output }
WorkerConfig is worker config
type WorkerEvent ¶
type WorkerEvent struct { Etype int // Insert/Update/Delete Timestamp uint32 Point mconn.ReplicationPoint Ti *tableinfo.TableInfo Columns []*tableinfo.ColumnWithValue NewColumns []*tableinfo.ColumnWithValue SDesc *rule.SyncDesc }
WorkerEvent holds the job IOutDest need to output
type WorkerManager ¶
type WorkerManager struct {
// contains filtered or unexported fields
}
WorkerManager manages all workers
func NewWorkerManager ¶
func NewWorkerManager(cfg *WorkerConfig) (*WorkerManager, error)
NewWorkerManager creates a new WorkerManager
func (*WorkerManager) DispatchWorkerEvent ¶
func (w *WorkerManager) DispatchWorkerEvent(job *WorkerEvent, dispPolicy int) (bool, error)
DispatchWorkerEvent dispatchs WorkerEvent to worker, return true if replication point is checked
Click to show internal directories.
Click to hide internal directories.