binlog

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 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 add next time
	//  @Description:
	//  @return error
	Close() error

	// TruncateFront add next time
	//  @Description:
	//  @param index
	//  @return error
	TruncateFront(index uint64) error

	// ReadLastSegSection add next time
	//  @Description:
	//  @param index
	//  @return data
	//  @return fileName
	//  @return offset
	//  @return blkLen
	//  @return err
	ReadLastSegSection(index uint64) (data []byte, fileName string, offset, blkLen uint64, err error)

	// LastIndex add next time
	//  @Description:
	//  @return index
	//  @return err
	LastIndex() (index uint64, err error)

	// Write add next time
	//  @Description:
	//  @param index
	//  @param data
	//  @return fileName
	//  @return offset
	//  @return blkLen
	//  @return err
	Write(index uint64, data []byte) (fileName string, offset, blkLen uint64, err error)

	// ReadFileSection read data,according to file index
	//  @Description:
	//  @param fiIndex
	//  @return []byte
	//  @return error
	ReadFileSection(fiIndex *storePb.StoreInfo) ([]byte, error)
}

BinLogger add next time @Description:

type MemBinlog

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

MemBinlog add next time

@Description:

func NewMemBinlog

func NewMemBinlog(log protocol.Logger) *MemBinlog

NewMemBinlog 创建一个内存binlog

@Description:
@param log
@return *MemBinlog

func (*MemBinlog) Close

func (l *MemBinlog) Close() error

Close 关闭

@Description:
@receiver l
@return error

func (*MemBinlog) LastIndex

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

LastIndex 返回最后写入的索引

@Description:
@receiver l
@return uint64
@return error

func (*MemBinlog) ReadFileSection

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

ReadFileSection 根据索引,读取对应数据

@Description:
@receiver l
@param fiIndex
@return []byte
@return error

func (*MemBinlog) ReadLastSegSection

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

ReadLastSegSection 读取最后的segment

@Description:
@receiver l
@param index
@return []byte
@return string
@return uint64
@return uint64
@return error

func (*MemBinlog) TruncateFront

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

TruncateFront 指定index 清空

@Description:
@receiver l
@param index
@return error

func (*MemBinlog) Write

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

Write 写一个区块到内存中

@Description:
@receiver l
@param index
@param data
@return fileName
@return offset
@return blkLen
@return err

Jump to

Keyboard shortcuts

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