oplogsyncer

package
v0.0.0-...-b6f2496 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryTs    = "ts"
	QueryGid   = "g"
	QueryOpGT  = "$gt"
	QueryOpGTE = "$gte"

	LocalDB = "local"
)
View Source
const (
	CollectionCapped           = "CollectionScan died due to position in capped" // bigger than 3.0
	CollectionCappedLowVersion = "UnknownError"                                  // <= 3.0 version
)

Variables

View Source
var CollectionCappedError = errors.New("collection capped error")
View Source
var TimeoutError = errors.New("read next log timeout, It shouldn't be happen")

TimeoutError. mongodb query executed timeout

Functions

This section is empty.

Types

type GidOplogReader

type GidOplogReader struct {
	OplogReader
}

GidOplogReader. query along with gid

func NewGidOplogReader

func NewGidOplogReader(src string) *GidOplogReader

func (*GidOplogReader) SetQueryGid

func (reader *GidOplogReader) SetQueryGid(gid string)

type OplogReader

type OplogReader struct {
	// contains filtered or unexported fields
}

OplogReader represents stream reader from mongodb that specified by an url. And with query options. user can iterate oplogs.

func NewOplogReader

func NewOplogReader(src, replset string) *OplogReader

NewOplogReader creates reader with mongodb url

func (*OplogReader) GetQueryTimestamp

func (reader *OplogReader) GetQueryTimestamp() bson.MongoTimestamp

func (*OplogReader) Next

func (reader *OplogReader) Next() (*bson.Raw, error)

Next returns an oplog by raw bytes which is []byte

func (*OplogReader) NextOplog

func (reader *OplogReader) NextOplog() (log *oplog.GenericOplog, err error)

NextOplog returns an oplog by oplog.GenericOplog struct

func (*OplogReader) SetQueryTimestampOnEmpty

func (reader *OplogReader) SetQueryTimestampOnEmpty(ts bson.MongoTimestamp)

SetQueryTimestampOnEmpty set internal timestamp if not exist in this reader. initial stage most of the time

func (*OplogReader) StartFetcher

func (reader *OplogReader) StartFetcher()

start fetcher if not exist

func (*OplogReader) UpdateQueryTimestamp

func (reader *OplogReader) UpdateQueryTimestamp(ts bson.MongoTimestamp)

Jump to

Keyboard shortcuts

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