package hash
Main package for hash APIs. Import all.
import com.spotify.scio.hash._
- Alphabetic
- By Inheritance
- hash
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed trait ApproxFilter[T] extends Serializable
An approximate filter for instances of
T
, e.g.An approximate filter for instances of
T
, e.g. a Bloom filter. A Bloom filter offers an approximate containment test with one-sided error: if it claims that an element is contained in it, this might be in error, but if it claims that an element is not contained in it, then this is definitely true. - sealed trait ApproxFilterCompanion extends AnyRef
A trait for all ApproxFilter companion objects.
- implicit final class ApproxFilterIterable[T] extends AnyVal
- implicit final class ApproxFilterSCollection[T] extends AnyVal
- class BloomFilter[T] extends ApproxFilter[T]
An ApproxFilter implementation backed by a Guava BloomFilter.
An ApproxFilter implementation backed by a Guava BloomFilter.
Import
magnolify.guava.auto._
to get common instances of Guava Funnels. - case class MutableScalableBloomFilter[T](fpProb: Double, headCapacity: Long, growthRate: Int, tighteningRatio: Double, headFPProb: Double, headCount: Long, head: Option[google.common.hash.BloomFilter[T]], tail: List[Either[google.common.hash.BloomFilter[T], SerializedBloomFilters]])(implicit funnel: Funnel[T]) extends Serializable with Product
- T
The type of objects inserted into the filter
- fpProb
The desired false positive probability
- headCapacity
The capacity of the filter at the head of
filters
- growthRate
The growth rate of each subsequent filter added to
filters
- tighteningRatio
The tightening ratio applied to the current
fpProb
to maintain the false positive probability over the sequence of filters- headFPProb
The false positive probability of the head of
filters
- headCount
The number of items currently in the filter at the head of
filters
- head
The underlying bloom filter currently being inserted into, or
None
if this scalable filter has just been initialized- tail
The underlying already-saturated bloom filters, lazily deserialized from bytes as necessary.
- funnel
The funnel to turn
T
s into bytes
- case class SerializedBloomFilters(numFilters: Int, filterBytes: Array[Byte]) extends Product with Serializable
Value Members
- object BloomFilter extends ApproxFilterCompanion with Serializable
Companion object for BloomFilter.
- object MutableScalableBloomFilter extends Serializable
A mutable, scalable wrapper around a Guava BloomFilter
A mutable, scalable wrapper around a Guava BloomFilter
Scalable bloom filters use a series of bloom filters, adding a new one and scaling its size by
growthRate
once the previous filter is saturated in order to maintain the desired false positive probabilityfpProb
. A scalable bloom filtercontains
("might contain") an item if any of its filters contains the item.Import
magnolify.guava.auto._
to get common instances of Guava Funnels.Not thread-safe.