nv10

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0, MIT Imports: 42 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActorHeadKey

func ActorHeadKey(addr address.Address, head cid.Cid) string

func DeadlineKey

func DeadlineKey(dlCid cid.Cid) string

func MigrateStateTree

func MigrateStateTree(ctx context.Context, store cbor.IpldStore, actorsRootIn cid.Cid, priorEpoch abi.ChainEpoch, cfg Config, log Logger, cache MigrationCache) (cid.Cid, error)

Migrates the filecoin state tree starting from the global state tree and upgrading all actor state. The store must support concurrent writes (even if the configured worker count is 1).

func SectorsRootKey

func SectorsRootKey(sCid cid.Cid) string

Types

type Config

type Config struct {
	// Number of migration worker goroutines to run.
	// More workers enables higher CPU utilization doing migration computations (including state encoding)
	MaxWorkers uint
	// Capacity of the queue of jobs available to workers (zero for unbuffered).
	// A queue length of hundreds to thousands improves throughput at the cost of memory.
	JobQueueSize uint
	// Capacity of the queue receiving migration results from workers, for persisting (zero for unbuffered).
	// A queue length of tens to hundreds improves throughput at the cost of memory.
	ResultQueueSize uint
	// Time between progress logs to emit.
	// Zero (the default) results in no progress logs.
	ProgressLogPeriod time.Duration
}

Config parameterizes a state tree migration

type Logger

type Logger interface {
	// This is the same logging interface provided by the Runtime.
	Log(level rt.LogLevel, msg string, args ...interface{})
}

type MemMigrationCache

type MemMigrationCache struct {
	MigrationMap sync.Map
}

func NewMemMigrationCache

func NewMemMigrationCache() *MemMigrationCache

func (*MemMigrationCache) Clone added in v3.0.2

func (*MemMigrationCache) Load

func (m *MemMigrationCache) Load(key string, loadFunc func() (cid.Cid, error)) (cid.Cid, error)

func (*MemMigrationCache) Read

func (m *MemMigrationCache) Read(key string) (bool, cid.Cid, error)

func (*MemMigrationCache) Update added in v3.0.2

func (m *MemMigrationCache) Update(other *MemMigrationCache)

func (*MemMigrationCache) Write

func (m *MemMigrationCache) Write(key string, c cid.Cid) error

type MigrationCache

type MigrationCache interface {
	Write(key string, newCid cid.Cid) error
	Read(key string) (bool, cid.Cid, error)
	Load(key string, loadFunc func() (cid.Cid, error)) (cid.Cid, error)
}

MigrationCache stores and loads cached data. Its implementation must be threadsafe

type StringKey

type StringKey string

An adt.Map key that just preserves the underlying string.

func (StringKey) Key

func (k StringKey) Key() string

type TestLogger added in v3.1.0

type TestLogger struct {
	TB testing.TB
}

func (TestLogger) Log added in v3.1.0

func (t TestLogger) Log(_ rt.LogLevel, msg string, args ...interface{})

Jump to

Keyboard shortcuts

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