0
0
Hadoopdata~10 mins

Why YARN manages cluster resources in Hadoop - Test Your Understanding

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

Complete the code to import the YARN ResourceManager client.

Hadoop
from yarn_api_client import [1]
Drag options to blanks, or click blank then click option'
ANodeManager
BResourceManager
CJobTracker
DClusterManager
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing ResourceManager with NodeManager or JobTracker.
2fill in blank
medium

Complete the code to initialize the ResourceManager client with the correct URL.

Hadoop
rm = ResourceManager('http://[1]:8088/ws/v1/cluster')
Drag options to blanks, or click blank then click option'
Acluster-node
Bhadoop-master
Clocalhost
Dyarn-resourcemanager
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localhost' when connecting to a remote cluster.
3fill in blank
hard

Fix the error in the code to get cluster metrics from YARN.

Hadoop
metrics = rm.[1]()
Drag options to blanks, or click blank then click option'
Aget_cluster_metrics
Bfetch_metrics
Ccluster_status
Dmetrics_info
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names that do not exist in the client.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps node IDs to their states.

Hadoop
node_states = {node['[1]']: node['[2]'] for node in nodes}
Drag options to blanks, or click blank then click option'
AnodeId
Bstate
Cid
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect keys like 'id' or 'status' which do not exist.
5fill in blank
hard

Fill all three blanks to filter nodes that are RUNNING and create a list of their IDs.

Hadoop
running_nodes = [node['[1]'] for node in nodes if node['[2]'] == '[3]']
Drag options to blanks, or click blank then click option'
AnodeId
Bstate
CRUNNING
DACTIVE
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ACTIVE' instead of 'RUNNING' as the state filter.