当我使用 C# 运行 MapReduce 示例应用程序时出现“失败的映射任务超出允许的限制”错误,如下所示。谁能告诉我为什么它一直显示这个错误?欣赏它。
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,类型=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' 或其依赖项之一。该系统找不到指定的文件。