您的位置:首页 > 编程语言 > C#

C# Hadoop学习笔记(十)—C#的分布式计算运行结果

2013-10-28 13:15 1281 查看

一、Master启动



二、Job启动



三、本地大文件





四、启动计算节点1、2





五、启动客户端



六、开始结算



其中,客户端Mapper代码

[DataContract]
public class MyMaper : MapperBase
{

public override void Map(string inputLine, MapperContext context)
{
//interpret the incoming line as an integer value
int value = int.Parse(inputLine);
//determine whether value is even or odd
//string key = (value % 2 == 0) ? "even" : "odd";
string key = string.Empty;
if (value % 11111 == 0 && value != 0)
{
key = "11111OK";
//output key assignment with value
context.EmitKeyValue(key, value.ToString());
Watch.Display(string.Format("   !!!!!找到数字{0}是11111的倍数", value));
}
else if (value % 13721 == 0 && value != 0)
{
key = "13721OK";
//output key assignment with value
context.EmitKeyValue(key, value.ToString());
Watch.Display(string.Format("   !!!!!找到数字{0}是13721的倍数", value));
}

}
}


七、结论

待完善
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: