Documentation
¶
Index ¶
- Variables
- func RunModule(ctx context.Context, executor ModuleExecutor, ...) (*pbssinternal.ModuleOutput, []byte, []byte, bool, bool, error)
- type BaseExecutor
- type ErrorExecutor
- type ExecutionStages
- type Graph
- func (g *Graph) AncestorsFrom(moduleName string) []string
- func (g *Graph) IsOutputModule(name string) bool
- func (g *Graph) LowestInitBlock() uint64
- func (g *Graph) LowestStoresInitBlock() *uint64
- func (g *Graph) ModuleHashes() map[string]string
- func (g *Graph) ModulesInitBlocks() map[string]uint64
- func (g *Graph) OutputModule() *pbsubstreams.Module
- func (g *Graph) OutputModuleStageIndex() int
- func (g *Graph) SchedulableModuleNames() []string
- func (g *Graph) StagedUsedModules() ExecutionStages
- func (g *Graph) Stores() []*pbsubstreams.Module
- func (g *Graph) UsedIndexModules() []*pbsubstreams.Module
- func (g *Graph) UsedIndexesModulesUpToStage(stage int) (out []*pbsubstreams.Module)
- func (g *Graph) UsedModules() []*pbsubstreams.Module
- func (g *Graph) UsedModulesUpToStage(stage int) (out []*pbsubstreams.Module)
- func (g *Graph) UsedStoreModules() []*pbsubstreams.Module
- func (g *Graph) ValidateRequestStartBlock(requestStartBlockNum uint64) error
- type IndexModuleExecutor
- type LayerModules
- type MapperModuleExecutor
- type ModuleExecutor
- type SharedCache
- type StageLayers
- type StoreModuleExecutor
- type UndoManager
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBlockUndo = errors.New("block undone")
View Source
var ErrNoInput = errors.New("no input")
var Timer time.Duration
View Source
var ErrSkippableOutput = errors.New("skippable output") // willfully skippable output (through intrinsic)
View Source
var MaxUndoneBlocksSize = 100
Functions ¶
func RunModule ¶
func RunModule(ctx context.Context, executor ModuleExecutor, execOutput execout.ExecutionOutputGetter, cachable bool) (*pbssinternal.ModuleOutput, []byte, []byte, bool, bool, error)
RunModule returns:
- moduleOutput: the structured data
- outputBytes: the marshalled version of moduleOutput
- outputBytesFiles: the marshalled bytes to be sent to a file,
- skippedExecution: an indication that execution was not performed (skipped from index or skipped because it has no input -- cached data does not count as skipped, but marks the moduleOuput as 'Cached')
- skippableOutput: an indication that the output can be skipped
- error: an error
Types ¶
type BaseExecutor ¶
type BaseExecutor struct {
// contains filtered or unexported fields
}
func NewBaseExecutor ¶
func (*BaseExecutor) BlockIndex ¶ added in v1.6.0
func (e *BaseExecutor) BlockIndex() *index.BlockIndex
func (*BaseExecutor) Close ¶ added in v1.1.5
func (e *BaseExecutor) Close(ctx context.Context) error
func (*BaseExecutor) RunsOnBlock ¶ added in v1.6.0
func (e *BaseExecutor) RunsOnBlock(blockNum uint64) bool
type ErrorExecutor ¶
type ErrorExecutor struct {
// contains filtered or unexported fields
}
func (*ErrorExecutor) Error ¶
func (e *ErrorExecutor) Error() string
type ExecutionStages ¶ added in v1.6.0
type ExecutionStages []StageLayers
A list of units that we can schedule, that might include some mappers and a store, or the last module could be an exeuction layer with only a map.
func (ExecutionStages) LastStage ¶ added in v1.6.0
func (e ExecutionStages) LastStage() StageLayers
type Graph ¶ added in v1.6.0
type Graph struct {
// contains filtered or unexported fields
}
func NewOutputModuleGraph ¶ added in v1.6.0
func TestGraphStagedModules ¶ added in v1.6.0
func (*Graph) AncestorsFrom ¶ added in v1.6.0
func (*Graph) IsOutputModule ¶ added in v1.6.0
func (*Graph) LowestInitBlock ¶ added in v1.6.0
func (*Graph) LowestStoresInitBlock ¶ added in v1.6.0
func (*Graph) ModuleHashes ¶ added in v1.6.0
func (*Graph) ModulesInitBlocks ¶ added in v1.6.0
func (*Graph) OutputModule ¶ added in v1.6.0
func (g *Graph) OutputModule() *pbsubstreams.Module
func (*Graph) OutputModuleStageIndex ¶ added in v1.8.0
func (*Graph) SchedulableModuleNames ¶ added in v1.6.0
func (*Graph) StagedUsedModules ¶ added in v1.6.0
func (g *Graph) StagedUsedModules() ExecutionStages
func (*Graph) Stores ¶ added in v1.6.0
func (g *Graph) Stores() []*pbsubstreams.Module
func (*Graph) UsedIndexModules ¶ added in v1.6.0
func (g *Graph) UsedIndexModules() []*pbsubstreams.Module
func (*Graph) UsedIndexesModulesUpToStage ¶ added in v1.6.0
func (g *Graph) UsedIndexesModulesUpToStage(stage int) (out []*pbsubstreams.Module)
func (*Graph) UsedModules ¶ added in v1.6.0
func (g *Graph) UsedModules() []*pbsubstreams.Module
func (*Graph) UsedModulesUpToStage ¶ added in v1.6.0
func (g *Graph) UsedModulesUpToStage(stage int) (out []*pbsubstreams.Module)
func (*Graph) UsedStoreModules ¶ added in v1.17.9
func (g *Graph) UsedStoreModules() []*pbsubstreams.Module
func (*Graph) ValidateRequestStartBlock ¶ added in v1.6.0
type IndexModuleExecutor ¶ added in v1.6.0
type IndexModuleExecutor struct {
BaseExecutor
}
func NewIndexModuleExecutor ¶ added in v1.6.0
func NewIndexModuleExecutor(baseExecutor *BaseExecutor) *IndexModuleExecutor
func (*IndexModuleExecutor) HasOutputForFiles ¶ added in v1.6.0
func (i *IndexModuleExecutor) HasOutputForFiles() bool
func (*IndexModuleExecutor) HasValidOutput ¶ added in v1.6.0
func (i *IndexModuleExecutor) HasValidOutput() bool
func (*IndexModuleExecutor) Name ¶ added in v1.6.0
func (i *IndexModuleExecutor) Name() string
func (*IndexModuleExecutor) String ¶ added in v1.6.0
func (i *IndexModuleExecutor) String() string
type LayerModules ¶ added in v1.6.0
type LayerModules []*pbsubstreams.Module
The list of modules in a given layer of either maps or stores. A given layer will always be comprised of only the same kind of modules.
func (LayerModules) IsStoreLayer ¶ added in v1.6.0
func (l LayerModules) IsStoreLayer() bool
type MapperModuleExecutor ¶
type MapperModuleExecutor struct {
BaseExecutor
// contains filtered or unexported fields
}
func NewMapperModuleExecutor ¶
func NewMapperModuleExecutor(baseExecutor *BaseExecutor, outputType string) *MapperModuleExecutor
func (*MapperModuleExecutor) HasOutputForFiles ¶ added in v1.6.0
func (e *MapperModuleExecutor) HasOutputForFiles() bool
func (*MapperModuleExecutor) HasValidOutput ¶ added in v0.1.0
func (e *MapperModuleExecutor) HasValidOutput() bool
func (*MapperModuleExecutor) Name ¶
func (e *MapperModuleExecutor) Name() string
Name implements ModuleExecutor
func (*MapperModuleExecutor) String ¶
func (e *MapperModuleExecutor) String() string
type ModuleExecutor ¶
type ModuleExecutor interface {
// Name returns the name of the module as defined in the manifest.
Name() string
String() string
Close(ctx context.Context) error
HasValidOutput() bool
HasOutputForFiles() bool
BlockIndex() *index.BlockIndex
RunsOnBlock(blockNum uint64) bool
// contains filtered or unexported methods
}
type SharedCache ¶ added in v1.13.0
type SharedCache struct {
// contains filtered or unexported fields
}
func NewSharedCache ¶ added in v1.13.0
func NewSharedCache(sizeBlocks uint64) *SharedCache
func (*SharedCache) Cachable ¶ added in v1.13.0
func (s *SharedCache) Cachable(blockNum uint64) bool
func (*SharedCache) ProcessBlock ¶ added in v1.13.0
func (s *SharedCache) ProcessBlock(blk *pbbstream.Block, _ interface{}) error
type StageLayers ¶ added in v1.6.0
type StageLayers []LayerModules
For a given execution stage, the layers of execution, for example: a layer of mappers, followed by a layer of stores.
func (StageLayers) IsLastStage ¶ added in v1.6.0
func (l StageLayers) IsLastStage() bool
func (StageLayers) LastLayer ¶ added in v1.6.0
func (l StageLayers) LastLayer() LayerModules
type StoreModuleExecutor ¶
type StoreModuleExecutor struct {
BaseExecutor
// contains filtered or unexported fields
}
func NewStoreModuleExecutor ¶
func NewStoreModuleExecutor(baseExecutor *BaseExecutor, outputStore store.DeltaAccessor) *StoreModuleExecutor
func (*StoreModuleExecutor) HasOutputForFiles ¶ added in v1.6.0
func (e *StoreModuleExecutor) HasOutputForFiles() bool
func (*StoreModuleExecutor) HasValidOutput ¶ added in v0.1.0
func (e *StoreModuleExecutor) HasValidOutput() bool
func (*StoreModuleExecutor) Name ¶
func (e *StoreModuleExecutor) Name() string
func (*StoreModuleExecutor) String ¶
func (e *StoreModuleExecutor) String() string
type UndoManager ¶ added in v1.16.2
UndoManager gives cancelable contexts as subscriptions to specific block hashes. if that blocks gets an UNDO signal from a reorg, it will cancel that context.
var GlobalUndoManager *UndoManager
func NewUndoManager ¶ added in v1.16.2
func NewUndoManager() *UndoManager
func (*UndoManager) Contains ¶ added in v1.16.2
func (u *UndoManager) Contains(id string) bool
func (*UndoManager) ProcessBlock ¶ added in v1.16.2
func (u *UndoManager) ProcessBlock(blk *pbbstream.Block, obj any) error
Click to show internal directories.
Click to hide internal directories.