executor

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: 19 Imported by: 14

Documentation

Overview

Package executor 实现执行器模块基类功能

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMVCC

func AddMVCC(db dbm.KVDB, detail *types.BlockDetail) (kvlist []*types.KeyValue)

AddMVCC convert key value to mvcc kv data

func DelMVCC

func DelMVCC(db dbm.KVDB, detail *types.BlockDetail) (kvlist []*types.KeyValue)

DelMVCC convert key value to mvcc kv data

func DisableLog

func DisableLog()

DisableLog disable log

func NewLocalDB

func NewLocalDB(client queue.Client) db.KVDB

NewLocalDB new local db

func NewStateDB

func NewStateDB(client queue.Client, stateHash []byte, localdb db.KVDB, opt *StateDBOption) db.KV

NewStateDB new state db

func RegisterPlugin

func RegisterPlugin(name string, p plugin)

RegisterPlugin register plugin

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel set log level

Types

type Executor

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

Executor executor struct

func New

func New(cfg *types.Exec, sub map[string][]byte) *Executor

New new executor

func (*Executor) Close

func (exec *Executor) Close()

Close close executor

func (*Executor) SetQueueClient

func (exec *Executor) SetQueueClient(qcli queue.Client)

SetQueueClient set client queue, for recv msg

func (*Executor) Wait

func (exec *Executor) Wait()

Wait Executor ready

type LocalDB

type LocalDB struct {
	db.TransactionDB
	// contains filtered or unexported fields
}

LocalDB local db for store key value in local

func (*LocalDB) BatchGet

func (l *LocalDB) BatchGet(keys [][]byte) (values [][]byte, err error)

BatchGet batch get values from local db

func (*LocalDB) Get

func (l *LocalDB) Get(key []byte) ([]byte, error)

Get get value from local db

func (*LocalDB) List

func (l *LocalDB) List(prefix, key []byte, count, direction int32) ([][]byte, error)

List 从数据库中查询数据列表,set 中的cache 更新不会影响这个list

func (*LocalDB) PrefixCount

func (l *LocalDB) PrefixCount(prefix []byte) (count int64)

PrefixCount 从数据库中查询指定前缀的key的数量

func (*LocalDB) Set

func (l *LocalDB) Set(key []byte, value []byte) error

Set set key value to local db

type StateDB

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

StateDB state db for store mavl

func (*StateDB) BatchGet

func (s *StateDB) BatchGet(keys [][]byte) (values [][]byte, err error)

BatchGet batch get keys from state db

func (*StateDB) Begin

func (s *StateDB) Begin()

Begin 开启内存事务处理

func (*StateDB) Commit

func (s *StateDB) Commit()

Commit canche tx

func (*StateDB) Get

func (s *StateDB) Get(key []byte) ([]byte, error)

Get get value from state db

func (*StateDB) GetSetKeys

func (s *StateDB) GetSetKeys() (keys []string)

GetSetKeys get state db set keys

func (*StateDB) Rollback

func (s *StateDB) Rollback()

Rollback reset tx

func (*StateDB) Set

func (s *StateDB) Set(key []byte, value []byte) error

Set set key value to state db

func (*StateDB) StartTx

func (s *StateDB) StartTx()

StartTx reset state db keys

type StateDBOption

type StateDBOption struct {
	EnableMVCC bool
	Height     int64
}

StateDBOption state db option enable mvcc

Jump to

Keyboard shortcuts

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