Package org.apache.orc.util
Class CuckooSetBytes
java.lang.Object
org.apache.orc.util.CuckooSetBytes
A high-performance set implementation used to support fast set membership testing,
using Cuckoo hashing. This is used to support fast tests of the form
column IN ( list-of-values )
For details on the algorithm, see R. Pagh and F. F. Rodler, "Cuckoo Hashing," Elsevier Science preprint, Dec. 2003. http://www.itu.dk/people/pagh/papers/cuckoo-jour.pdf.
Copied from CuckooSetBytes@Apache Hive project for convenience
-
Constructor Summary
ConstructorDescriptionCuckooSetBytes
(int expectedSize) Allocate a new set to hold expectedSize values. -
Method Summary
-
Constructor Details
-
CuckooSetBytes
public CuckooSetBytes(int expectedSize) Allocate a new set to hold expectedSize values. Re-allocation to expand the set is not implemented, so the expected size must be at least the size of the set to be inserted.- Parameters:
expectedSize
- At least the size of the set of values that will be inserted.
-
-
Method Details
-
lookup
public boolean lookup(byte[] b, int start, int len) Return true if and only if the value in byte array b beginning at start and ending at start+len is present in the set. -
insert
public void insert(byte[] x) -
load
public void load(byte[][] a) Insert all values in the input array into the set.
-