dataprocessor

package
v1.1.66 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: GPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDatabaseInfoNotFound = errors.New("database info not found")

ErrDatabaseInfoNotFound signals that a database information hasn't been found

View Source
var ErrNilDataReplayer = errors.New("nil data replayer")

ErrNilDataReplayer signals that a nil data replayer has been provided

View Source
var ErrNilDatabaseReader = errors.New("nil database reader")

ErrNilDatabaseReader signals that a nil databse reader has been provided

View Source
var ErrNilElasticIndexer = errors.New("nil elastic indexer")

ErrNilElasticIndexer signals that a nil elastic indexer has been provided

View Source
var ErrNilGenesisNodesSetup = errors.New("nil genesis nodes setup")

ErrNilGenesisNodesSetup signals that a nil genesis nodes setup handler has been provided

View Source
var ErrNilHandlerFunc = errors.New("nil handler function for ranging")

ErrNilHandlerFunc signals that a nil handler function for raning has been provided

View Source
var ErrNilHasher = errors.New("nil hasher")

ErrNilHasher signals that a nil hasher has been provided

View Source
var ErrNilHeaderMarshalizer = errors.New("nil header marshalizer")

ErrNilHeaderMarshalizer signals that a nil header marshalizer has been provided

View Source
var ErrNilMarshalizer = errors.New("nil marshalizer")

ErrNilMarshalizer signals that a nil marshalizer has been provided

View Source
var ErrNilPubKeyConverter = errors.New("nil public key converter")

ErrNilPubKeyConverter signals that a nil public key converter has been provided

View Source
var ErrNilRatingProcessor = errors.New("nil rating processor")

ErrNilRatingProcessor signals that a nil rating processor has been provided

View Source
var ErrNilShardCoordinator = errors.New("nil shard coordinator")

ErrNilShardCoordinator signals that a nil shard coordinator has been provided

View Source
var ErrNilTPSBenchmarkUpdater = errors.New("nil tps benchmark updater")

ErrNilTPSBenchmarkUpdater signals that a nil tps benchmark updater has been provided

View Source
var ErrNilUint64ByteSliceConverter = errors.New("nil uint64 byte slice converter")

ErrNilUint64ByteSliceConverter signals that a nil uint64 byte slice converter has been provided

View Source
var ErrNoMetachainDatabase = errors.New("no metachain database - cannot index")

ErrNoMetachainDatabase signals that no metachain database hasn't been found

View Source
var ErrOsSignalIntercepted = errors.New("os signal intercepted")

ErrOsSignalIntercepted is returned when a signal from the OS is received

View Source
var ErrRangeIsOver = errors.New("range is over")

ErrRangeIsOver signals that the range cannot be continued as the handler returned false

Functions

func NewDataProcessor

func NewDataProcessor(args ArgsDataProcessor) (*dataProcessor, error)

NewDataProcessor returns a new instance of dataProcessor

func NewDataReplayer

func NewDataReplayer(args DataReplayerArgs) (*dataReplayer, error)

NewDataReplayer returns a new instance of dataReplayer

func NewRatingsProcessor

func NewRatingsProcessor(args RatingProcessorArgs) (*ratingsProcessor, error)

NewRatingsProcessor will return a new instance of ratingsProcessor

func NewTPSBenchmarkUpdater

func NewTPSBenchmarkUpdater(
	genesisNodesConfig sharding.GenesisNodesSetupHandler,
	tpsIndexer StorageDataIndexer,
) (*tpsBenchmarkUpdater, error)

NewTPSBenchmarkUpdater returns a new instance of tpsBenchmarkUpdater

Types

type ArgsDataProcessor

type ArgsDataProcessor struct {
	ElasticIndexer            StorageDataIndexer
	DataReplayer              DataReplayerHandler
	GenesisNodesSetup         update.GenesisNodesSetupHandler
	ShardCoordinator          sharding.Coordinator
	Marshalizer               marshal.Marshalizer
	Hasher                    hashing.Hasher
	TPSBenchmarkUpdater       TPSBenchmarkUpdaterHandler
	RatingsProcessor          RatingProcessorHandler
	RatingConfig              config.RatingsConfig
	StartingEpoch             uint32
	WaitingListFixEnableEpoch uint32
}

