org.apache.pig.builtin
Class BuildBloomBase<T>

java.lang.Object
  extended by org.apache.pig.EvalFunc<T>
      extended by org.apache.pig.builtin.BuildBloomBase<T>
Direct Known Subclasses:
BuildBloom, BuildBloom.Final, BuildBloom.Initial, BuildBloom.Intermediate

public abstract class BuildBloomBase<T>
extends EvalFunc<T>

A Base class for BuildBloom and its Algebraic implementations.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pig.EvalFunc
EvalFunc.SchemaType
 
Field Summary
protected  org.apache.hadoop.util.bloom.BloomFilter filter
           
protected  int hType
           
protected  int numHash
           
protected  int vSize
           
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
protected BuildBloomBase()
           
  BuildBloomBase(String hashType, String numElements, String desiredFalsePositive)
           
  BuildBloomBase(String hashType, String mode, String vectorSize, String nbHash)
           
 
Method Summary
protected  org.apache.hadoop.util.bloom.BloomFilter bloomIn(DataByteArray b)
           
protected  DataByteArray bloomOr(Tuple input)
           
protected  DataByteArray bloomOut()
           
 
Methods inherited from class org.apache.pig.EvalFunc
exec, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, isAsynchronous, outputSchema, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vSize

protected int vSize

numHash

protected int numHash

hType

protected int hType

filter

protected org.apache.hadoop.util.bloom.BloomFilter filter
Constructor Detail

BuildBloomBase

protected BuildBloomBase()

BuildBloomBase

public BuildBloomBase(String hashType,
                      String mode,
                      String vectorSize,
                      String nbHash)
Parameters:
hashType - type of the hashing function (see Hash).
mode - Will be ignored, though by convention it should be "fixed" or "fixedsize"
vectorSize - The vector size of this filter.
nbHash - The number of hash functions to consider.

BuildBloomBase

public BuildBloomBase(String hashType,
                      String numElements,
                      String desiredFalsePositive)
Parameters:
hashType - type of the hashing function (see Hash).
numElements - The number of distinct elements expected to be placed in this filter.
desiredFalsePositive - the acceptable rate of false positives. This should be a floating point value between 0 and 1.0, where 1.0 would be 100% (ie, a totally useless filter).
Method Detail

bloomOr

protected DataByteArray bloomOr(Tuple input)
                         throws IOException
Throws:
IOException

bloomOut

protected DataByteArray bloomOut()
                          throws IOException
Throws:
IOException

bloomIn

protected org.apache.hadoop.util.bloom.BloomFilter bloomIn(DataByteArray b)
                                                    throws IOException
Throws:
IOException


Copyright © 2007-2012 The Apache Software Foundation