我有一個「失敗的映射任務超出允許的限制」錯誤,但我使用C#運行MapReduce示例應用程序,如下所示。 任何人都可以告訴我爲什麼它會一直向我顯示這個錯誤嗎? 欣賞它。「失敗的映射任務超出允許的限制」來自Hadoop的錯誤
public override void Map(string inputLine, MapperContext context)
{
//Extract the namespace declarations in the Csharp files
var reg = new Regex(@"(using)\s[A-za-z0-9_\.]*\;");
var matches = reg.Matches(inputLine);
foreach (Match match in matches)
{
//Just emit the namespaces.
context.EmitKeyValue(match.Value, "1");
}
}
}
//Reducer
public class NamespaceReducer : ReducerCombinerBase
{
//Accepts each key and count the occurrances
public override void Reduce(string key, IEnumerable<string> values, ReducerCombinerContext context)
{
//Write back
context.EmitKeyValue(key, values.Count().ToString());
}
}
//Our Namespace counter job
public class NamespaceCounterJob : HadoopJob<NamespaceMapper, NamespaceReducer>
{
public override HadoopJobConfiguration Configure(ExecutorContext context)
{
var config = new HadoopJobConfiguration();
config.InputPath = "Input/CodeFiles";
config.OutputFolder = "Output/CodeFiles";
return config;
}
}
static void Main(string[] args)
{
var hadoop = Hadoop.Connect();
var result = hadoop.MapReduceJob.ExecuteJob<NamespaceCounterJob>();
}
=========================================== ===================================
錯誤的作業跟蹤器日誌顯示如下。
感謝您的幫助。
未處理的異常:Microsoft.Hadoop.MapReduce.StreamingException:無法加載用戶類型。 DLL = c:\ hadoop \ HDFS \ mapred \ local \ taskTracker \ Administrator \ jobcache \ job_201309041952_0030 \ attempt_201309041952_0030_m_000000_0 \ work \ MRRunner.exe,Type = MRRunner.Program + NamespaceMapper ---> System.IO.FileNotFoundException:無法加載文件或彙編'file:/// c:\ hadoop \ HDFS \ mapred \ local \ taskTracker \ Administrator \ jobcache \ job_201309041952_0030 \ attempt_201309041952_0030_m_000000_0 \ work \ MRRunner.exe'或其依賴項之一。該系統找不到指定的文件。
如果你能顯示失敗的地圖任務輸出是什麼,這將是有幫助的。 – xdumaine