嗨,我想问个问题。我开始了解Apache风暴。有没有可能在hdfs中读取数据文件。??
示例:我在目录中有一个数据txt文件 /user/hadoop
在hdfs上。有可能突然读到那个文件吗。??thx之前
因为当我尝试运行storm时,如果文件不存在,我会收到一条错误消息。当我尝试从本地存储中读取文件来运行它时,它成功了
>>> Starting to create Topology ...
---> Read Class: FileReaderSpout , 1387957892009
---> Read Class: Split , 1387958291266
---> Read Class: Identity , 247_Identity_1387957902310_1
---> Read Class: SubString , 1387964607853
---> Read Class: Trim , 1387962789262
---> Read Class: SwitchCase , 1387962333010
---> Read Class: Reference , 1387969791518
File /reff/test.txt .. not exists ..
1条答案
按热度按时间vybvopom1#
当然!下面是如何从hdfs读取文件的示例:
这不使用任何特定于storm的东西,只使用HadoopAPI(hadoopcommon.jar)。
你得到的错误看起来像是因为你的文件路径不正确。