reader

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Writer represents a writer that appends db's write batch to the wal and broadcasts to the reader by message queue.

func NewWriter

func NewWriter(config *utils.Config, dbPool *db.DBPool) (writer *Writer, err error)

NewWriter creates a new writer.

func (*Writer) PrepareBlockInfo

func (w *Writer) PrepareBlockInfo(blockNum int64, blockHash string, blockRoot string) *pb.BlockInfo

func (*Writer) Recovery

func (w *Writer) Recovery() error

Recovery recovers the writer from the last block header.

func (*Writer) WriteBlockHeaderToDB

func (w *Writer) WriteBlockHeaderToDB(info *pb.BlockInfo, batchs []db.BatchWithID) (err error)

func (*Writer) WriteBlockHeaderToKafka

func (w *Writer) WriteBlockHeaderToKafka() (err error)

func (*Writer) WriteBlockHeaderToS3

func (w *Writer) WriteBlockHeaderToS3(info *pb.BlockInfo, batchs []db.BatchWithID) (err error)

func (*Writer) WriteBlockToDB

func (w *Writer) WriteBlockToDB(batchs []db.BatchWithID) (err error)

func (*Writer) WriteBlockToS3

func (w *Writer) WriteBlockToS3(info *pb.BlockInfo, batchs []db.BatchWithID) (err error)

Jump to

Keyboard shortcuts

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