executor

package
v0.0.0-...-d253ebd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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

func IgnoreError(err error, op string, isFullSyncStage bool) bool

true means error can be ignored https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.yml

func RunCommand

func RunCommand(database, operation string, log *oplog.PartialLog, session *mgo.Session) error

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(session *mgo.Session, metadata bson.M, bulkInsert bool, fullFinishTs int64) BasicWriter

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

func (*Executor) RestAPI

func (exec *Executor) RestAPI()

type Item

type Item struct {
	Key string
	Val uint64
}

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL