public class BloomFilter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BloomFilter.Factory
A factory that can use different fpp based on size.
|
Modifier and Type | Method and Description |
---|---|
static BloomFilter |
create(int expectedInsertions,
double fpp)
Creates a bloom filter based on the with the expected number
of insertions and expected false positive probability.
|
static BloomFilter |
create(int expectedInsertions,
double fpp,
int numHashFunctions)
Creates a bloom filter based on the expected number of insertions, expected false positive probability,
and number of hash functions.
|
static BloomFilter |
deserialize(org.apache.lucene.store.DataInput in) |
protected static long |
fmix(long k) |
protected static long |
getblock(byte[] key,
int offset,
int index) |
int |
getNumHashFunctions() |
long |
getSizeInBytes() |
static long |
hash3_x64_128(byte[] key,
int offset,
int length,
long seed) |
int |
hashCode() |
boolean |
mightContain(org.apache.lucene.util.BytesRef value) |
boolean |
put(org.apache.lucene.util.BytesRef value) |
static BloomFilter |
readFrom(StreamInput in) |
protected static long |
rotl64(long v,
int n) |
static void |
serilaize(BloomFilter filter,
org.apache.lucene.store.DataOutput out) |
static void |
skipBloom(org.apache.lucene.store.IndexInput in) |
static void |
writeTo(BloomFilter filter,
StreamOutput out) |
public static BloomFilter create(int expectedInsertions, double fpp)
expectedInsertions
- the number of expected insertions to the constructedfpp
- the desired false positive probability (must be positive and less than 1.0)public static BloomFilter create(int expectedInsertions, double fpp, int numHashFunctions)
expectedInsertions
- the number of expected insertions to the constructedfpp
- the desired false positive probability (must be positive and less than 1.0)numHashFunctions
- the number of hash functions to use (must be less than or equal to 255)public static void skipBloom(org.apache.lucene.store.IndexInput in) throws IOException
IOException
public static BloomFilter deserialize(org.apache.lucene.store.DataInput in) throws IOException
IOException
public static void serilaize(BloomFilter filter, org.apache.lucene.store.DataOutput out) throws IOException
IOException
public static BloomFilter readFrom(StreamInput in) throws IOException
IOException
public static void writeTo(BloomFilter filter, StreamOutput out) throws IOException
IOException
public boolean put(org.apache.lucene.util.BytesRef value)
public boolean mightContain(org.apache.lucene.util.BytesRef value)
public int getNumHashFunctions()
public long getSizeInBytes()
protected static long getblock(byte[] key, int offset, int index)
protected static long rotl64(long v, int n)
protected static long fmix(long k)
public static long hash3_x64_128(byte[] key, int offset, int length, long seed)
Copyright © 2009–2017. All rights reserved.