org.apache.hadoop.mapred.lib.aggregate
Class UserDefinedValueAggregatorDescriptor
java.lang.Object
org.apache.hadoop.mapred.lib.aggregate.UserDefinedValueAggregatorDescriptor
- All Implemented Interfaces:
- ValueAggregatorDescriptor
public class UserDefinedValueAggregatorDescriptor
- extends java.lang.Object
- implements ValueAggregatorDescriptor
This class implements a wrapper for a user defined value aggregator descriptor.
It servs two functions: One is to create an object of ValueAggregatorDescriptor from the
name of a user defined class that may be dynamically loaded. The other is to
deligate inviokations of generateKeyValPairs function to the created object.
Method Summary |
void |
configure(JobConf job)
Do nothing. |
static java.lang.Object |
createInstance(java.lang.String className)
Create an instance of the given class |
java.util.ArrayList<java.util.Map.Entry<Text,Text>> |
generateKeyValPairs(java.lang.Object key,
java.lang.Object val)
Generate a list of aggregation-id/value pairs for the given key/value pairs
by delegating the invocation to the real object. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UserDefinedValueAggregatorDescriptor
public UserDefinedValueAggregatorDescriptor(java.lang.String className,
JobConf job)
- Parameters:
className
- the class name of the user defined descriptor classjob
- a configure object used for decriptor configuration
createInstance
public static java.lang.Object createInstance(java.lang.String className)
- Create an instance of the given class
- Parameters:
className
- the name of the class
- Returns:
- a dynamically created instance of the given class
generateKeyValPairs
public java.util.ArrayList<java.util.Map.Entry<Text,Text>> generateKeyValPairs(java.lang.Object key,
java.lang.Object val)
- Generate a list of aggregation-id/value pairs for the given key/value pairs
by delegating the invocation to the real object.
- Specified by:
generateKeyValPairs
in interface ValueAggregatorDescriptor
- Parameters:
key
- input keyval
- input value
- Returns:
- a list of aggregation id/value pairs. An aggregation id encodes an
aggregation type which is used to guide the way to aggregate the
value in the reduce/combiner phrase of an Aggregate based job.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- the string representation of this object.
configure
public void configure(JobConf job)
- Do nothing.
- Specified by:
configure
in interface ValueAggregatorDescriptor
- Parameters:
job
- a JobConf object that may contain the information that can be used
to configure the object.
Copyright © 2009 The Apache Software Foundation