/** * * @param className the class name of the user defined descriptor class * @param job a configure object used for decriptor configuration */ public UserDefinedValueAggregatorDescriptor(String className, JobConf job) { super(className, job); ((ValueAggregatorDescriptor)theAggregatorDescriptor).configure(job); }
/** * Generate a list of aggregation-id/value pairs for the given key/value pairs * by delegating the invocation to the real object. * * @param key * input key * @param val * input value * @return 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. */ public ArrayList<Entry<Text, Text>> generateKeyValPairs(Object key, Object val) { ArrayList<Entry<Text, Text>> retv = new ArrayList<Entry<Text, Text>>(); if (this.theAggregatorDescriptor != null) { retv = this.theAggregatorDescriptor.generateKeyValPairs(key, val); } return retv; }
/** * Generate a list of aggregation-id/value pairs for the given key/value pairs * by delegating the invocation to the real object. * * @param key * input key * @param val * input value * @return 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. */ public ArrayList<Entry<Text, Text>> generateKeyValPairs(Object key, Object val) { ArrayList<Entry<Text, Text>> retv = new ArrayList<Entry<Text, Text>>(); if (this.theAggregatorDescriptor != null) { retv = this.theAggregatorDescriptor.generateKeyValPairs(key, val); } return retv; }
/** * the map function. It iterates through the value aggregator descriptor * list to generate aggregation id/value pairs and emit them. */ public void map(K1 key, V1 value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { Iterator iter = this.aggregatorDescriptorList.iterator(); while (iter.hasNext()) { ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next(); Iterator<Entry<Text, Text>> ens = ad.generateKeyValPairs(key, value).iterator(); while (ens.hasNext()) { Entry<Text, Text> en = ens.next(); output.collect(en.getKey(), en.getValue()); } } }
/** * * @param className the class name of the user defined descriptor class * @param job a configure object used for decriptor configuration */ public UserDefinedValueAggregatorDescriptor(String className, JobConf job) { super(className, job); ((ValueAggregatorDescriptor)theAggregatorDescriptor).configure(job); }
/** * the map function. It iterates through the value aggregator descriptor * list to generate aggregation id/value pairs and emit them. */ public void map(K1 key, V1 value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { Iterator iter = this.aggregatorDescriptorList.iterator(); while (iter.hasNext()) { ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next(); Iterator<Entry<Text, Text>> ens = ad.generateKeyValPairs(key, value).iterator(); while (ens.hasNext()) { Entry<Text, Text> en = ens.next(); output.collect(en.getKey(), en.getValue()); } } }
/** * * @param className the class name of the user defined descriptor class * @param job a configure object used for decriptor configuration */ public UserDefinedValueAggregatorDescriptor(String className, JobConf job) { super(className, job); ((ValueAggregatorDescriptor)theAggregatorDescriptor).configure(job); }
/** * the map function. It iterates through the value aggregator descriptor * list to generate aggregation id/value pairs and emit them. */ public void map(K1 key, V1 value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { Iterator iter = this.aggregatorDescriptorList.iterator(); while (iter.hasNext()) { ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next(); Iterator<Entry<Text, Text>> ens = ad.generateKeyValPairs(key, value).iterator(); while (ens.hasNext()) { Entry<Text, Text> en = ens.next(); output.collect(en.getKey(), en.getValue()); } } }
/** * * @param className the class name of the user defined descriptor class * @param job a configure object used for decriptor configuration */ public UserDefinedValueAggregatorDescriptor(String className, JobConf job) { super(className, job); ((ValueAggregatorDescriptor)theAggregatorDescriptor).configure(job); }
/** * the map function. It iterates through the value aggregator descriptor * list to generate aggregation id/value pairs and emit them. */ public void map(K1 key, V1 value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { Iterator iter = this.aggregatorDescriptorList.iterator(); while (iter.hasNext()) { ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next(); Iterator<Entry<Text, Text>> ens = ad.generateKeyValPairs(key, value).iterator(); while (ens.hasNext()) { Entry<Text, Text> en = ens.next(); output.collect(en.getKey(), en.getValue()); } } }
/** * * @param className the class name of the user defined descriptor class * @param job a configure object used for decriptor configuration */ public UserDefinedValueAggregatorDescriptor(String className, JobConf job) { super(className, job); ((ValueAggregatorDescriptor)theAggregatorDescriptor).configure(job); }
/** * the map function. It iterates through the value aggregator descriptor * list to generate aggregation id/value pairs and emit them. */ public void map(K1 key, V1 value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { Iterator iter = this.aggregatorDescriptorList.iterator(); while (iter.hasNext()) { ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next(); Iterator<Entry<Text, Text>> ens = ad.generateKeyValPairs(key, value).iterator(); while (ens.hasNext()) { Entry<Text, Text> en = ens.next(); output.collect(en.getKey(), en.getValue()); } } }
private void createAggregator(JobConf job) { if (theAggregatorDescriptor == null) { theAggregatorDescriptor = (ValueAggregatorDescriptor) createInstance(this.className); theAggregatorDescriptor.configure(job); } }
/** * the map function. It iterates through the value aggregator descriptor * list to generate aggregation id/value pairs and emit them. */ public void map(K1 key, V1 value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { Iterator iter = this.aggregatorDescriptorList.iterator(); while (iter.hasNext()) { ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next(); Iterator<Entry<Text, Text>> ens = ad.generateKeyValPairs(key, value).iterator(); while (ens.hasNext()) { Entry<Text, Text> en = ens.next(); output.collect(en.getKey(), en.getValue()); } } }
private void createAggregator(JobConf job) { if (theAggregatorDescriptor == null) { theAggregatorDescriptor = (ValueAggregatorDescriptor) createInstance(this.className); theAggregatorDescriptor.configure(job); } }
/** * the map function. It iterates through the value aggregator descriptor * list to generate aggregation id/value pairs and emit them. */ public void map(K1 key, V1 value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { Iterator iter = this.aggregatorDescriptorList.iterator(); while (iter.hasNext()) { ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next(); Iterator<Entry<Text, Text>> ens = ad.generateKeyValPairs(key, value).iterator(); while (ens.hasNext()) { Entry<Text, Text> en = ens.next(); output.collect(en.getKey(), en.getValue()); } } }