public class HasherRand extends Hasher
Hasher| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
algorithm |
protected com.google.common.hash.HashFunction |
hash_func |
SEEDED_HASH_NAMES| Constructor and Description |
|---|
HasherRand()
Generates hash values according to murmur3-32, a non-cryptographic-strength
hash function with good mixing.
|
HasherRand(java.lang.String alg) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
call(java.lang.String val) |
protected java.util.Random |
getRandomGenerator() |
protected void |
onReady(org.apache.pig.impl.logicalLayer.schema.Schema in_schema,
org.apache.pig.impl.logicalLayer.schema.Schema out_schema)
Generate a seed exactly once on the front end, so all workers get same value
|
intFromHex, longFromHex, makeHashFuncexec, getReturnType, outputSchemagetContextProperties, getInstanceName, getInstanceProperties, setUDFContextSignatureprotected com.google.common.hash.HashFunction hash_func
protected final java.lang.String algorithm
public HasherRand()
throws java.lang.IllegalArgumentException,
java.lang.RuntimeException
IllegalArgumentException, - RuntimeExceptionjava.lang.IllegalArgumentExceptionjava.lang.RuntimeExceptionHasherRand(String alg)public HasherRand(java.lang.String alg)
throws java.lang.IllegalArgumentException,
java.lang.RuntimeException
alg - IllegalArgumentException, - RuntimeExceptionjava.lang.IllegalArgumentExceptionjava.lang.RuntimeExceptionHasherRand()public java.lang.String call(java.lang.String val)
protected void onReady(org.apache.pig.impl.logicalLayer.schema.Schema in_schema,
org.apache.pig.impl.logicalLayer.schema.Schema out_schema)
onReady in class ContextualEvalFunc<java.lang.String>in_schema - Input schemaout_schema - Output schemaprotected java.util.Random getRandomGenerator()