aof

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityToCmd

func EntityToCmd(key string, entity *database.DataEntity) *protocol.MultiBulkReply

EntityToCmd serialize data entity to redis command

func MakeExpireCmd

func MakeExpireCmd(key string, expireAt time.Time) *protocol.MultiBulkReply

MakeExpireCmd generates command line to set expiration for the given key

Types

type CmdLine

type CmdLine = [][]byte

CmdLine is alias for [][]byte, represents a command line

type Handler

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

Handler receive msgs from channel and write to AOF file

func NewAOFHandler

func NewAOFHandler(db database.EmbedDB, tmpDBMaker func() database.EmbedDB) (*Handler, error)

NewAOFHandler creates a new aof.Handler

func (*Handler) AddAof

func (handler *Handler) AddAof(dbIndex int, cmdLine CmdLine)

AddAof send command to aof goroutine through channel

func (*Handler) Close

func (handler *Handler) Close()

Close gracefully stops aof persistence procedure

func (*Handler) DoRewrite

func (handler *Handler) DoRewrite(ctx *RewriteCtx) error

DoRewrite actually rewrite aof file makes DoRewrite public for testing only, please use Rewrite instead

func (*Handler) FinishRewrite

func (handler *Handler) FinishRewrite(ctx *RewriteCtx)

FinishRewrite finish rewrite procedure

func (*Handler) LoadAof

func (handler *Handler) LoadAof(maxBytes int)

LoadAof read aof file

func (*Handler) Rewrite

func (handler *Handler) Rewrite() error

Rewrite carries out AOF rewrite

func (*Handler) Rewrite2RDB

func (handler *Handler) Rewrite2RDB() error

func (*Handler) StartRewrite

func (handler *Handler) StartRewrite() (*RewriteCtx, error)

StartRewrite prepares rewrite procedure

type RewriteCtx

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

RewriteCtx holds context of an AOF rewriting procedure

Jump to

Keyboard shortcuts

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