model

package
v0.0.0-...-50680d5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hint

type Hint struct {
	Value  []byte
	FileID int64
	Meta   *MetaData
}

Hint 内存中 Key 的映射

type LogEntry

type LogEntry struct {
	Key   []byte
	Value []byte

	Meta *MetaData
	// contains filtered or unexported fields
}

Entry 写入日志文件的操作记录实体

func (*LogEntry) Encode

func (e *LogEntry) Encode() []byte

func (*LogEntry) GetCrc

func (e *LogEntry) GetCrc(buf []byte) uint32

GetCrc 重新计算 Entry 的 crc 的校验值

func (*LogEntry) Size

func (e *LogEntry) Size() uint64

type MetaData

type MetaData struct {
	Timestamp uint64
	TTL       uint32
	Position  uint64
	KeySize   uint32
	ValueSize uint32
	OptType   uint16 //  表示日志记录的操作类型: SET / DELETE
}

MetaData 日志记录的元数据

Jump to

Keyboard shortcuts

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