// Different map tasks operate at different speeds.
            // We define behavior for 6 threads.
            // Used to ensure that the compiler doesn't optimize away
            // some code.
            protected override void Setup(Mapper.Context context)
            {
                // Get the thread num from the file number.
                FileSplit split    = (FileSplit)context.GetInputSplit();
                Path      filePath = split.GetPath();
                string    name     = filePath.GetName();

                this.threadId = Sharpen.Extensions.ValueOf(name);
                Log.Info("Thread " + threadId + " : " + context.GetInputSplit());
            }
Exemple #2
0
 /// <summary>Get the final part of the input name</summary>
 /// <param name="split">the input split</param>
 /// <returns>the "part-r-00000" for the input</returns>
 private string GetFilename(FileSplit split)
 {
     return(split.GetPath().GetName());
 }