Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(node tasks.DataSource, name string) *Builder
func (*Builder) Build ¶
func (b *Builder) Build() (*TipSetIndexer, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the execution of an Indexer. It may be used to index TipSets both serially or in parallel.
func NewManager ¶
func NewManager(api tasks.DataSource, strg model.Storage, name string, opts ...ManagerOpt) (*Manager, error)
NewManager returns a default Manager. Any provided ManagerOpt's will override Manager's default values.
func (*Manager) TipSet ¶
func (i *Manager) TipSet(ctx context.Context, ts *types.TipSet, options ...indexer.Option) (bool, error)
TipSet synchronously indexes and persists `ts`. TipSet returns an error if the Manager's Indexer encounters a fatal error. TipSet returns false if one or more of the Indexer's tasks complete with a status `ERROR` or `SKIPPED`, else returns true. Upon cancellation of `ctx` TipSet will persist all incomplete tasks with status `SKIPPED` before returning.
type ManagerOpt ¶
type ManagerOpt func(i *Manager)
func WithWindow ¶
func WithWindow(w time.Duration) ManagerOpt
WithWindow overrides the Manager's default (0) window with the provided window. The value of the window controls a timeout after which the Manager aborts processing the tipset, marking any incomplete tasks as SKIPPED.
type Result ¶
type Result struct { // Name of the task executed. Name string // Data extracted during task execution. Data model.Persistable // Report containing details of task execution success and duration. Report visormodel.ProcessingReportList }
type TipSetIndexer ¶
type TipSetIndexer struct {
// contains filtered or unexported fields
}
TipSetIndexer extracts block, message and actor state data from a tipset and persists it to storage. Extraction and persistence are concurrent. Extraction of the a tipset can proceed while data from the previous extraction is being persisted. The indexer may be given a time window in which to complete data extraction. The name of the indexer is used as the reporter in the visor_processing_reports table.
func (*TipSetIndexer) TipSet ¶
func (t *TipSetIndexer) TipSet(ctx context.Context, ts *types.TipSet) (chan *Result, chan error, error)
TipSet keeps no internal state and asynchronously indexes `ts` returning Result's as they extracted. If the TipSetIndexer encounters an error (fails to fetch ts's parent) it returns immediately and performs no work. If one of the TipSetIndexer's tasks encounters a fatal error, the error is return on the error channel.