在使用 NLineInputFormat 时,在 Hadoop Streaming 中指定 N。

huangapple go评论46阅读模式
英文:

Specify N in hadoop streaming when use NLineInputFormat

问题

You can specify the value of N for NLineInputFormat using the -D option as follows:

你可以使用以下命令来指定NLineInputFormat中的N的值:

-D mapreduce.input.lineinputformat.linespermap=N

Replace N with the desired number of lines per map task.

将其中的N替换为所需的每个map任务的行数。

英文:

If I use NLineInputFormat in hadoop streaming, how to specify N?

hadoop jar /home/Software/hadoop/share/hadoop/tools/lib/hadoop-streaming-2.6.0.jar \
-D stream.non.zero.exit.is.failure=false \
-D mapred.map.tasks=2 \
-D mapred.reduce.tasks=1 \
-files /home/hello.py \
-input /hello.txt \
-output /result \
-mapper "/home/.conda/envs/perimeter-pytorch2/bin/python hello.py" \
-inputformat org.apache.hadoop.mapred.lib.NLineInputFormat
-????

what command can specify N?

答案1

得分: 0

非废弃类是 org.apache.hadoop.mapreduce.lib.input.NLineInputFormatmapred 包中的所有类均已废弃)

根据该类的 Javadoc,您可以传递配置选项 -D mapreduce.input.lineinputformat.linespermap=N

如果您想要使用 PyTorch 与 HDFS 数据,我建议使用 Spark 或 Flink 而不是 mapreduce。

英文:

The non deprecated class is org.apache.hadoop.mapreduce.lib.input.NLineInputFormat (All classes from mapred package are deprecated)

Per Javadoc for that class, you'd pass configuration option for -D mapreduce.input.lineinputformat.linespermap=N

If you'd like to use PyTorch with HDFS data, I'd suggest using Spark or Flink over mapreduce

huangapple
  • 本文由 发表于 2023年5月25日 19:21:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76331725.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定