public class BuildBloom extends BuildBloomBase<DataByteArray> implements Algebraic
BloomFilter
.Modifier and Type | Class and Description |
---|---|
static class |
BuildBloom.Final |
static class |
BuildBloom.Initial |
static class |
BuildBloom.Intermediate |
EvalFunc.SchemaType
filter, hType, numHash, vSize
log, pigLogger, reporter, returnType
Constructor and Description |
---|
BuildBloom(java.lang.String hashType,
java.lang.String numElements,
java.lang.String desiredFalsePositive)
Construct a Bloom filter based on expected number of elements and
desired accuracy.
|
BuildBloom(java.lang.String hashType,
java.lang.String mode,
java.lang.String vectorSize,
java.lang.String nbHash)
Build a bloom filter of fixed size and number of hash functions.
|
Modifier and Type | Method and Description |
---|---|
DataByteArray |
exec(Tuple input)
This callback method must be implemented by all subclasses.
|
java.lang.String |
getFinal()
Get the final function.
|
java.lang.String |
getInitial()
Get the initial function.
|
java.lang.String |
getIntermed()
Get the intermediate function.
|
Schema |
outputSchema(Schema input)
Report the schema of the output of this UDF.
|
bloomIn, bloomOr, bloomOut
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public BuildBloom(java.lang.String hashType, java.lang.String mode, java.lang.String vectorSize, java.lang.String nbHash)
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.public BuildBloom(java.lang.String hashType, java.lang.String numElements, java.lang.String desiredFalsePositive)
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).public DataByteArray exec(Tuple input) throws java.io.IOException
EvalFunc
exec
in class EvalFunc<DataByteArray>
input
- the Tuple to be processed.java.io.IOException
public java.lang.String getInitial()
Algebraic
getInitial
in interface Algebraic
public java.lang.String getIntermed()
Algebraic
getIntermed
in interface Algebraic
public java.lang.String getFinal()
Algebraic
public Schema outputSchema(Schema input)
EvalFunc
The default implementation interprets the OutputSchema
annotation,
if one is present. Otherwise, it returns null
(no known output schema).
outputSchema
in class EvalFunc<DataByteArray>
input
- Schema of the inputCopyright © 2007-2012 The Apache Software Foundation