Documentation ¶
Index ¶
- Constants
- Variables
- func ExactlyMatch(first, second interface{}) bool
- func GenerateExecutorId() int
- func IgnoreError(err error, op string, isFullSyncStage bool) bool
- func RecordDuplicatedOplog(conn *utils.MongoCommunityConn, coll string, records []*OplogRecord)
- func RunCommand(database, operation string, log *oplog.PartialLog, client *mongo.Client) error
- type BarrierMatrix
- type BasicWriter
- type BatchGroupExecutor
- type BulkWriter
- type CollisionMatrix
- type CommandWriter
- type Executor
- type Item
- type LogsGroupCombiner
- type NoopMatrix
- type OplogRecord
- type OplogUniqueIdentifier
- type OplogsGroup
- type PartialLogWithCallbak
- type SingleWriter
Constants ¶
View Source
const ( DumpConflictToDB = "db" NoDumpConflict = "none" ExecuteOrdered = false OpInsert = 0x01 OpUpdate = 0x02 OplogsMaxGroupNum = 1000 OplogsMaxGroupSize = 12 * 1024 * 1024 // MongoDB limits 16MB )
View Source
const MultiColumnIndexSplitter = "|"
Variables ¶
View Source
var ( GlobalExecutorId int32 = -1 ThresholdVersion string = "3.2.0" )
View Source
var ErrorsShouldSkip = map[int]string{
61: "ShardKeyNotFound",
}
Functions ¶
func ExactlyMatch ¶
func ExactlyMatch(first, second interface{}) bool
func GenerateExecutorId ¶
func GenerateExecutorId() int
func IgnoreError ¶
true means error can be ignored https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.yml
func RecordDuplicatedOplog ¶
func RecordDuplicatedOplog(conn *utils.MongoCommunityConn, coll string, records []*OplogRecord)
RecordDuplicatedOplog Write dup oplog in DB APPConflictDatabase
func RunCommand ¶
Types ¶
type BarrierMatrix ¶
type BarrierMatrix struct {
NoopMatrix
}
BarrierMatrix only split oplogs into segments. without convert stage stage.
func NewBarrierMatrix ¶
func NewBarrierMatrix() *BarrierMatrix
type BasicWriter ¶
type BasicWriter interface {
// contains filtered or unexported methods
}
func NewDbWriter ¶
func NewDbWriter(conn *utils.MongoCommunityConn, metadata bson.M, bulkInsert bool, fullFinishTs int64) BasicWriter
oplog writer
type BatchGroupExecutor ¶
type BatchGroupExecutor struct { // worker id ReplayerId uint32 // mongo url MongoUrl string // tranform namespace NsTrans *transform.NamespaceTransform // init sync finish timestamp FullFinishTs int64 // contains filtered or unexported fields }
func (*BatchGroupExecutor) Start ¶
func (batchExecutor *BatchGroupExecutor) Start()
func (*BatchGroupExecutor) Sync ¶
func (batchExecutor *BatchGroupExecutor) Sync(rawLogs []*oplog.PartialLog, callback func())
type BulkWriter ¶
type BulkWriter struct {
// contains filtered or unexported fields
}
use general bulk interface such like Insert/Update/Delete to execute command
type CollisionMatrix ¶
type CollisionMatrix interface {
// contains filtered or unexported methods
}
type CommandWriter ¶
type CommandWriter struct {
// contains filtered or unexported fields
}
use run_command to execute command
type Executor ¶
type Executor struct { // mongo url MongoUrl string // contains filtered or unexported fields }
func NewExecutor ¶
func NewExecutor(id int, batchExecutor *BatchGroupExecutor, MongoUrl string) *Executor
type LogsGroupCombiner ¶
type LogsGroupCombiner struct {
// contains filtered or unexported fields
}
type NoopMatrix ¶
type NoopMatrix struct{}
type OplogRecord ¶
type OplogRecord struct {
// contains filtered or unexported fields
}
type OplogUniqueIdentifier ¶
type OplogUniqueIdentifier struct {
// contains filtered or unexported fields
}
type OplogsGroup ¶
type OplogsGroup struct {
// contains filtered or unexported fields
}
type PartialLogWithCallbak ¶
type PartialLogWithCallbak struct {
// contains filtered or unexported fields
}
type SingleWriter ¶
type SingleWriter struct {
// contains filtered or unexported fields
}
use general single writer interface to execute command
Click to show internal directories.
Click to hide internal directories.