[Exception记录]elephantbird.class.for.MultiInputFormat

 
java.lang.RuntimeException: elephantbird.class.for.MultiInputFormat is not set
	at com.twitter.elephantbird.mapreduce.input.MultiInputFormat.setTypeRef(MultiInputFormat.java:132)
	at com.twitter.elephantbird.mapreduce.input.MultiInputFormat.createRecordReader(MultiInputFormat.java:84)
	at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:644)
	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:330)
	at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:396)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1438)
	at org.apache.hadoop.mapred.Child.main(Child.java:262)

今天发现这个错误,之前也老出现,总是忘了为什么,年纪大了?

		LzoThriftBlockInputFormat.setClassConf(MbaSessionLog.class, conf);
		job.setInputFormatClass(LzoThriftBlockInputFormat.class);
看一眼LzoThriftBlockInputFormat.setClassConf()的源码,调用HadoopUtils.setClassConf(conf, CLASS_CONF_KEY, clazz);而这个CLASS_CONF_KEY="elephantbird.class.for.MultiInputFormat";看起来没啥问题。于是想到应该是conf有问题,想起从前set configuration中参数时因调用set太晚没成功设置。

于是改成: 

           

		LzoThriftBlockInputFormat.setClassConf(MbaSessionLog.class, job.getConfiguration());
		job.setInputFormatClass(LzoThriftBlockInputFormat.class);
果然可以。


且记录下这个低级错误,以免再浪费时间。




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值