wal

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WAL

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

WAL Write-Ahead Log实现

func NewWAL

func NewWAL(path string) (*WAL, error)

NewWAL 创建新的WAL

func (*WAL) Close

func (w *WAL) Close() error

Close 关闭WAL

func (*WAL) Recover

func (w *WAL) Recover() ([]*types.Vector, []string, error)

Recover 从WAL恢复数据

func (*WAL) Truncate

func (w *WAL) Truncate() error

Truncate 清空WAL文件

func (*WAL) WriteBatch

func (w *WAL) WriteBatch(vectors []*types.Vector, ids []string) error

WriteBatch 写入批量操作记录

func (*WAL) WriteCheckpoint

func (w *WAL) WriteCheckpoint() error

WriteCheckpoint 写入检查点记录

func (*WAL) WriteDelete

func (w *WAL) WriteDelete(id string) error

WriteDelete 写入删除记录

func (*WAL) WriteInsert

func (w *WAL) WriteInsert(vec *types.Vector) error

WriteInsert 写入插入记录

type WALRecord

type WALRecord struct {
	Type      WALRecordType
	Timestamp int64
	Data      []byte
}

WALRecord WAL记录

type WALRecordType

type WALRecordType uint8

WALRecordType WAL记录类型

const (
	WALInsert WALRecordType = iota + 1
	WALDelete
	WALBatch
	WALCheckpoint
)

Jump to

Keyboard shortcuts

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