Dan*_*bos 7 hadoop apache-spark
"old" SparkContext.hadoopFile接受一个minPartitions参数,这是分区数量的提示:
def hadoopFile[K, V](
path: String,
inputFormatClass: Class[_ <: InputFormat[K, V]],
keyClass: Class[K],
valueClass: Class[V],
minPartitions: Int = defaultMinPartitions
): RDD[(K, V)]
Run Code Online (Sandbox Code Playgroud)
但是没有这样的论点SparkContext.newAPIHadoopFile:
def newAPIHadoopFile[K, V, F <: NewInputFormat[K, V]](
path: String,
fClass: Class[F],
kClass: Class[K],
vClass: Class[V],
conf: Configuration = hadoopConfiguration): RDD[(K, V)]
Run Code Online (Sandbox Code Playgroud)
实际上mapred.InputFormat.getSplits需要一个提示参数,但mapreduce.InputFormat.getSplits需要一个JobContext.通过新API影响拆分数量的方法是什么?
我已经尝试设置mapreduce.input.fileinputformat.split.maxsize与fs.s3n.block.size上Configuration对象,但他们没有影响.我正在尝试从中加载4.5 GB文件s3n,并将其加载到单个任务中.
https://issues.apache.org/jira/browse/HADOOP-5861是相关的,但它表明我应该已经看到多个拆分,因为默认块大小是64 MB.
该功能newApiHadoopFile允许您传递配置对象,以便您可以设置mapred.max.split.size.
即使这是在mapred命名空间中,因为似乎没有新选项我会想象新的API会尊重变量.
| 归档时间: |
|
| 查看次数: |
2508 次 |
| 最近记录: |