mavl

package
v6.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package mavl 默克尔平衡树接口

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disable log

func New

func New(cfg *types.Store, sub []byte) queue.Module

New new mavl store module

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel set log level

Types

type Store

type Store struct {
	*drivers.BaseStore
	// contains filtered or unexported fields
}

Store mavl store struct

func (*Store) Close

func (mavls *Store) Close()

Close close mavl store

func (*Store) Commit

func (mavls *Store) Commit(req *types.ReqHash) ([]byte, error)

Commit convert memcory mavl to storage db

func (*Store) Del

func (mavls *Store) Del(req *types.StoreDel) ([]byte, error)

Del ...

func (*Store) Get

func (mavls *Store) Get(datas *types.StoreGet) [][]byte

Get get values by keys

func (*Store) IterateRangeByStateHash

func (mavls *Store) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, fn func(key, value []byte) bool)

IterateRangeByStateHash 迭代实现功能; statehash:当前状态hash, start:开始查找的key, end: 结束的key, ascending:升序,降序, fn 迭代回调函数

func (*Store) MemSet

func (mavls *Store) MemSet(datas *types.StoreSet, sync bool) ([]byte, error)

MemSet set keys values to memcory mavl, return root hash and error

func (*Store) ProcEvent

func (mavls *Store) ProcEvent(msg queue.Message)

ProcEvent not support message

func (*Store) Rollback

func (mavls *Store) Rollback(req *types.ReqHash) ([]byte, error)

Rollback 回退将缓存的mavl树删除掉

func (*Store) Set

func (mavls *Store) Set(datas *types.StoreSet, sync bool) ([]byte, error)

Set set k v to mavl store db; sync is true represent write sync

Directories

Path Synopsis
db
Package mavl 默克尔平衡树算法实现以及裁剪
Package mavl 默克尔平衡树算法实现以及裁剪
tool
package main 用于测试数据库中的MAVL节点数目
package main 用于测试数据库中的MAVL节点数目

Jump to

Keyboard shortcuts

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