executor

package
v2.0.0-...-acbaf60 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

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

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 RecordDuplicatedOplog

func RecordDuplicatedOplog(conn *utils.MongoCommunityConn, coll string, records []*OplogRecord)

RecordDuplicatedOplog Write dup oplog in DB APPConflictDatabase

func RunCommand

func RunCommand(database, operation string, log *oplog.PartialLog, client *mongo.Client) 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(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

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

Jump to

Keyboard shortcuts

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