コード例 #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"/>
        /// <exception cref="System.Exception"/>
        protected internal override void Map(K key, V val, Mapper.Context context)
        {
            FieldSelectionHelper helper = new FieldSelectionHelper(FieldSelectionHelper.emptyText
                                                                   , FieldSelectionHelper.emptyText);

            helper.ExtractOutputKeyValue(key.ToString(), val.ToString(), fieldSeparator, mapOutputKeyFieldList
                                         , mapOutputValueFieldList, allMapValueFieldsFrom, ignoreInputKey, true);
            context.Write(helper.GetKey(), helper.GetValue());
        }
コード例 #2
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.Exception"/>
        protected internal override void Reduce(Text key, IEnumerable <Text> values, Reducer.Context
                                                context)
        {
            string keyStr = key.ToString() + this.fieldSeparator;

            foreach (Text val in values)
            {
                FieldSelectionHelper helper = new FieldSelectionHelper();
                helper.ExtractOutputKeyValue(keyStr, val.ToString(), fieldSeparator, reduceOutputKeyFieldList
                                             , reduceOutputValueFieldList, allReduceValueFieldsFrom, false, false);
                context.Write(helper.GetKey(), helper.GetValue());
            }
        }