cachev1

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeDBinFilename

func ComputeDBinFilename(startBlock, stopBlock uint64) string

func ComputeStartBlock

func ComputeStartBlock(startBlock uint64, saveBlockInterval uint64) uint64

func NewEngine

func NewEngine(runtimeConfig config.RuntimeConfig, logger *zap.Logger) (execout.CacheEngine, error)

Types

type CacheItem

type CacheItem struct {
	BlockNum  uint64                 `json:"block_num"`
	BlockID   string                 `json:"block_id"`
	Payload   []byte                 `json:"payload"`
	Timestamp *timestamppb.Timestamp `json:"timestamp"`
	Cursor    string                 `json:"cursor"`
}

type Engine

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

func (*Engine) Close

func (e *Engine) Close() error

func (*Engine) EndOfStream

func (e *Engine) EndOfStream(blockNum uint64) error

func (*Engine) HandleFinal

func (e *Engine) HandleFinal(clock *pbsubstreams.Clock) error

func (*Engine) HandleUndo

func (e *Engine) HandleUndo(clock *pbsubstreams.Clock, moduleName string)

func (*Engine) Init

func (e *Engine) Init(modules *manifest.ModuleHashes) error

func (*Engine) NewExecOutput

func (e *Engine) NewExecOutput(blockType string, block *bstream.Block, clock *pbsubstreams.Clock, cursor *bstream.Cursor) (execout.ExecutionOutput, error)

type ExecOutputCache

type ExecOutputCache struct {
	*execout.ExecOutputMap
	// contains filtered or unexported fields
}

func (*ExecOutputCache) Get

func (e *ExecOutputCache) Get(moduleName string) (value []byte, cached bool, err error)

assert_test_store_delete_prefix

func (*ExecOutputCache) Set

func (e *ExecOutputCache) Set(moduleName string, value []byte) (err error)

type OutputCache

type OutputCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewOutputCache

func NewOutputCache(moduleName string, store dstore.Store, saveBlockInterval uint64, logger *zap.Logger, wg *sync.WaitGroup) *OutputCache

func (*OutputCache) Delete

func (c *OutputCache) Delete(blockID string)

func (*OutputCache) Get

func (c *OutputCache) Get(clock *pbsubstreams.Clock) ([]byte, bool)

func (*OutputCache) GetAtBlock

func (c *OutputCache) GetAtBlock(blockNumber uint64) ([]byte, bool)

func (*OutputCache) ListCacheRanges

func (c *OutputCache) ListCacheRanges(ctx context.Context) (block.Ranges, error)

func (*OutputCache) ListContinuousCacheRanges

func (c *OutputCache) ListContinuousCacheRanges(ctx context.Context, from uint64) (block.Ranges, error)

func (*OutputCache) Load

func (c *OutputCache) Load(ctx context.Context, blockRange *block.Range) error

func (*OutputCache) LoadAtBlock

func (c *OutputCache) LoadAtBlock(ctx context.Context, atBlock uint64) (found bool, err error)

func (*OutputCache) MarshalLogObject

func (c *OutputCache) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*OutputCache) Set

func (c *OutputCache) Set(clock *pbsubstreams.Clock, cursor string, data []byte) error

func (*OutputCache) SortedCacheItems

func (c *OutputCache) SortedCacheItems() (out []*CacheItem)

func (*OutputCache) String

func (c *OutputCache) String() string

Jump to

Keyboard shortcuts

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