Back to

Package trxdb_loader

Latest Go to latest

The latest major version is .

Published: May 12, 2020 | License: Apache-2.0 | Module:


type BigtableLoader

type BigtableLoader struct {
	// contains filtered or unexported fields

func NewBigtableLoader

func NewBigtableLoader(
	blockStreamAddr string,
	blocksStore dstore.Store,
	batchSize uint64,
	db eosdb.DBWriter,
	parallelFileDownloadCount int,
) *BigtableLoader

func (*BigtableLoader) BuildPipelineBatch

func (l *BigtableLoader) BuildPipelineBatch(startBlockNum uint64, numBlocksBeforeStart uint64)

func (*BigtableLoader) BuildPipelineJob

func (l *BigtableLoader) BuildPipelineJob(startBlockNum uint64, numBlocksBeforeStart uint64, job Job)

func (*BigtableLoader) BuildPipelineLive

func (l *BigtableLoader) BuildPipelineLive(allowLiveOnEmptyTable bool) error

func (*BigtableLoader) BuildPipelinePatch

func (l *BigtableLoader) BuildPipelinePatch(startBlockNum uint64, numBlocksBeforeStart uint64)

func (*BigtableLoader) DoFlush

func (l *BigtableLoader) DoFlush(blockNum uint64) error

func (*BigtableLoader) FlushIfNeeded

func (l *BigtableLoader) FlushIfNeeded(blockNum uint64, blockTime time.Time) error

func (*BigtableLoader) FullJob

func (l *BigtableLoader) FullJob(blockNum uint64, block *pbcodec.Block, fObj *forkable.ForkableObject) (err error)

fullJob does all the database insertions needed to load the blockchain into our database.

func (*BigtableLoader) Healthy

func (l *BigtableLoader) Healthy() bool

func (*BigtableLoader) InitLIB

func (l *BigtableLoader) InitLIB(libID string)

func (*BigtableLoader) Launch

func (l *BigtableLoader) Launch()

func (*BigtableLoader) PatchJob

func (l *BigtableLoader) PatchJob(blockNum uint64, blk *pbcodec.Block, fObj *forkable.ForkableObject) (err error)

patchDatabase is a "scratch" pad to define patch code that can be applied on an ad-hoc basis. The idea is to leave this function empty when no patch needs to be applied.

When a patch is required, the suggested workflow is to develop the patch code in a side branch. When the code is ready, the "production" commit is tagged with the `patch-<tag>-<date>` where the tag is giving an overview of the patch and the date is the effective date (`<year>-<month>-<day>`): `patch-add-trx-meta-written-2019-06-30`. The branch is then deleted and the tag is pushed to the remote repository.

func (*BigtableLoader) ProcessBlock

func (l *BigtableLoader) ProcessBlock(blk *bstream.Block, obj interface{}) (err error)

func (*BigtableLoader) ShouldPushLIBUpdates

func (l *BigtableLoader) ShouldPushLIBUpdates(dposLIBNum uint64) bool

func (*BigtableLoader) ShowProgress

func (l *BigtableLoader) ShowProgress(blockNum uint64)

func (*BigtableLoader) StopBeforeBlock

func (l *BigtableLoader) StopBeforeBlock(blockNum uint64)

StopBeforeBlock indicates the stop block (exclusive), means that block num will not be inserted.

func (*BigtableLoader) UpdateIrreversibleData

func (l *BigtableLoader) UpdateIrreversibleData(nowIrreversibleBlocks []*bstream.PreprocessedBlock) error

type Job

type Job = func(blockNum uint64, blk *pbcodec.Block, fObj *forkable.ForkableObject) (err error)

type Loader

type Loader interface {

	BuildPipelineLive(bool) error
	BuildPipelineBatch(startBlock uint64, beforeStart uint64)
	BuildPipelinePatch(startBlock uint64, beforeStart uint64)

	Healthy() bool

	// Shutter related
	Shutdown(err error)
	OnTerminated(f func(error))
	Terminated() <-chan struct{}
	Err() error

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier