filter

package
v0.0.0-...-10178d1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// refer to mongo/bson/bsontypes.h of mongodb kernel 4.0
	BsonInvalid    = -1
	BsonMinKey     = 0
	BsonTypeNumber = 10
	BsonTypeString = 15
	BsonTypeOid    = 35
	BsonMaxKey     = 100
)

Variables

This section is empty.

Functions

func ComputeHash

func ComputeHash(data interface{}) (int64, error)

Types

type AutologousFilter

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

func NewAutologousFilter

func NewAutologousFilter() *AutologousFilter

func (*AutologousFilter) Filter

func (filter *AutologousFilter) Filter(log *oplog.PartialLog) bool

func (*AutologousFilter) FilterNs

func (filter *AutologousFilter) FilterNs(namespace string) bool

type DDLFilter

type DDLFilter struct {
}

func (*DDLFilter) Filter

func (filter *DDLFilter) Filter(log *oplog.PartialLog) bool

type DocFilter

type DocFilter interface {
	FilterNs(namespace string) bool
}

DocFilter: AutologousFilter, NamespaceFilter

type DocFilterChain

type DocFilterChain []DocFilter

func NewDocFilterList

func NewDocFilterList() DocFilterChain

func (DocFilterChain) IterateFilter

func (chain DocFilterChain) IterateFilter(namespace string) bool

type GidFilter

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

func NewGidFilter

func NewGidFilter(gids []string) *GidFilter

func (*GidFilter) Filter

func (filter *GidFilter) Filter(log *oplog.PartialLog) bool

type MigrateFilter

type MigrateFilter struct {
}

func (*MigrateFilter) Filter

func (filter *MigrateFilter) Filter(log *oplog.PartialLog) bool

type NamespaceFilter

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

because regexp use the default perl engine which is not support inverse match, so use two rules to match

func NewNamespaceFilter

func NewNamespaceFilter(white, black []string) *NamespaceFilter

func (*NamespaceFilter) Filter

func (filter *NamespaceFilter) Filter(log *oplog.PartialLog) bool

func (*NamespaceFilter) FilterNs

func (filter *NamespaceFilter) FilterNs(namespace string) bool

type NoopFilter

type NoopFilter struct {
}

func (*NoopFilter) Filter

func (filter *NoopFilter) Filter(log *oplog.PartialLog) bool

type OplogFilter

type OplogFilter interface {
	Filter(log *oplog.PartialLog) bool
}

OplogFilter: AutologousFilter, NamespaceFilter, GidFilter, NoopFilter, DDLFilter

type OplogFilterChain

type OplogFilterChain []OplogFilter

func (OplogFilterChain) IterateFilter

func (chain OplogFilterChain) IterateFilter(log *oplog.PartialLog) bool

type OrphanFilter

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

func NewOrphanFilter

func NewOrphanFilter(replset string, chunkMap utils.DBChunkMap) *OrphanFilter

func (*OrphanFilter) Filter

func (filter *OrphanFilter) Filter(doc *bson.Raw, namespace string) bool

Jump to

Keyboard shortcuts

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