chain_flusher

package
v2.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: GPL-3.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flusher

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

func NewFlusher

func NewFlusher(storeList []Storage, flushMu *sync.RWMutex, chainDir string) (*Flusher, error)

func (*Flusher) Abort

func (flusher *Flusher) Abort()

func (*Flusher) Close

func (flusher *Flusher) Close() error

func (*Flusher) Flush

func (flusher *Flusher) Flush()

force to flush synchronously

func (*Flusher) LoadRedo

func (flusher *Flusher) LoadRedo(fd *os.File) ([][]byte, []Storage, error)

func (*Flusher) Recover

func (flusher *Flusher) Recover() error

func (*Flusher) ReplaceStore

func (flusher *Flusher) ReplaceStore(id types.Hash, store Storage)

func (*Flusher) Start

func (flusher *Flusher) Start()

func (*Flusher) Stop

func (flusher *Flusher) Stop()

type Storage

type Storage interface {
	Id() types.Hash

	Prepare()

	CancelPrepare()

	RedoLog() ([]byte, error)

	Commit() error

	AfterCommit()

	BeforeRecover([]byte)

	AfterRecover()

	PatchRedoLog([]byte) error
}

Jump to

Keyboard shortcuts

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