PrepAway - Latest Free Exam Questions & Answers

How will the Fair Scheduler handle these two jobs?

You have a cluster running with the fair Scheduler enabled. There are currently no jobs running on
the cluster, and you submit a job A, so that only job A is running on the cluster. A while later, you
submit Job B. now Job A and Job B are running on the cluster at the same time. How will the Fair
Scheduler handle these two jobs?

PrepAway - Latest Free Exam Questions & Answers

A.
When Job B gets submitted, it will get assigned tasks, while job A continues to run with fewer
tasks.

B.
When Job B gets submitted, Job A has to finish first, before job B can gets scheduled.

C.
When Job A gets submitted, it doesn’t consumes all the task slots.

D.
When Job A gets submitted, it consumes all the task slots.

23 Comments on “How will the Fair Scheduler handle these two jobs?

  1. cbk says:

    guys all the answers for CCA 500 are incorrect.
    none of the answers available in market are reliable.
    I’ve failed miserably by submitting these answers….




    0



    0
  2. Arun says:

    Imagine two jobs are running that each have enough tasks to saturate more than the entire cluster. One job wants each of its mappers to get 1GB, and another job wants its mappers to get 2GB. Suppose the first job starts and fills up the entire cluster. Whenever one of its task finishes, it will leave open a 1GB slot. Even though the second job deserves the space, a naive policy will give it to the first one because it’s the only job with tasks that fit. This could cause the second job to be starved indefinitely.
    So Answer is B
    http://blog.cloudera.com/blog/2013/06/improvements-in-the-hadoop-yarn-fair-scheduler/




    0



    0
    1. Shiwang says:

      Disagree. The example that you have taken from one of the Cloudera blog is a special case.

      Initially Job A would be acquiring the entire slots in the cluster and as soon as another job is submitted, it starts taking up slots from the cluster(if it fits the resource requirement).




      0



      0
    2. Dare says:

      I disagree with you. Answer the question if each of the jobs require 1GB each? As A mappers releases resources, will the fair scheduler give the slot back to A? given that the available resource can also fit into B?

      My choice here will be A

      Quoting the definition on https://hadoop.apache.org/docs/r2.7.3/hadoop-yarn/hadoop-yarn-site/FairScheduler.html

      “Fair scheduling is a method of assigning resources to applications such that all apps get, on average, an equal share of resources over time.”

      Underline the word “Over Time”




      0



      0
      1. Dare says:

        In addition to the website’s explanation

        “When there is a single app running, that app uses the entire cluster. When other apps are submitted, resources that free up are assigned to the new apps”

        So “D” is also a candidate for a correct answer




        0



        0
  3. Raghav says:

    Ans should be A and D if it is multi choice.
    Fair scheduler will dynamically balance resources between all running jobs. Just after the first (large) job starts, it is the only job running, so it gets all the resources in the cluster. When the second (small) job starts, it is allocated half of the cluster resources so that each job is using its fair share of resources.

    Please refer: Page 90 of Definitive guide for more detail




    0



    0
  4. red says:

    Correct Answer is D only. When job is submitted, it is the only job running and will take up all slots. When B is submitted, if preemption is enabled, few tasks from A are killed to give slots to B. by default preemption is false




    0



    0
  5. stailer says:

    Took the test recently, this question has 5 options and it’s a Multi-choice question. From what I’ve studied it should be A and D.




    0



    0
  6. Rakesh says:

    When job A is submitted all the resources are assigned to job A. Once job B is submitted, it has to wait until job A releases some resources (Job A will release some resources right after finishing its Map phase). This is when Job B gets some free slots based on fairness of the scheduler and job B starts to process.

    But, say if the job B is submitted to the cluster during the reduce phase of Job A then Job B has to wait until Job A’s reduce phase is complete and Job B will pick all the free resources if there is no other job running at the point of time and this goes on. This is my understanding of Fair Scheduler. Please feel free to correct me if I am wrong.

    Based on my understanding, the answers should be B and D.




    0



    0
  7. Pramod Kumar says:

    The correct answer is D and A. If a cluster doesn’t have enough resources, both jobs will get staled forever and start executing only more resources are added to the cluster.
    The fair scheduler attempts to distribute resources fairly. The queue with the fewest resources is chosen first to get the resources and within the queue, application with the fewest resources gets the next available resources. In above question job A will get all the resources first, but when job B is submitted, scheduler will allocate available resources to job B.




    0



    0
  8. raushan says:

    Correct answer A,D..
    When first job is submitted it will get all the slots as there is no other job. However when job B gets submitted , it will get its fair share




    0



    0

Leave a Reply

Your email address will not be published. Required fields are marked *