0
0
Hadoopdata~10 mins

YARN vs MapReduce v1 in Hadoop - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the resource manager used in YARN.

Hadoop
Configuration conf = new Configuration();
conf.set("yarn.resourcemanager.address", "[1]");
Drag options to blanks, or click blank then click option'
Alocalhost:9000
Blocalhost:8032
Clocalhost:50070
Dlocalhost:8088
Attempts:
3 left
💡 Hint
Common Mistakes
Using the NameNode port instead of the resource manager port.
Confusing the web UI port with the resource manager port.
2fill in blank
medium

Complete the code to get the number of map tasks in MapReduce v1.

Hadoop
JobConf conf = new JobConf();
int numMaps = conf.[1]();
Drag options to blanks, or click blank then click option'
AgetMapTaskCount
BgetNumReduceTasks
CgetNumTasks
DgetNumMapTasks
Attempts:
3 left
💡 Hint
Common Mistakes
Using getNumReduceTasks() instead of map tasks method.
Using a non-existent method like getMapTaskCount().
3fill in blank
hard

Fix the error in the code to submit a YARN application.

Hadoop
YarnClient yarnClient = YarnClient.createYarnClient();
yarnClient.init(conf);
yarnClient.start();
ApplicationId appId = yarnClient.[1]();
Drag options to blanks, or click blank then click option'
AgetNewApplication
BcreateApplication
CsubmitApplication
DstartApplication
Attempts:
3 left
💡 Hint
Common Mistakes
Using submitApplication() which does not exist on YarnClient.
Using startApplication() which is not a valid method.
4fill in blank
hard

Fill both blanks to create a MapReduce job configuration and set the number of reduce tasks.

Hadoop
Job job = Job.getInstance(conf, "wordcount");
job.setJarByClass([1].class);
job.[2](2);
Drag options to blanks, or click blank then click option'
AWordCount
BsetNumReduceTasks
CsetReduceTasks
DMain
Attempts:
3 left
💡 Hint
Common Mistakes
Using setReduceTasks() which is not a valid method.
Using a wrong class name like 'Main' if the job class is 'WordCount'.
5fill in blank
hard

Fill all three blanks to create a YARN container launch context with local resources and environment variables.

Hadoop
ContainerLaunchContext ctx = ContainerLaunchContext.newInstance(
    [1],
    [2],
    [3],
    null,
    null,
    null
);
Drag options to blanks, or click blank then click option'
AlocalResources
Benv
Ccommands
Dconf
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing the order of arguments.
Passing configuration object instead of commands.