lib

package
v0.0.0-...-967259b Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiskKV

func NewDiskKV(clusterID uint64, nodeID uint64) sm.IOnDiskStateMachine

Types

type DiskKV

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

func (*DiskKV) Close

func (d *DiskKV) Close() error

func (*DiskKV) Lookup

func (d *DiskKV) Lookup(key interface{}) (interface{}, error)

func (*DiskKV) Open

func (d *DiskKV) Open(stopc <-chan struct{}) (uint64, error)

Open Open打开状态机并返回最后一个Raft Log条目的索引

func (*DiskKV) PrepareSnapshot

func (d *DiskKV) PrepareSnapshot() (interface{}, error)

PrepareSnapshot 准备快照

func (*DiskKV) RecoverFromSnapshot

func (d *DiskKV) RecoverFromSnapshot(reader io.Reader, i <-chan struct{}) error

func (*DiskKV) SaveSnapshot

func (d *DiskKV) SaveSnapshot(ctx interface{}, w io.Writer, i2 <-chan struct{}) error

func (*DiskKV) Sync

func (d *DiskKV) Sync() error

Sync 同步会同步状态机的所有内核状态。自更新以来

func (*DiskKV) Update

func (d *DiskKV) Update(entries []sm.Entry) ([]sm.Entry, error)

type KVData

type KVData struct {
	Key string
	Val string
}

Jump to

Keyboard shortcuts

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