Documentation ¶
Overview ¶
Package bloombits implements bloom filtering on batches of data.
Index ¶
- type Generator
- type Matcher
- type MatcherSession
- func (s *MatcherSession) AllocateRetrieval() (uint, bool)
- func (s *MatcherSession) AllocateSections(bit uint, count int) []uint64
- func (s *MatcherSession) Close(timeout time.Duration)
- func (s *MatcherSession) DeliverSections(bit uint, sections []uint64, bitsets [][]byte)
- func (s *MatcherSession) Multiplex(batch int, wait time.Duration, mux chan chan *Retrieval)
- func (s *MatcherSession) PendingSections(bit uint) int
- type Retrieval
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator takes a number of bloom filters and generates the rotated bloom bits to be used for batched filtering.
func NewGenerator ¶
NewGenerator creates a rotated bloom generator that can iteratively fill a batched bloom filter's bits.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher is a pipelined system of schedulers and logic matchers which perform binary AND/OR operations on the bit-streams, creating a stream of potential blocks to inspect for data content.
func NewMatcher ¶
NewMatcher creates a new pipeline for retrieving bloom bit streams and doing address and topic filtering on them.
type MatcherSession ¶
type MatcherSession struct {
// contains filtered or unexported fields
}
MatcherSession is returned by a started matcher to be used as a terminator for the actively running matching operation.
func (*MatcherSession) AllocateRetrieval ¶
func (s *MatcherSession) AllocateRetrieval() (uint, bool)
AllocateRetrieval assigns a bloom bit index to a client process that can either immediately reuest and fetch the section contents assigned to this bit or wait a little while for more sections to be requested.
func (*MatcherSession) AllocateSections ¶
func (s *MatcherSession) AllocateSections(bit uint, count int) []uint64
AllocateSections assigns all or part of an already allocated bit-task queue to the requesting process.
func (*MatcherSession) Close ¶
func (s *MatcherSession) Close(timeout time.Duration)
Close stops the matching process and waits for all subprocesses to terminate before returning. The timeout may be used for graceful shutdown, allowing the currently running retrievals to complete before this time.
func (*MatcherSession) DeliverSections ¶
func (s *MatcherSession) DeliverSections(bit uint, sections []uint64, bitsets [][]byte)
DeliverSections delivers a batch of section bit-vectors for a specific bloom bit index to be injected into the processing pipeline.
func (*MatcherSession) Multiplex ¶
func (s *MatcherSession) Multiplex(batch int, wait time.Duration, mux chan chan *Retrieval)
Multiplex polls the matcher session for rerieval tasks and multiplexes it into the reuested retrieval queue to be serviced together with other sessions.
This method will block for the lifetime of the session. Even after termination of the session, any request in-flight need to be responded to! Empty responses are fine though in that case.
func (*MatcherSession) PendingSections ¶
func (s *MatcherSession) PendingSections(bit uint) int
PendingSections returns the number of pending section retrievals belonging to the given bloom bit index.