store

package module
v0.0.0-...-de123dd Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

kvstore

This repository contains the source of kvstore, a flexible associative data store based on string-sorted tables. It is supposed to be easily embeddable into any application.

What's working?

  • Basic table implementation
  • Index-based block access
  • Key filtering using bloom filters
  • Block level caching
  • Block level compression/decompression
  • Table-level access conflict resolution
  • Row-level access conflict resolution
  • Automatic memtable flushing on overflow
  • Automatic table merging on overflow using leveled compaction

Documentation

Index

Constants

View Source
const MaxMemSize = 2 << 25

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	Time  int64
	Value []byte
}

func (*Record) Bytes

func (record *Record) Bytes() []byte

func (*Record) FromBytes

func (record *Record) FromBytes(data []byte)

func (Record) String

func (record Record) String() string

type Store

type Store struct {
	Name string
	// contains filtered or unexported fields
}

func New

func New(name string) (*Store, error)

func (*Store) Close

func (store *Store) Close() error

func (*Store) Flush

func (store *Store) Flush() error

Flush replaces the active memtable with a new one and compacts the old one to disk. This can be done while serving entries from the flushed memtable as well as the active memtable and all other disk tables.

func (*Store) Get

func (store *Store) Get(key []byte) []*Record

func (*Store) MemSize

func (store *Store) MemSize() int64

func (*Store) Put

func (store *Store) Put(key []byte, record *Record) error

func (*Store) Restore

func (store *Store) Restore() error

Directories

Path Synopsis
cmd
index
Package index contains data structures to help cope with caches, indices and key filters.
Package index contains data structures to help cope with caches, indices and key filters.

Jump to

Keyboard shortcuts

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