kvdb

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 2 Imported by: 15

Documentation

Index

Constants

View Source
const IdealBatchSize = 100 * 1024

IdealBatchSize defines the size of the data batches should ideally add in one write.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch interface {
	Writer

	// ValueSize retrieves the amount of data queued up for writing.
	ValueSize() int

	// Write flushes any accumulated data to disk.
	Write() error

	// Reset resets the batch for reuse.
	Reset()

	// Replay replays the batch contents.
	Replay(w Writer) error
}

Batch is a write-only database that commits changes to its host database when Write is called. A batch cannot be used concurrently.

type Batcher

type Batcher interface {
	// NewBatch creates a write-only database that buffers changes to its host db
	// until a final write is called.
	NewBatch() Batch
}

Batcher wraps the NewBatch method of a backing data store.

type DBProducer

type DBProducer interface {
	// OpenDB or create db with name.
	OpenDB(name string) (DropableStore, error)
}

DBProducer represents real db producer.

type DropableStore

type DropableStore interface {
	Store
	Droper
}

DropableStore is Droper + Store

type Droper

type Droper interface {
	Drop()
}

Droper is able to delete the DB.

type FlushableDBProducer

type FlushableDBProducer interface {
	DBProducer
	NotFlushedSizeEst() int
	Flush(id []byte) error
}

type FlushableKVStore

type FlushableKVStore interface {
	DropableStore

	NotFlushedPairs() int
	NotFlushedSizeEst() int
	Flush() error
	DropNotFlushed()
}

FlushableKVStore contains all the method for flushable databases, i.e. databases which write changes on disk only on flush.

type IterableDBProducer

type IterableDBProducer interface {
	DBProducer
	// Names of existing databases.
	Names() []string
}

type Iteratee

type Iteratee interface {
	// NewIterator creates a binary-alphabetical iterator over a subset
	// of database content with a particular key prefix, starting at a particular
	// initial key (or after, if it does not exist).
	NewIterator(prefix []byte, start []byte) Iterator
}

Iteratee wraps the NewIterator methods of a backing data store.

type Iterator

type Iterator interface {
	ethdb.Iterator
}

Iterator iterates over a database's key/value pairs in ascending key order.

type Reader

type Reader interface {
	ethdb.KeyValueReader
}

Reader wraps the Has and get method of a backing data store.

type ReadonlyStore

type ReadonlyStore interface {
	Reader
	Iteratee
	ethdb.Stater
}

ReadonlyStore contains only reading methods of Store.

type Store

Store contains all the methods required to allow handling different key-value data stores backing the high level database.

type Writer

type Writer interface {
	ethdb.KeyValueWriter
}

Writer wraps the Put method of a backing data store.

Directories

Path Synopsis
Package leveldb implements the key-value database layer based on LevelDB.
Package leveldb implements the key-value database layer based on LevelDB.
Package memorydb implements the key-value database layer based on memory maps.
Package memorydb implements the key-value database layer based on memory maps.

Jump to

Keyboard shortcuts

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