首页 \ 问答 \ 为仅用于地图的作业运行Hadoop Map Reduce时出错(Error when running Hadoop Map Reduce for map-only job)

为仅用于地图的作业运行Hadoop Map Reduce时出错(Error when running Hadoop Map Reduce for map-only job)

我想在Hadoop MapReduce运行仅限地图的作业,以下是我的代码:

    Configuration conf = new Configuration();
    Job job = new Job(conf);
    job.setJobName("import");

    job.setMapperClass(Map.class);//Custom Mapper
    job.setInputFormatClass(TextInputFormat.class);
    job.setNumReduceTasks(0);

    TextInputFormat.setInputPaths(job, new Path("/home/jonathan/input"));

但我得到的错误:

13/07/17 18:22:48 ERROR security.UserGroupInformation: PriviledgedActionException
as: jonathan cause:org.apache.hadoop.mapred.InvalidJobConfException: 
Output directory not set. 
Exception in thread "main" org.apache.hadoop.mapred.InvalidJobConfException: 
 Output directory not set.

然后我试着用这个:

job.setOutputFormatClass(org.apache.hadoop.mapred.lib.NullOutputFormat.class);

但它给我一个编译错误:

java: method setOutputFormatClass in class org.apache.hadoop.mapreduce.Job 
  cannot be applied to given types;
  required: java.lang.Class<? extends org.apache.hadoop.mapreduce.OutputFormat>
  found: java.lang.Class<org.apache.hadoop.mapred.lib.NullOutputFormat>
  reason: actual argument java.lang.Class
  <org.apache.hadoop.mapred.lib.NullOutputFormat> cannot be converted to 
  java.lang.Class<? extends org.apache.hadoop.mapreduce.OutputFormat> 
  by method invocation conversion

我究竟做错了什么?


I want to run a map-only job in Hadoop MapReduce, here's my code:

    Configuration conf = new Configuration();
    Job job = new Job(conf);
    job.setJobName("import");

    job.setMapperClass(Map.class);//Custom Mapper
    job.setInputFormatClass(TextInputFormat.class);
    job.setNumReduceTasks(0);

    TextInputFormat.setInputPaths(job, new Path("/home/jonathan/input"));

But I get the error:

13/07/17 18:22:48 ERROR security.UserGroupInformation: PriviledgedActionException
as: jonathan cause:org.apache.hadoop.mapred.InvalidJobConfException: 
Output directory not set. 
Exception in thread "main" org.apache.hadoop.mapred.InvalidJobConfException: 
 Output directory not set.

Then I tried to use this:

job.setOutputFormatClass(org.apache.hadoop.mapred.lib.NullOutputFormat.class);

But it gives me a compilation error:

java: method setOutputFormatClass in class org.apache.hadoop.mapreduce.Job 
  cannot be applied to given types;
  required: java.lang.Class<? extends org.apache.hadoop.mapreduce.OutputFormat>
  found: java.lang.Class<org.apache.hadoop.mapred.lib.NullOutputFormat>
  reason: actual argument java.lang.Class
  <org.apache.hadoop.mapred.lib.NullOutputFormat> cannot be converted to 
  java.lang.Class<? extends org.apache.hadoop.mapreduce.OutputFormat> 
  by method invocation conversion

What am I doing wrong?


原文:https://stackoverflow.com/questions/17710606
更新时间:2022-05-10 14:05

最满意答案


Found all the information I needed here:

http://technet.microsoft.com/en-us/library/ee921441.aspx

相关问答

更多
  • 那么,让我进一步解释一下。 (所有网址都是虚构的!)正如我所说的,访问者访问http://www.yourwebpage.com并表示他想登录。他被重定向到http://your.loginpage.org?return=http: //www.yourwebpage.com/Authenticated他将不得不提供他的用户名和密码。 当他的帐户信息有效时,他将返回到登录URL中提供的页面,但具有将用作ID的附加参数。 因此,他去http://www.yourwebpage.com/Authenticate ...
  • 为.NET应用程序实现SSO有多种选择。 在线查看以下教程: 2012年7月 单身登录基础知识 http://www.codeproject.com/Articles/429166/Basics-of-Single-Sign-on-SSO GaryMcAllisterOnline:ASP.NET MVC 4,ADFS 2.0和第三方STS集成(IdentityServer2) , 2013年1月 http://garymcallisteronline.blogspot.com/2013/01/aspnet- ...
  • 与AD帐户一起是通用解决方案。 Kerberos无处不在。 这是唯一一次会在登录时要求您提供凭据的机制。 这一切都是可行的,你需要: KDC 正确的DNS条目 KDC帐户 正确的SPN条目 配置为与KDC通信的客户端计算机 Java应用程序使用JAAS和JGSS来获取服务票据 GSS-API与您的GTK +应用程序一起获取服务票据 你自己弄清楚了什么? Going with AD account IS the generic solution. Kerberos is ubiquitous. This is ...
  • 事实证明这种方法是完全错误的! 如果有人正在考虑如何做到这一点,那么请看看这个精彩的博客 http://usingnat.net/sharepoint/2011/2/23/how-to-programmatically-authenticate-to-uag-protected-sharep.html Turns out this approach is completely wrong! IF someone is looking on how to do the above, then please l ...
  • 找到我需要的所有信息: http://technet.microsoft.com/en-us/library/ee921441.aspx Found all the information I needed here: http://technet.microsoft.com/en-us/library/ee921441.aspx
  • 以下是可靠和/或可行且非常简单的实施解决方案 https://www.simpleauth.com/ https://rpxnow.com/signup_landing_basic (免费基本版) http://openid.net/developers/ http://www.gigya.com/public/platform/Register.aspx (非免费) Following are the reliable and/or viable and very simple to implement ...
  • 有一个选项。 进入CAS模块的配置页面(/ admin / config / people / cas)。 在字段集重定向下,选中此复选框: 检查CAS服务器以查看用户是否已登录? There is an option for that. Go to the configuration page of CAS module (/admin/config/people/cas). Under the fieldset Redirection, check this checkbox: Check with t ...
  • 显然,iOS 8包含一个证书支持,允许用户使用基于证书的单点登录来对企业应用程序进行身份验证。 账户框架 Accounts框架(Accounts.framework)为某些用户帐户提供单一登录模型。 单点登录消除了为多个帐户单独提示用户的需要,从而改善了用户体验。 它还通过管理应用程序的帐户授权过程,简化了您的开发模型。 您将此框架与Social框架结合使用。 所以你应该看看帐户框架参考 Apparently iOS 8 includes a certificate-support that allows ...
  • cPanel特定产品区域显示的模板存储在: 模块/服务器/的cPanel /模板/ 您可以使用主题中的自定义文件覆盖它: http://docs.whmcs.com/Working_with_Module_Templates 侧栏链接可以用钩子隐藏: http://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet 希望这些细节有所帮助 The template for the cPanel specific product area display is stor ...
  • 与此相关的最佳途径可能是寻找与框架无关的东西,即可以与任何PHP框架一起使用的东西,但仍然可以为您完成所有艰苦的工作。 看看Packagist的很多内容,包括一些优秀的多提供商OpenID包和OAuth包。 它们都可以用作曲家安装,你可以在Laravel 3(和4)的start.php文件中为它们做很多设置。 希望这可以帮助! The best route to go down with this is probably to look for something that's framework agno ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)