kvmgr

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperTypeSetKv = iota + 1
	OperTypeDeleteKv
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KvMgr

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

func NewKvMgr

func NewKvMgr(db *kvdb.KvDB) (*KvMgr, error)

func (*KvMgr) Apply

func (t *KvMgr) Apply(ctx context.Context, operTypes []int32, datas [][]byte, contexts []base.ProposeContext) (err error)

func (*KvMgr) Delete

func (t *KvMgr) Delete(key string) (err error)

func (*KvMgr) Flush

func (t *KvMgr) Flush(ctx context.Context) error

Flush will flush memory data into persistent storage

func (*KvMgr) Get

func (t *KvMgr) Get(key string) (val []byte, err error)

func (*KvMgr) GetModuleName

func (t *KvMgr) GetModuleName() string

func (*KvMgr) List

func (t *KvMgr) List(opts *clustermgr.ListKvOpts) (ret *clustermgr.ListKvRet, err error)

func (*KvMgr) LoadData

func (t *KvMgr) LoadData(ctx context.Context) error

func (*KvMgr) NotifyLeaderChange

func (t *KvMgr) NotifyLeaderChange(ctx context.Context, leader uint64, host string)

Switch manager work when leader change

func (*KvMgr) Set

func (t *KvMgr) Set(key string, value []byte) (err error)

func (*KvMgr) SetModuleName

func (t *KvMgr) SetModuleName(module string)

type KvMgrAPI

type KvMgrAPI interface {
	Get(key string) (val []byte, err error)
	Set(key string, value []byte) (err error)
	List(opt *clustermgr.ListKvOpts) (ret *clustermgr.ListKvRet, err error)
	Delete(key string) (err error)
}

Jump to

Keyboard shortcuts

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