oplog

package
v0.0.0-...-233725d Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RPCAddOpTimeout = 60 * time.Second
	RotateSize      = 67108864 // 64M
	ExpiredDays     = 168.0    // 7 days
	CompactTogether = 3
)

Functions

func Archive

func Archive(archive string, raws []string) error

Archive compress N wal files into one gzip file

func Unarchive

func Unarchive(archive string) (string, error)

Unarchive decompress N wal files from one gzip file

Types

type OpLogger

type OpLogger struct {
	OplogCh    chan *pb.OpLogEntry
	RecordedCh chan struct{}
	// contains filtered or unexported fields
}

OpLogger implements Write-Ahead logging

func NewOpLogger

func NewOpLogger(cfg *conf.Oplog) *OpLogger

func (*OpLogger) BatchWriteOpLogs

func (ol *OpLogger) BatchWriteOpLogs(ops []*pb.OpLogEntry)

BatchWriteOpLogs xxx

func (*OpLogger) CompactWALFile

func (ol *OpLogger) CompactWALFile()

CompactWALFile compacts wal files those last modified time is one week ago.

func (*OpLogger) DumpOpLogs

func (ol *OpLogger) DumpOpLogs(shutdown chan struct{})

DumpOpLogs dumps operation logs for fault-tolerence.

func (*OpLogger) ReplayOpLogs

func (ol *OpLogger) ReplayOpLogs()

ReplayOpLogs replays all stored operation logs from failure recover.

func (*OpLogger) RotateWALFile

func (ol *OpLogger) RotateWALFile()

RotateWALFile rotates wal file when it grows to 64M.

func (*OpLogger) SyncOpLogs

func (ol *OpLogger) SyncOpLogs()

SyncOpLogs syncs operation logs to backup servers for fault-tolerence.

func (*OpLogger) WriteOpLog

func (ol *OpLogger) WriteOpLog(op *pb.OpLogEntry)

WriteOpLog xxx

Jump to

Keyboard shortcuts

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