我有一个“失败的映射任务超出允许的限制”错误,但我使用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