0
0
Hadoopdata~10 mins

Application lifecycle in YARN in Hadoop - Interactive Code Practice

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

Complete the code to start the YARN application by requesting a container from the ResourceManager.

Hadoop
container_request = [1]()
Drag options to blanks, or click blank then click option'
AResourceRequest
BContainerLaunchContext
CApplicationSubmissionContext
DContainerRequest
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing ContainerLaunchContext with ResourceRequest.
Using ApplicationSubmissionContext instead of ResourceRequest.
2fill in blank
medium

Complete the code to create the ApplicationSubmissionContext for submitting the application.

Hadoop
app_context = client.[1]()
Drag options to blanks, or click blank then click option'
AsubmitApplication
BcreateApplication
CgetApplicationReport
DkillApplication
Attempts:
3 left
💡 Hint
Common Mistakes
Using submitApplication() instead of createApplication().
Confusing getApplicationReport() with application creation.
3fill in blank
hard

Fix the error in the code to correctly launch the ApplicationMaster container.

Hadoop
am_container = ContainerLaunchContext()
am_container.setCommands([[1]])
Drag options to blanks, or click blank then click option'
A"/bin/bash -c 'start-am.sh'"
B"start-am.sh"
C"/bin/bash start-am.sh"
D"start-am.sh &"
Attempts:
3 left
💡 Hint
Common Mistakes
Not wrapping the command in a shell call.
Adding unnecessary background operator &.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps container IDs to their statuses if the status is RUNNING.

Hadoop
running_containers = {container.[1]: container.[2] for container in containers if container.status == 'RUNNING'}
Drag options to blanks, or click blank then click option'
AgetId
BgetStatus
Cid
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using method calls instead of attributes.
Mixing up keys and values in the dictionary comprehension.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps application IDs to their final statuses if the status is FINISHED.

Hadoop
finished_apps = {app.[1]: app.[2] for app in apps if app.[3] == 'FINISHED'}
Drag options to blanks, or click blank then click option'
AapplicationId
BfinalStatus
Cstate
DappId
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attribute names like 'appId'.
Filtering by 'finalStatus' instead of 'state'.