Documentation ¶
Overview ¶
Package bloom package
Index ¶
- type BlockLoader
- type BloomFilter
- type BloomStateDb
- func (b *BloomStateDb) Close()
- func (b *BloomStateDb) CommitBlock(blockWithRWSet *serialization.BlockWithSerializedInfo, isCache bool) error
- func (b *BloomStateDb) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
- func (b *BloomStateDb) ReadObject(contractName string, key []byte) ([]byte, error)
- func (b *BloomStateDb) ReadObjects(contractName string, keys [][]byte) ([][]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockLoader ¶
type BlockLoader interface { GetLastHeight() (uint64, error) GetBlockWithRWSets(height uint64) (*storePb.BlockWithRWSet, error) }
BlockLoader used to load blocks As an intermediate conversion, it coverts storeImpl to bloom.BlockLoader
type BloomFilter ¶
type BloomFilter struct { *bloom.BlockBloomFilter // contains filtered or unexported fields }
BloomFilter wrapper of bloom.BlockBloomFilter
func NewBloomFilter ¶
func NewBloomFilter(chainId string, config *conf.BloomConfig, logger protocol.Logger, blockLoader BlockLoader) (*BloomFilter, error)
NewBloomFilter create a bloom filter based on the bloom config. Firstly create a directory to store the bloom filter data according chainID. Then create the bloom filter with some options based on the bloom config. The bloom filter use key calculate bit generated by contractName and key for format '{contractName}#{key}'
func (*BloomFilter) Close ¶
func (f *BloomFilter) Close() error
Close dump data when close if If configuration item DumpWhenClose is true
type BloomStateDb ¶
BloomStateDb is a bloom filter pre-installed for the underlying statedb database.
func NewBloomStateDb ¶
func NewBloomStateDb(stateDB statedb.StateDB, filter *BloomFilter, logger protocol.Logger) *BloomStateDb
NewBloomStateDb create a wrapper using bloom filter for the underlying state db.
func (*BloomStateDb) Close ¶
func (b *BloomStateDb) Close()
Close close the underlying StateDB and dump the bloom filter data to file.
func (*BloomStateDb) CommitBlock ¶
func (b *BloomStateDb) CommitBlock(blockWithRWSet *serialization.BlockWithSerializedInfo, isCache bool) error
CommitBlock commit the block to the underlying StateDB, if successful, add all write sets of the block to the Bloom filter.
func (*BloomStateDb) InitGenesis ¶
func (b *BloomStateDb) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
InitGenesis init genesis block use the underlying StateDB, if successful, add the write sets of the genesis block to the Bloom filter.