backup

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCancelled = errors.New("backup canceled")

ErrCancelled means backup was canceled

Functions

func Compress

func Compress(w io.Writer, compression pbm.CompressionType) io.WriteCloser

Compress makes a compressed writer from the given one

func NodeSuits

func NodeSuits(node *pbm.Node, inf *pbm.NodeInfo) (bool, error)

NodeSuits checks if node can perform backup

func Upload

func Upload(ctx context.Context, src Source, dst storage.Storage, compression pbm.CompressionType, fname string, sizeb int) (int64, error)

Upload writes data to dst from given src and returns an amount of written bytes

Types

type Backup

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

func New

func New(ctx context.Context, cn *pbm.PBM, node *pbm.Node) *Backup

func (*Backup) Run

func (b *Backup) Run(bcp pbm.BackupCmd, opid pbm.OPID, l *plog.Event) (err error)

Run runs the backup

type ErrInsuffRange

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

func (ErrInsuffRange) Error

func (e ErrInsuffRange) Error() string

type NopCloser

type NopCloser struct {
	io.Writer
}

NopCloser wraps an io.Witer as io.WriteCloser with noop Close

func (NopCloser) Close

func (NopCloser) Close() error

Close to satisfy io.WriteCloser interface

type Oplog

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

Oplog is used for reading the Mongodb oplog

func NewOplog

func NewOplog(node *pbm.Node) *Oplog

NewOplog creates a new Oplog instance

func (*Oplog) LastWrite

func (ot *Oplog) LastWrite() (primitive.Timestamp, error)

LastWrite returns a timestamp of the last write operation readable by majority reads

func (*Oplog) SetTailingSpan

func (ot *Oplog) SetTailingSpan(start, end primitive.Timestamp)

SetTailingSpan sets oplog tailing window

func (*Oplog) WriteTo

func (ot *Oplog) WriteTo(w io.Writer) (int64, error)

WriteTo writes an oplog slice between start and end timestamps into the given io.Writer

To be sure we have read ALL records up to the specified cluster time. Specifically, to be sure that no operations from the past gonna came after we finished the slicing, we have to tail until some record with ts > endTS. And it might be a noop.

type Source

type Source interface {
	io.WriterTo
}

Jump to

Keyboard shortcuts

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