Documentation
¶
Index ¶
- Constants
- Variables
- func ReadAt(f *os.File, ptr page.ValuePtr, verifyCRC bool) ([]byte, error)
- type File
- type Manager
- func (m *Manager) Acquire(set *Set)
- func (m *Manager) Close() error
- func (m *Manager) CurrentSet() *Set
- func (m *Manager) MarkZombie(id uint32) error
- func (m *Manager) Read(ptr page.ValuePtr) ([]byte, error)
- func (m *Manager) ReadUnsafe(ptr page.ValuePtr) ([]byte, error)
- func (m *Manager) Refresh() error
- func (m *Manager) Release(set *Set) error
- func (m *Manager) RemapStats() (remaps uint64, deadMappings uint64)
- func (m *Manager) RemoveSegment(id uint32) error
- func (m *Manager) SegmentPath(id uint32) string
- func (m *Manager) SetDisableReadChecksum(disable bool)
- type Reader
- type Record
- type Set
- type Writer
- func (w *Writer) Append(op byte, key, value []byte) (page.ValuePtr, error)
- func (w *Writer) AppendBatch(records []Record) ([]page.ValuePtr, error)
- func (w *Writer) Close() error
- func (w *Writer) FileID() uint32
- func (w *Writer) Flush() error
- func (w *Writer) RotateTo(path string, fileID uint32) error
- func (w *Writer) Size() int64
- func (w *Writer) Sync() error
Constants ¶
View Source
const ( OpSet = byte(0) OpDelete = byte(1) // HeaderSize: CRC(4) + KeyLen(2) + ValueLen(4) + Op(1) HeaderSize = 11 )
Variables ¶
View Source
var ( ErrCorrupt = errors.New("vlog: corrupt record") ErrRecordTooLarge = errors.New("vlog: record too large") ErrKeyTooLarge = errors.New("vlog: key too large") ErrValueTooLarge = errors.New("vlog: value too large") )
View Source
var MaxDeadMappings = 64
MaxDeadMappings caps the number of old mmaps retained to avoid exhausting vm.max_map_count. Set <= 0 to disable the cap.
Functions ¶
Types ¶
type File ¶
type File struct {
ID uint32
Path string
File *os.File
RefCount atomic.Int64
IsZombie atomic.Bool
// contains filtered or unexported fields
}
File represents a value-log segment on disk.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CurrentSet ¶
CurrentSet returns a snapshot of the current value-log files.
func (*Manager) MarkZombie ¶
func (*Manager) Release ¶
Release decrements the Set refcount and removes zombie files once unpinned.
func (*Manager) RemapStats ¶
RemapStats returns cumulative mmap remap counts across value-log files.
func (*Manager) RemoveSegment ¶
func (*Manager) SegmentPath ¶
func (*Manager) SetDisableReadChecksum ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) DisableChecksum ¶
func (r *Reader) DisableChecksum()
type Set ¶
type Set struct {
Files map[uint32]*File
RefCount atomic.Int64
// contains filtered or unexported fields
}
Set is an immutable snapshot of value-log files for snapshot isolation.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) AppendBatch ¶
Click to show internal directories.
Click to hide internal directories.