ArgsDataProcessor holds the arguments needed for creating a new dataProcessor

type DataReplayerArgs

type DataReplayerArgs struct {
	DatabaseReader           DatabaseReaderHandler
	GeneralConfig            config.Config
	ShardCoordinator         sharding.Coordinator
	Marshalizer              marshal.Marshalizer
	Hasher                   hashing.Hasher
	Uint64ByteSliceConverter typeConverters.Uint64ByteSliceConverter
	HeaderMarshalizer        HeaderMarshalizerHandler
	StartingEpoch            uint32
}

DataReplayerArgs holds the arguments needed for creating a new dataReplayer

type DataReplayerHandler

type DataReplayerHandler interface {
	Range(handler func(persistedData storer2ElasticData.RoundPersistedData) bool) error
	IsInterfaceNil() bool
}

DataReplayerHandler defines the actions that a data replayer has to do

type DatabaseReaderHandler

type DatabaseReaderHandler interface {
	GetDatabaseInfo() ([]*databasereader.DatabaseInfo, error)
	GetStaticDatabaseInfo() ([]*databasereader.DatabaseInfo, error)
	GetHeaders(dbInfo *databasereader.DatabaseInfo) ([]data.HeaderHandler, error)
	LoadPersister(dbInfo *databasereader.DatabaseInfo, unit string) (storage.Persister, error)
	LoadStaticPersister(dbInfo *databasereader.DatabaseInfo, unit string) (storage.Persister, error)
	IsInterfaceNil() bool
}

DatabaseReaderHandler defines the actions that a database reader has to do

type HeaderMarshalizerHandler

type HeaderMarshalizerHandler interface {
	UnmarshalShardHeader(headerBytes []byte) (*block.Header, error)
	UnmarshalMetaBlock(headerBytes []byte) (*block.MetaBlock, error)
	IsInterfaceNil() bool
}

HeaderMarshalizerHandler defines the actions that a header marshalizer has to do

type NodesCoordinator

type NodesCoordinator interface {
	sharding.NodesCoordinator
	EpochStartPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)
}

NodesCoordinator defines the actions that a nodes' coordinator has to do

type RatingProcessorArgs

type RatingProcessorArgs struct {
	ValidatorPubKeyConverter core.PubkeyConverter
	GenesisNodesConfig       sharding.GenesisNodesSetupHandler
	ShardCoordinator         sharding.Coordinator
	DbPathWithChainID        string
	GeneralConfig            config.Config
	Marshalizer              marshal.Marshalizer
	Hasher                   hashing.Hasher
	ElasticIndexer           StorageDataIndexer
	RatingsConfig            config.RatingsConfig
}

RatingProcessorArgs holds the arguments needed for creating a new ratingsProcessor

type RatingProcessorHandler

type RatingProcessorHandler interface {
	IndexRatingsForEpochStartMetaBlock(metaBlock *block.MetaBlock) error
	IsInterfaceNil() bool
}

RatingProcessorHandler defines the actions that a rating processor has to do

type StorageDataIndexer

type StorageDataIndexer interface {
	SaveBlock(args *indexer.ArgsSaveBlockData)
	SaveRoundsInfo(roundsInfos []*indexer.RoundInfo)
	UpdateTPS(tpsBenchmark statistics.TPSBenchmark)
	SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte, epoch uint32)
	SaveValidatorsRating(indexID string, infoRating []*indexer.ValidatorRatingInfo)
	IsInterfaceNil() bool
}

StorageDataIndexer defines the actions that a storage data indexer has to do

type TPSBenchmarkUpdaterHandler

type TPSBenchmarkUpdaterHandler interface {
	IndexTPSForMetaBlock(metaBlock *block.MetaBlock)
	IsInterfaceNil() bool
}

TPSBenchmarkUpdaterHandler defines the actions that a TPS benchmark updater has to do

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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