aof

package
v0.0.0-...-2d4ed79 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 17 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

func MakeExpireCmd

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

Types

type CmdLine

type CmdLine [][]byte

type Handler

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

func NewAOFHandler

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

func (*Handler) AddAof

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

AddAof 通过channel给aof协程发送命令

func (*Handler) Close

func (handler *Handler) Close()

Close 优雅的停止aof持久化任务

func (*Handler) DoRewrite

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

DoRewrite aof重写期间是允许aof任务正常执行的 (在不阻塞在线服务的同时进行其它操作是一项必需的能力,AOF重写的思路在解决这类问题时具有重要的参考价值)

func (*Handler) FinishRewrite

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

func (*Handler) LoadAof

func (handler *Handler) LoadAof(maxBytes int)

LoadAof 读取aof文件,对aof文件中的命令进行重放,将数据载入内存中

func (*Handler) Rewrite

func (handler *Handler) Rewrite() error

Rewrite aof rewrite实现

func (*Handler) StartRewrite

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

type RewriteCtx

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

Jump to

Keyboard shortcuts

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