Example #1
0
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 private void WriteToQueue(KEYOUT key, VALUEOUT value)
 {
     this.keyout   = (KEYOUT)ReflectionUtils.NewInstance(keyClass, conf);
     this.valueout = (VALUEOUT)ReflectionUtils.NewInstance(valueClass, conf);
     ReflectionUtils.Copy(conf, key, this.keyout);
     ReflectionUtils.Copy(conf, value, this.valueout);
     // wait to write output to queuue
     outputQueue.Enqueue(new Chain.KeyValuePair <KEYOUT, VALUEOUT>(keyout, valueout));
 }
Example #2
0
 /// <summary>Write key value to an output file name.</summary>
 /// <remarks>
 /// Write key value to an output file name.
 /// Gets the record writer from job's output format.
 /// Job's output format should be a FileOutputFormat.
 /// </remarks>
 /// <param name="key">the key</param>
 /// <param name="value">the value</param>
 /// <param name="baseOutputPath">
 /// base-output path to write the record to.
 /// Note: Framework will generate unique filename for the baseOutputPath
 /// </param>
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 public virtual void Write(KEYOUT key, VALUEOUT value, string baseOutputPath)
 {
     CheckBaseOutputPath(baseOutputPath);
     if (jobOutputFormatContext == null)
     {
         jobOutputFormatContext = new TaskAttemptContextImpl(context.GetConfiguration(), context
                                                             .GetTaskAttemptID(), new MultipleOutputs.WrappedStatusReporter(context));
     }
     GetRecordWriter(jobOutputFormatContext, baseOutputPath).Write(key, value);
 }
Example #3
0
 /// <summary>Writes a key/value pair.</summary>
 /// <param name="key">the key to write.</param>
 /// <param name="value">the value to write.</param>
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 public override void Write(KEYOUT key, VALUEOUT value)
 {
     if (outputQueue != null)
     {
         WriteToQueue(key, value);
     }
     else
     {
         outputContext.Write(key, value);
     }
 }
Example #4
0
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 public virtual void Write(KEYOUT key, VALUEOUT value)
 {
     output.Write(key, value);
 }
Example #5
0
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 public override void Write(KEYOUT key, VALUEOUT value)
 {
     this.reduceContext.Write(key, value);
 }