Documentation ¶
Index ¶
- Variables
- type Compaction
- type Edit
- type FileList
- type FileMeta
- type LevelCompactPointer
- type LevelFileMeta
- type LevelFileNumber
- type Manifest
- func (m *Manifest) AddLiveFiles(files map[uint64]struct{}) map[uint64]struct{}
- func (m *Manifest) Append(tip *Version)
- func (m *Manifest) Apply(edit *Edit) error
- func (m *Manifest) Close() error
- func (m *Manifest) LastSequence() keys.Sequence
- func (m *Manifest) LoadLastSequence() keys.Sequence
- func (m *Manifest) Log(tip *Version, edit *Edit) (*Version, error)
- func (m *Manifest) LogFileNumber() uint64
- func (m *Manifest) ManifestFileNumber() uint64
- func (m *Manifest) MarkFileNumberUsed(number uint64)
- func (m *Manifest) NewFileNumber() (uint64, uint64)
- func (m *Manifest) NextFileNumber() uint64
- func (m *Manifest) ReuseFileNumber(number uint64)
- func (m *Manifest) StoreLastSequence(seq keys.Sequence)
- func (m *Manifest) Version() *Version
- type Version
- func (v *Version) AppendIterators(iters []iterator.Iterator, opts *options.ReadOptions) []iterator.Iterator
- func (v *Version) Get(ikey keys.InternalKey, opts *options.ReadOptions) ([]byte, LevelFileMeta, error)
- func (v *Version) NextOverlapingLevel(level int, start, limit []byte) int
- func (v *Version) OverlapLevel(level int, start, limit []byte) bool
- func (v *Version) PickCompactions(registry *compaction.Registry, pendingFiles []FileList, nextFileNumber uint64) []*Compaction
- func (v *Version) PickLevelForMemTableOutput(smallest, largest []byte) int
- func (v *Version) PickRangeCompaction(registry *compaction.Registry, level int, start, limit []byte) *Compaction
- func (v *Version) Release()
- func (v *Version) Retain() *Version
- func (v *Version) SeekOverlap(ikey keys.InternalKey, opts *options.ReadOptions) LevelFileMeta
- func (v *Version) SortFiles() error
- func (v *Version) String() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrCorruptEditTag = errors.New("corrupt version edit: tag") ErrCorruptEditLogNumber = errors.New("corrupt version edit: log number") ErrCorruptEditPrevLogNumber = errors.New("corrupt version edit: prev log number") ErrCorruptEditNextFileNumber = errors.New("corrupt version edit: next file number") ErrCorruptEditLastSequence = errors.New("corrupt version edit: last sequence") ErrCorruptEditCompactPointer = errors.New("corrupt version edit: compact pointer") ErrCorruptEditDeletedFile = errors.New("corrupt version edit: deleted file") ErrCorruptEditNewFile = errors.New("corrupt version edit: new file") ErrCorruptEditComparatorName = errors.New("corrupt version edit: comparator name") )
Functions ¶
This section is empty.
Types ¶
type Compaction ¶
type Compaction struct { Registration *compaction.Registration Level int Base *Version Inputs [2]FileList Grandparents FileList MaxOutputFileSize int64 NextCompactPointer keys.InternalKey }
func (*Compaction) IsTrivialMove ¶
func (c *Compaction) IsTrivialMove() bool
func (*Compaction) NewIterator ¶
func (c *Compaction) NewIterator() iterator.Iterator
type Edit ¶
type Edit struct { ComparatorName string LogNumber uint64 NextFileNumber uint64 LastSequence keys.Sequence CompactPointers []LevelCompactPointer AddedFiles []LevelFileMeta DeletedFiles []LevelFileNumber // contains filtered or unexported fields }
Edit records a sequence changes made to a version. New version can be constructed from old version and an Edit which records changes made to that version.
type FileList ¶
type FileList []*FileMeta
FileList represents a list of table files.
func (*FileList) DeleteFile ¶
DeleteFile deletes file `number` from files. Returns true if file exists in files, otherwise false. The order of files is undefined if it returns true.
func (FileList) SortByNewestFileNumber ¶
func (files FileList) SortByNewestFileNumber()
SortByNewestFileNumber sorts files by decreasing file number.
func (FileList) SortBySmallestKey ¶
SortBySmallestKey sorts files by increasing smallest key.
func (FileList) TotalFileSize ¶
TotalFileSize returns total file size from those files.
type FileMeta ¶
type FileMeta struct { Number uint64 Size uint64 Smallest keys.InternalKey Largest keys.InternalKey // contains filtered or unexported fields }
FileMeta contains meta info for a sorted table.
type LevelCompactPointer ¶
type LevelCompactPointer struct { Level int Largest keys.InternalKey }
type LevelFileMeta ¶
LevelFileMeta includes a file's meta data and its corresponding level.
type LevelFileNumber ¶
type Manifest ¶
type Manifest struct {
// contains filtered or unexported fields
}
func (*Manifest) AddLiveFiles ¶
func (*Manifest) LastSequence ¶
func (*Manifest) LoadLastSequence ¶
func (*Manifest) LogFileNumber ¶
func (*Manifest) ManifestFileNumber ¶
ManifestFileNumber returns current manifest number, possibly expired due to switching to new manifest file.
func (*Manifest) MarkFileNumberUsed ¶
func (*Manifest) NewFileNumber ¶
NewFileNumber returns a new file number and a next file number.
func (*Manifest) NextFileNumber ¶
func (*Manifest) ReuseFileNumber ¶
func (*Manifest) StoreLastSequence ¶
type Version ¶
type Version struct { // Levels[0], sorted from newest to oldest; // Levels[n], sorted from smallest to largest. Levels [configs.NumberLevels]FileList CompactionPointers [configs.NumberLevels]keys.InternalKey // contains filtered or unexported fields }
func (*Version) AppendIterators ¶
func (*Version) Get ¶
func (v *Version) Get(ikey keys.InternalKey, opts *options.ReadOptions) ([]byte, LevelFileMeta, error)
func (*Version) NextOverlapingLevel ¶
NextOverlappingLevel returns first overlapping level in range [level, maxLevel] with start and limit.
func (*Version) PickCompactions ¶
func (v *Version) PickCompactions(registry *compaction.Registry, pendingFiles []FileList, nextFileNumber uint64) []*Compaction
func (*Version) PickLevelForMemTableOutput ¶
func (*Version) PickRangeCompaction ¶
func (v *Version) PickRangeCompaction(registry *compaction.Registry, level int, start, limit []byte) *Compaction
func (*Version) SeekOverlap ¶
func (v *Version) SeekOverlap(ikey keys.InternalKey, opts *options.ReadOptions) LevelFileMeta