cache

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachManager

func AttachManager(database db.Database, dir string, mem, file, stores int) db.Database

AttachManager attach cache manager to the database, and return it. dir is root directory for storing files for cache. mem is number of levels of tree items to store in the memory. file is number of levels of tree items to store in files. stores is number of stores to cache.

func EnableAccountNodeCacheByForce added in v0.9.7

func EnableAccountNodeCacheByForce(database db.Database, id []byte) bool

EnableAccountNodeCacheByForce enable AccountNodeCache ignoring default setting. Default setting for account node cache is specified by call in AttachManager.

func NewNodeCacheList added in v0.9.10

func NewNodeCacheList(sample, limit int, factory func(id string) *NodeCache) *nodeCacheList

Types

type BranchCache added in v0.9.10

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

func NewBranchCache added in v0.9.10

func NewBranchCache(depth int, fdepth int, path string) *BranchCache

func (*BranchCache) Get added in v0.9.10

func (c *BranchCache) Get(nibs []byte, h []byte) ([]byte, bool)

func (*BranchCache) OnAttach added in v0.9.10

func (c *BranchCache) OnAttach(id []byte) cacheImpl

func (*BranchCache) Put added in v0.9.10

func (c *BranchCache) Put(nibs []byte, h []byte, serialized []byte)

func (*BranchCache) String added in v0.9.10

func (c *BranchCache) String() string

type FullCache added in v0.9.10

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

func NewFullCache added in v0.9.10

func NewFullCache() *FullCache

func NewFullCacheFromBranch added in v0.9.10

func NewFullCacheFromBranch(bc *BranchCache) *FullCache

func (*FullCache) Get added in v0.9.10

func (c *FullCache) Get(nibs []byte, h []byte) ([]byte, bool)

func (*FullCache) OnAttach added in v0.9.10

func (c *FullCache) OnAttach(id []byte) cacheImpl

func (*FullCache) Put added in v0.9.10

func (c *FullCache) Put(nibs []byte, h, v []byte)

func (*FullCache) String added in v0.9.10

func (c *FullCache) String() string

type NodeCache

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

func AccountNodeCacheOf

func AccountNodeCacheOf(database db.Database, id []byte) *NodeCache

AccountNodeCacheOf get node cache of the account specified by *id*. If node cache for the account is not enabled, it returns nil.

func NewNodeCache

func NewNodeCache(depth int, fdepth int, path string) *NodeCache

func WorldNodeCacheOf

func WorldNodeCacheOf(database db.Database) *NodeCache

WorldNodeCacheOf get node cache of the world if it has. If node cache for world state is not enabled, it returns nil.

func (*NodeCache) Get

func (c *NodeCache) Get(nibs []byte, h []byte) ([]byte, bool)

func (*NodeCache) OnAttach added in v0.9.10

func (c *NodeCache) OnAttach(id []byte) *NodeCache

func (*NodeCache) Put

func (c *NodeCache) Put(nibs []byte, h []byte, serialized []byte)

func (*NodeCache) String added in v0.9.10

func (c *NodeCache) String() string

Jump to

Keyboard shortcuts

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