binlog

package
v0.0.0-...-8b03266 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinLogger

type BinLogger interface {
	Close() error
	TruncateFront(index uint64) error
	ReadLastSegSection(index uint64) (data []byte, fileName string, offset, blkLen uint64, err error)
	LastIndex() (index uint64, err error)
	Write(index uint64, data []byte) (fileName string, offset, blkLen uint64, err error)
	ReadFileSection(fiIndex *storePb.StoreInfo) ([]byte, error)
}

type MemBinlog

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

func NewMemBinlog

func NewMemBinlog(log protocol.Logger) *MemBinlog

创建一个内存binlog

func (*MemBinlog) Close

func (l *MemBinlog) Close() error

关闭

func (*MemBinlog) LastIndex

func (l *MemBinlog) LastIndex() (uint64, error)

返回最后写入的索引

func (*MemBinlog) ReadFileSection

func (l *MemBinlog) ReadFileSection(fiIndex *storePb.StoreInfo) ([]byte, error)

根据索引,读取对应数据

func (*MemBinlog) ReadLastSegSection

func (l *MemBinlog) ReadLastSegSection(index uint64) ([]byte, string, uint64, uint64, error)

读取最后的segment

func (*MemBinlog) TruncateFront

func (l *MemBinlog) TruncateFront(index uint64) error

指定index 清空

func (*MemBinlog) Write

func (l *MemBinlog) Write(index uint64, data []byte) (fileName string, offset, blkLen uint64, err error)

写一个区块到内存中

Jump to

Keyboard shortcuts

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