trie_gc

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBKP_CLEARED_HEIGHT  = byte(1)
	DBKP_MARKED_HEIGHT   = byte(2)
	DBKP_MARKED_HASHLIST = byte(3)
)
View Source
const (
	STATUS_STOPPED              = 1
	STATUS_STARTED              = 2
	STATUS_MARKING_AND_CLEANING = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	GetLatestSnapshotBlock() *ledger.SnapshotBlock
	GetSnapshotBlocksByHeight(height uint64, count uint64, forward bool, containSnapshotContent bool) ([]*ledger.SnapshotBlock, error)
	GetLatestBlockEventId() (uint64, error)
	GetAccountBlockByHash(blockHash *types.Hash) (*ledger.AccountBlock, error)
	GetSnapshotBlockByHash(hash *types.Hash) (*ledger.SnapshotBlock, error)
	GetEvent(eventId uint64) (byte, []types.Hash, error)
	ChainDb() *chain_db.ChainDb
	GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error)
	TrieDb() *leveldb.DB
	CleanTrieNodePool()

	StopSaveTrie()
	StartSaveTrie()
}

type Collector

type Collector interface {
	Start()
	Stop()
	Status() uint8
}

func NewCollector

func NewCollector(chain Chain, ledgerGcRetain uint64) Collector

type Marker

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

func NewMarker

func NewMarker(chain Chain, retainSnapshotHeight uint64) *Marker

func (*Marker) MarkAndClean

func (m *Marker) MarkAndClean(terminal <-chan struct{}) error

Jump to

Keyboard shortcuts

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