是否可以更改驱动程序类中使用的vcores数量?

时间:2015-05-19 17:52:54

标签: java hadoop mapreduce yarn

我已经通过Yarn提交了一份MR工作,它只使用了2个vcores,因此很慢。

我在驱动程序代码中设置了conf.set("mapreduce.map.cpu.vcores", "35");,即

Configuration conf = new Configuration();
GenericOptionsParser optionParser = new GenericOptionsParser(conf, args);
String[] remainingArgs = optionParser.getRemainingArgs();
if (!(remainingArgs.length != 2 || remainingArgs.length != 4)) {
    System.err.println("Usage: DataProcessorMR <in> <out> <config> <daten-tool>");
    System.exit(2);
}
Job job = Job.getInstance(conf, "DataProcessorMR");
job.setJarByClass(DataProcessorMR.class);
job.setMapperClass(DPMapper.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(NullWritable.class);
job.addCacheFile(new Path(args[2]).toUri());
job.addCacheFile(new Path(args[3]).toUri());
conf.set("mapreduce.map.cpu.vcores", "35");
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
System.exit(job.waitForCompletion(true) ? 0 : 1);

但这对纱线资源管理器没有影响?如何在java类中设置YARN MapReduce作业的VCORES数。

0 个答案:

没有答案
相关问题