oplog

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TS_SOURCE_MONSTACHE = "monstache"

An oplog resume timestamp saved by a monstache instance

View Source
const TS_SOURCE_OPLOG = "oplog"

An oplog resume timestamp taken from the last mongodb operation

Variables

This section is empty.

Functions

This section is empty.

Types

type TimestampResolver

type TimestampResolver interface {
	GetResumeTimestamp(candidateTs primitive.Timestamp, source string) chan primitive.Timestamp
}

A TimestampResolver decides on a timestamp from which to start reading an oplog from. A result may not be immediately available (see TimestampResolverEarliest), so it is returned in a channel.

type TimestampResolverEarliest

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

TimestampResolverEarliest waits until oplog resume timestamps have been queried from all the available mongodb shards, and returns an earliest one.

func NewTimestampResolverEarliest

func NewTimestampResolverEarliest(connectionsTotal int, logger *log.Logger) *TimestampResolverEarliest

func (*TimestampResolverEarliest) GetResumeTimestamp

func (resolver *TimestampResolverEarliest) GetResumeTimestamp(candidateTs primitive.Timestamp, source string) chan primitive.Timestamp

Returns a channel from which an earliest resume timestamp can be received

type TimestampResolverSimple

type TimestampResolverSimple struct{}

A simple resolver immediately returns a timestamp it's been given.

func (TimestampResolverSimple) GetResumeTimestamp

func (r TimestampResolverSimple) GetResumeTimestamp(candidateTs primitive.Timestamp, source string) chan primitive.Timestamp

Jump to

Keyboard shortcuts

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