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)
Generates hash values according to the given hash algorithm.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
call(java.lang.String val)
Generates the hash for a string value.
|
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, makeHashFunc
exec, getReturnType, outputSchema
getContextProperties, getInstanceName, getInstanceProperties, setUDFContextSignature
protected com.google.common.hash.HashFunction hash_func
protected final java.lang.String algorithm
public HasherRand()
HasherRand(String alg)
public HasherRand(java.lang.String alg)
alg
- the hash algorithm to useHasherRand()
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()