Documentation ¶
Index ¶
- Constants
- Variables
- func ExactlyMatch(first, second interface{}) bool
- func GenerateExecutorId() int
- func HandleDuplicated(collection *mgo.Collection, records []*OplogRecord, op int8)
- func IgnoreError(err error, op string, isFullSyncStage bool) bool
- func RunCommand(database, operation string, log *oplog.PartialLog, session *mgo.Session) 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
- type SnapshotDiffer
Constants ¶
View Source
const ( DumpConflictToDB = "db" DumpConflictToSDK = "sdk" 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 HandleDuplicated ¶
func HandleDuplicated(collection *mgo.Collection, records []*OplogRecord, op int8)
func IgnoreError ¶
true means error can be ignored https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.yml
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 ¶
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
type SnapshotDiffer ¶
type SnapshotDiffer struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.