예제 #1
0
        /// <summary>The identify function.</summary>
        /// <remarks>The identify function. Input key/value pair is written directly to output.
        ///     </remarks>
        /// <exception cref="System.IO.IOException"/>
        public virtual void Map(K key, V val, OutputCollector <Org.Apache.Hadoop.IO.Text,
                                                               Org.Apache.Hadoop.IO.Text> output, Reporter reporter)
        {
            FieldSelectionHelper helper = new FieldSelectionHelper(FieldSelectionHelper.emptyText
                                                                   , FieldSelectionHelper.emptyText);

            helper.ExtractOutputKeyValue(key.ToString(), val.ToString(), fieldSeparator, mapOutputKeyFieldList
                                         , mapOutputValueFieldList, allMapValueFieldsFrom, ignoreInputKey, true);
            output.Collect(helper.GetKey(), helper.GetValue());
        }
예제 #2
0
        // TODO Auto-generated method stub
        /// <exception cref="System.IO.IOException"/>
        public virtual void Reduce(Org.Apache.Hadoop.IO.Text key, IEnumerator <Org.Apache.Hadoop.IO.Text
                                                                               > values, OutputCollector <Org.Apache.Hadoop.IO.Text, Org.Apache.Hadoop.IO.Text>
                                   output, Reporter reporter)
        {
            string keyStr = key.ToString() + this.fieldSeparator;

            while (values.HasNext())
            {
                FieldSelectionHelper helper = new FieldSelectionHelper();
                helper.ExtractOutputKeyValue(keyStr, values.Next().ToString(), fieldSeparator, reduceOutputKeyFieldList
                                             , reduceOutputValueFieldList, allReduceValueFieldsFrom, false, false);
                output.Collect(helper.GetKey(), helper.GetValue());
            }
        }