bloomstorage

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotFindSection = errors.New("cannot find section")

Functions

This section is empty.

Types

type BloomIndexer

type BloomIndexer struct {
	// contains filtered or unexported fields
}

BloomIndexer does a post-processing job for equally sized sections of the canonical chain (like BlooomBits and CHT structures).

func NewBloomIndexer

func NewBloomIndexer(chainDb dbwrapper.Database) *BloomIndexer

NewBloomIndexer creates a new chain indexer to do background processing on chain segments of a given size after certain number of confirmations passed.

func (*BloomIndexer) Close

func (b *BloomIndexer) Close() error

Close tears down all goroutines belonging to the indexer and returns any error that might have occurred internally.

func (*BloomIndexer) Start

func (b *BloomIndexer) Start(chain blockChain)

Start makes some initialization settings for the bloom, including initialization when the system is restarted.

type Generator

type Generator struct {
	Blooms      [types.BloomBitLength][params.BloomByteSize]byte // Rotated Blooms for per-bit matching
	NextBloomId uint16                                           // Next section to set when adding a bloom
}

Generator takes a number of bloom filters and generates the rotated bloom bits to be used for batched filtering.

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a rotated bloom generator that can iteratively fill a batched bloom filter's bits.

func (*Generator) AddBloom

func (b *Generator) AddBloom(index uint16, bloom *types.Bloom) error

AddBloom takes a single bloom filter and sets the corresponding bit column in memory accordingly.

func (*Generator) Bitset

func (b *Generator) Bitset(idx uint) ([]byte, error)

Bitset returns the bit vector belonging to the given bit index after all Blooms have been added.

type SectionBuildNotify

type SectionBuildNotify struct {
	SectionNum   uint64
	SectionBloom []logbloom.OneBloom
}

type SectionWriter

type SectionWriter struct {
	// contains filtered or unexported fields
}

func NewSectionWriter

func NewSectionWriter(chainDb dbwrapper.Database) *SectionWriter

func (*SectionWriter) ClearSection

func (s *SectionWriter) ClearSection(secNum uint64)

func (*SectionWriter) ReplaceSectionBit

func (s *SectionWriter) ReplaceSectionBit(section uint64, bloomHeight uint64, bloomBit *types.Bloom) error

func (*SectionWriter) WriteSection

func (s *SectionWriter) WriteSection(secNum uint64, bloomSlice []logbloom.OneBloom) error

Jump to

Keyboard shortcuts

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