Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.apache.hadoop.hbase.util;
Defines the general behavior of a bloom filter.

The Bloom filter is a data structure that was introduced in 1970 and that has been adopted by the networking research community in the past decade thanks to the bandwidth efficiencies that it offers for the transmission of set membership information between networked hosts. A sender encodes the information into a bit vector, the Bloom filter, that is more compact than a conventional representation. Computation and space costs for construction are linear in the number of elements. The receiver uses the filter to test whether various elements are members of the set. Though the filter will occasionally return a false positive, it will never return a false negative. When creating the filter, the sender can choose its desired point in a trade-off between the false positive rate and the size.

See also:
BloomFilterWriter for the ability to add elements to a Bloom filter
public interface BloomFilter extends BloomFilterBase {

Check if the specified key is contained in the bloom filter.

buf data to check for existence of
offset offset into the data
length length of the data
bloom bloom filter data to search. This can be null if auto-loading is supported.
true if matched by bloom, false if not
  boolean contains(byte [] bufint offsetint lengthByteBuffer bloom);


true if this Bloom filter can automatically load its data and thus allows a null byte buffer to be passed to contains()
  boolean supportsAutoLoading();
New to GrepCode? Check out our FAQ X