storage

package
v0.0.0-...-68c59ad Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  int = 1
	KB int = 1024
	MB int = 1024 * 1024
)
View Source
const (
	CurrentPath               = "./"
	DefaultLevel              = 7
	DefaultBlockSize          = 4
	DefaultTableSize          = 2
	DefaultLimitedFileNumOnL0 = 2
	DefaultTableSizeOffset    = 10
	DefaultLevelOnSkiplist    = 5
	DefaultMembtableSize      = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	// default directory path where placed files
	Path string

	// max level of files
	// start level is 0
	// the last level has unlimit number of files
	Level int

	// max block size on table
	BlockSize int

	// max L0 table size
	TableSize int

	// limited number of files on level
	// key is level, value is limited number
	// the last level has unlimit number of files
	LimitedFilesNumOnL0 int

	// offset of calculated table size whne inscrease level
	// if tableSize value is 10Mb and tableSizeOffset value is 10,
	// the Max L0 file size is 10Mb and L1 file size is 100Mb(10Mb * 10)
	TableSizeOffset int

	// max level value on skiplist
	LevelOnSkipList int

	// limited number of memtable
	MemTableSize int
}

func NewOption

func NewOption() Option

type Storage

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

func NewStorage

func NewStorage(option Option) *Storage

func (*Storage) Get

func (storage *Storage) Get(key string) []byte

func (*Storage) Remove

func (storage *Storage) Remove(key string)

func (*Storage) Set

func (storage *Storage) Set(key string, value []byte)

func (*Storage) Stop

func (storage *Storage) Stop()

Jump to

Keyboard shortcuts

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