Complete the code to specify the resource manager used in YARN.
Configuration conf = new Configuration(); conf.set("yarn.resourcemanager.address", "[1]");
The resource manager in YARN listens on port 8032 by default. This address is used to communicate with the resource manager.
Complete the code to get the number of map tasks in MapReduce v1.
JobConf conf = new JobConf();
int numMaps = conf.[1]();getNumReduceTasks() instead of map tasks method.getMapTaskCount().In MapReduce v1, getNumMapTasks() returns the number of map tasks configured for the job.
Fix the error in the code to submit a YARN application.
YarnClient yarnClient = YarnClient.createYarnClient();
yarnClient.init(conf);
yarnClient.start();
ApplicationId appId = yarnClient.[1]();submitApplication() which does not exist on YarnClient.startApplication() which is not a valid method.The correct method to create a new application in YARN is getNewApplication(). It returns an ApplicationId for the new app.
Fill both blanks to create a MapReduce job configuration and set the number of reduce tasks.
Job job = Job.getInstance(conf, "wordcount"); job.setJarByClass([1].class); job.[2](2);
setReduceTasks() which is not a valid method.The class name is usually the main class like WordCount. The method to set reduce tasks is setNumReduceTasks().
Fill all three blanks to create a YARN container launch context with local resources and environment variables.
ContainerLaunchContext ctx = ContainerLaunchContext.newInstance(
[1],
[2],
[3],
null,
null,
null
);The newInstance method takes local resources, environment variables, and commands as the first three arguments.