Documentation
¶
Index ¶
- Constants
- Variables
- func Concat(xs ...string) string
- func CreateFile(path string) (*os.File, error)
- func EnsureDir(path string) error
- func ListDir[T any](path string, mut func(string) (T, bool)) ([]T, error)
- func Max(a, b []byte) []byte
- func Min(a, b []byte) []byte
- type DbOp
- type InnerStorage
- type InnerStorageIterator
- type InternalKey
- func (ik *InternalKey) Compare(other *InternalKey) int
- func (ik *InternalKey) Equal(other *InternalKey) bool
- func (ik *InternalKey) GetMeta() KeyMeta
- func (ik *InternalKey) GetSize() int
- func (ik *InternalKey) Kind() uint8
- func (ik *InternalKey) SeqNum() uint64
- func (ik *InternalKey) Serialize() []byte
- func (ik *InternalKey) SoftCompare(other *InternalKey) int
- func (ik *InternalKey) SoftEqual(other *InternalKey) bool
- func (ik *InternalKey) String() string
- type Iterator
- type KeyMeta
Constants ¶
View Source
const ( MAX_MEMTABLE_THRESHOLD = 1 * (1 << 20) MAX_SINK_SIZE = 8 SST_DIR = "sst" WAL = "wal" MANIFEST = "MANIFEST" )
View Source
const MetaLen = 8
Variables ¶
View Source
var ( EndOfIterator = errors.New("out of records") ErrKeyNotFound = errors.New("key not found") ErrPathFile = errors.New("provied path points to a file instead of directory") ErrKeyAlreadyExists = errors.New("key already exists") ErrIteratorExhausted = errors.New("iterator exhausted") )
View Source
var TOMBSTONE []byte
Functions ¶
Types ¶
type InnerStorage ¶
type InnerStorage interface { Set(uKey *InternalKey, value []byte) error Get(key []byte) ([]byte, bool) GetSize() uint64 NewIter() InnerStorageIterator }
type InnerStorageIterator ¶
type InnerStorageIterator interface { Valid() bool Next() (*InternalKey, []byte) }
type InternalKey ¶
func DeserializeKey ¶
func DeserializeKey(key []byte) *InternalKey
func NewInternalKey ¶
func NewInternalKey(ukey []byte, seqNum uint64, kind DbOp) *InternalKey
func SearchInternalKey ¶
func SearchInternalKey(key []byte) *InternalKey
func (*InternalKey) Compare ¶
func (ik *InternalKey) Compare(other *InternalKey) int
func (*InternalKey) Equal ¶
func (ik *InternalKey) Equal(other *InternalKey) bool
func (*InternalKey) GetMeta ¶
func (ik *InternalKey) GetMeta() KeyMeta
func (*InternalKey) GetSize ¶
func (ik *InternalKey) GetSize() int
func (*InternalKey) Kind ¶
func (ik *InternalKey) Kind() uint8
func (*InternalKey) SeqNum ¶
func (ik *InternalKey) SeqNum() uint64
func (*InternalKey) Serialize ¶
func (ik *InternalKey) Serialize() []byte
func (*InternalKey) SoftCompare ¶
func (ik *InternalKey) SoftCompare(other *InternalKey) int
func (*InternalKey) SoftEqual ¶
func (ik *InternalKey) SoftEqual(other *InternalKey) bool
func (*InternalKey) String ¶
func (ik *InternalKey) String() string
type Iterator ¶
type Iterator interface { Next() (*InternalKey, []byte, error) Key() *InternalKey Valid() bool Value() []byte SeekToFirst() (*InternalKey, []byte, error) }
Click to show internal directories.
Click to hide internal directories.