我正在尝试用hadoop作业的主方法读取一个文件。不在Map器或缩小器中。我正在使用一个自定义jar的emr amazon
The command line is arguments: -files s3://[path]#source.xml
在我正在做的主要功能中:
File file = new File("source.xml")
我不知道分布式缓存是在main函数中可用,还是仅仅在mapper/reducer函数中可用。我需要使用distributedcache api吗?
aws正在执行的行代码:
hadoop jar /mnt/var/lib/hadoop/steps/s-1YBXTPYJ2YK44/JobTeste_SomenteLeitura.jar -files s3://stoneagebrasil/TesteBVS/sources.xml
如何才能做到这一点?
2条答案
按热度按时间unguejic1#
到目前为止,我发现在hadoop驱动程序(main函数)内的分布式缓存中读取文件是不可能的。这是因为在我启动作业之后,文件将被分发(复制到从属节点)。
解决方案是直接从s3读取文件。
mo49yndu2#
尝试,
要读取文件,