static FilterTable create ( int bitsPerTag , long numBuckets ) { // why would this ever happen? checkArgument ( bitsPerTag < 48 , "tagBits (%s) should be less than 48 bits" , bitsPerTag ) ; // shorter fingerprints don't give us a good fill capacity checkArgument ( bitsPerTag > 4 , "tagBits (%s) must be > 4" , bitsPerTag ) ; checkArgument ( numBuckets > 1 , "numBuckets (%s) must be > 1" , numBuckets ) ; // checked so our implementors don't get too.... "enthusiastic" with // table size long bitsPerBucket = IntMath . checkedMultiply ( CuckooFilter . BUCKET_SIZE , bitsPerTag ) ; long bitSetSize = LongMath . checkedMultiply ( bitsPerBucket , numBuckets ) ; LongBitSet memBlock = new LongBitSet ( bitSetSize ) ; return new FilterTable ( memBlock , bitsPerTag , numBuckets ) ; }
Creates a FilterTable