raftbadger

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

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

Go to latest
Published: Nov 15, 2017 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

raftbadger

Raft backend implementation using Badger

benchmarks

On my MacbookAir (11-inch, Early 2014)

BenchmarkBadgerStore_FirstIndex-4         300000          4494 ns/op
BenchmarkBadgerStore_LastIndex-4          300000          4743 ns/op
BenchmarkBadgerStore_GetLog-4             300000          3814 ns/op
BenchmarkBadgerStore_StoreLog-4            10000        180024 ns/op
BenchmarkBadgerStore_StoreLogs-4            5000        343946 ns/op
BenchmarkBadgerStore_DeleteRange-4          5000        250139 ns/op
BenchmarkBadgerStore_Set-4                 10000        175970 ns/op
BenchmarkBadgerStore_Get-4               1000000          1146 ns/op
BenchmarkBadgerStore_SetUint64-4           10000        182825 ns/op
BenchmarkBadgerStore_GetUint64-4         1000000          1273 ns/op
BenchmarkBoltStore_FirstIndex-4      1000000          1081 ns/op
BenchmarkBoltStore_LastIndex-4       1000000          1016 ns/op
BenchmarkBoltStore_GetLog-4           500000          3494 ns/op
BenchmarkBoltStore_StoreLog-4           3000        340762 ns/op
BenchmarkBoltStore_StoreLogs-4          3000        421707 ns/op
BenchmarkBoltStore_DeleteRange-4        5000        341560 ns/op
BenchmarkBoltStore_Set-4                5000        321252 ns/op
BenchmarkBoltStore_Get-4             1000000          1209 ns/op
BenchmarkBoltStore_SetUint64-4          5000        312685 ns/op
BenchmarkBoltStore_GetUint64-4       1000000          1205 ns/op

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound = badger.ErrKeyNotFound
)

Functions

This section is empty.

Types

type BadgerOption

type BadgerOption func(*badger.Options)

func Compact

func Compact(b bool) BadgerOption

type BadgerStore

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

func NewBadgerStore

func NewBadgerStore(dir string, opt ...BadgerOption) (*BadgerStore, error)

func (*BadgerStore) Close

func (b *BadgerStore) Close() error

func (*BadgerStore) DeleteRange

func (b *BadgerStore) DeleteRange(min, max uint64) error

func (*BadgerStore) FirstIndex

func (b *BadgerStore) FirstIndex() (uint64, error)

func (*BadgerStore) Get

func (b *BadgerStore) Get(key []byte) ([]byte, error)

func (*BadgerStore) GetLog

func (b *BadgerStore) GetLog(idx uint64, log *raft.Log) error

func (*BadgerStore) GetUint64

func (b *BadgerStore) GetUint64(key []byte) (uint64, error)

func (*BadgerStore) LastIndex

func (b *BadgerStore) LastIndex() (uint64, error)

func (*BadgerStore) Set

func (b *BadgerStore) Set(key, val []byte) error

func (*BadgerStore) SetUint64

func (b *BadgerStore) SetUint64(key []byte, val uint64) error

func (*BadgerStore) StoreLog

func (b *BadgerStore) StoreLog(log *raft.Log) error

func (*BadgerStore) StoreLogs

func (b *BadgerStore) StoreLogs(logs []*raft.Log) error

Jump to

Keyboard shortcuts

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