我已经有一个带有yarn的集群,配置为使用core-site.xml中的自定义hadoop文件系统:
<property>
<name>fs.custom.impl</name>
<value>package.of.custom.class.CustomFileSystem</value>
</property>
我想在这个yarn集群上运行一个spark作业,它从这个customfilesystem读取一个输入rdd:
final JavaPairRDD<String, String> files =
sparkContext.wholeTextFiles("custom://path/to/directory");
有没有办法不用重新配置spark就可以做到这一点?i、 e.我可以将spark指向现有的core-site.xml吗?最好的方法是什么?
1条答案
按热度按时间zwghvu4y1#
套
HADOOP_CONF_DIR
到包含core-site.xml
. (这一点在《Yarn上运行Spark》中有记载。)你仍然需要确保
package.of.custom.class.CustomFileSystem
在类路径上。