hadoop测试题目-每天5题,总35题,第六天
地址: http://www.cnblogs.com/jarlean/archive/2013/04/14/3020772.html
Q26. Is it possible to provide multiple input to Hadoop? If yes then how can you give multiple directories as input to the Hadoop job
Yes, The input format class provides methods to add multiple directories as input to a Hadoop job(使用input format class实现,不是很理解,hadoop的最大特点就是冗余多,hadoop不是本来就该是多个存放位置吗)
Q27. Is it possible to have Hadoop job output in multiple directories. If yes then how
Yes, by using Multiple Outputs class(使用Multple Outputs class实现)
Q28. What will a hadoop job do if you try to run it with an output directory that is already present? Will it
- overwrite it
- warn you and continue
- throw an exception and exit
The hadoop job will throw an exception and exit.(如果输出路径已存在,则会抛出异常并退出任务)
Q29. How can you set an arbitary number of mappers to be created for a job in Hadoop
This is a trick question. You cannot set it(不能设置hadoop的mapper任务数,没有参数控制?)
Q30. How can you set an arbitary number of reducers to be created for a job in Hadoop
You can either do it progamatically by using method setNumReduceTasksin the JobConfclass or set it up as a configuration setting(可用setNumReduceTasksin方法设置,或者通过配置来设置)