statedb_cache

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StateDBCacheBatch

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

func (*StateDBCacheBatch) Delete

func (b *StateDBCacheBatch) Delete(key []byte) error

func (*StateDBCacheBatch) Put

func (b *StateDBCacheBatch) Put(key []byte, value []byte) error

func (*StateDBCacheBatch) Replay

func (*StateDBCacheBatch) Reset

func (b *StateDBCacheBatch) Reset()

func (*StateDBCacheBatch) ValueSize

func (b *StateDBCacheBatch) ValueSize() int

func (*StateDBCacheBatch) Write

func (b *StateDBCacheBatch) Write() (err error)

type StateDBCacheConfig

type StateDBCacheConfig struct {
	CacheSizeInMB        uint32
	CachePersistencePath string
	RedisServerAddr      []string
	RedisLRUTimeInDay    uint32
	DebugHitRate         bool
}

type StateDBCacheDatabase

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

func NewStateDBCacheDatabase

func NewStateDBCacheDatabase(remoteDB common.TiKVStore, config StateDBCacheConfig, readOnly bool) (*StateDBCacheDatabase, error)

func (*StateDBCacheDatabase) AncientDatadir

func (c *StateDBCacheDatabase) AncientDatadir() (string, error)

func (*StateDBCacheDatabase) Close

func (c *StateDBCacheDatabase) Close() error

Close disconnect the redis and save memory cache to file

func (*StateDBCacheDatabase) Compact

func (c *StateDBCacheDatabase) Compact(start []byte, limit []byte) error

func (*StateDBCacheDatabase) Delete

func (c *StateDBCacheDatabase) Delete(key []byte) (err error)

Delete removes the key from the key-value data store.

func (*StateDBCacheDatabase) Get

func (c *StateDBCacheDatabase) Get(key []byte) (ret []byte, err error)

Get retrieves the given key if it's present in the key-value data store.

func (*StateDBCacheDatabase) Has

func (c *StateDBCacheDatabase) Has(key []byte) (bool, error)

Has retrieves if a key is present in the key-value data store.

func (*StateDBCacheDatabase) NewBatch

func (c *StateDBCacheDatabase) NewBatch() ethdb.Batch

NewBatch creates a write-only database that buffers changes to its host db until a final write is called.

func (*StateDBCacheDatabase) NewBatchWithSize

func (c *StateDBCacheDatabase) NewBatchWithSize(size int) ethdb.Batch

func (*StateDBCacheDatabase) NewIterator

func (c *StateDBCacheDatabase) NewIterator(start, end []byte) ethdb.Iterator

func (*StateDBCacheDatabase) Put

func (c *StateDBCacheDatabase) Put(key []byte, value []byte) (err error)

Put inserts the given value into the key-value data store.

func (*StateDBCacheDatabase) ReplayCache

func (c *StateDBCacheDatabase) ReplayCache(batch ethdb.Batch) error

func (*StateDBCacheDatabase) Stat

func (c *StateDBCacheDatabase) Stat(property string) (string, error)

Stat returns a particular internal stat of the database.

Jump to

Keyboard shortcuts

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