Exemple #1
0
 /// <summary>The waiting function.</summary>
 /// <remarks>
 /// The waiting function.  The reduce exits once it gets a signal. Here the
 /// signal is the file existence.
 /// </remarks>
 /// <exception cref="System.IO.IOException"/>
 public virtual void Reduce(WritableComparable key, IEnumerator <Writable> val, OutputCollector
                            <WritableComparable, Writable> output, Reporter reporter)
 {
     if (fs != null)
     {
         while (!fs.Exists(signal))
         {
             try
             {
                 reporter.Progress();
                 lock (this)
                 {
                     Sharpen.Runtime.Wait(this, 1000);
                 }
             }
             catch (Exception)
             {
                 // wait for 1 sec
                 System.Console.Out.WriteLine("Interrupted while the map was waiting for the" + " signal."
                                              );
                 break;
             }
         }
     }
     else
     {
         throw new IOException("Could not get the DFS!!");
     }
 }
 /// <summary>Report progress.</summary>
 public override void Progress()
 {
     reporter.Progress();
 }