Complete the code to start the YARN application by requesting a container from the ResourceManager.
container_request = [1]()The ResourceRequest object is used to request containers from the ResourceManager in YARN.
Complete the code to create the ApplicationSubmissionContext for submitting the application.
app_context = client.[1]()The createApplication() method initializes the ApplicationSubmissionContext needed to submit an application.
Fix the error in the code to correctly launch the ApplicationMaster container.
am_container = ContainerLaunchContext()
am_container.setCommands([[1]])The command must be a shell command string wrapped properly to launch the ApplicationMaster.
Fill both blanks to create a dictionary comprehension that maps container IDs to their statuses if the status is RUNNING.
running_containers = {container.[1]: container.[2] for container in containers if container.status == 'RUNNING'}Use the attributes 'id' and 'status' to access container properties in the comprehension.
Fill all three blanks to create a dictionary comprehension that maps application IDs to their final statuses if the status is FINISHED.
finished_apps = {app.[1]: app.[2] for app in apps if app.[3] == 'FINISHED'}Use 'applicationId' for the key, 'finalStatus' for the value, and filter by 'state' equal to 'FINISHED'.