Package org.apache.hadoop.mapred.ControlledMapReduceJob

Examples of org.apache.hadoop.mapred.ControlledMapReduceJob.ControlledMapReduceJobRunner


    props.setProperty("mapred.tasktracker.map.tasks.maximum", "2");
    props.setProperty("mapred.tasktracker.reduce.tasks.maximum", "2");
    startCluster(true, props);
    LOG.info("Started the cluster");

    ControlledMapReduceJobRunner jobRunner =
        ControlledMapReduceJobRunner
            .getControlledMapReduceJobRunner(createJobConf(), 7, 6);
    jobRunner.start();
    ControlledMapReduceJob controlledJob = jobRunner.getJob();
    JobInProgress jip =
        getMRCluster().getJobTrackerRunner().getJobTracker().getJob(
            jobRunner.getJobID());

    ControlledMapReduceJob.waitTillNTasksStartRunning(jip, true, 4);
    LOG.info("Finishing 3 maps");
    controlledJob.finishNTasks(true, 3);
    ControlledMapReduceJob.waitTillNTotalTasksFinish(jip, true, 3);

    ControlledMapReduceJob.waitTillNTasksStartRunning(jip, true, 4);
    LOG.info("Finishing 4 more maps");
    controlledJob.finishNTasks(true, 4);
    ControlledMapReduceJob.waitTillNTotalTasksFinish(jip, true, 7);

    ControlledMapReduceJob.waitTillNTasksStartRunning(jip, false, 4);
    LOG.info("Finishing 2 reduces");
    controlledJob.finishNTasks(false, 2);
    ControlledMapReduceJob.waitTillNTotalTasksFinish(jip, false, 2);

    ControlledMapReduceJob.waitTillNTasksStartRunning(jip, false, 4);
    LOG.info("Finishing 4 more reduces");
    controlledJob.finishNTasks(false, 4);
    ControlledMapReduceJob.waitTillNTotalTasksFinish(jip, false, 6);

    jobRunner.join();
  }
View Full Code Here


      clusterProps.put("mapred.tasktracker.reduce.tasks.maximum", String.valueOf(0));

      // cluster capacity 2 maps, 0 reduces
      startCluster(1, clusterProps, schedulerProps);

      ControlledMapReduceJobRunner jobRunner =
              ControlledMapReduceJobRunner.getControlledMapReduceJobRunner(
              getJobConf(), 4, 0);
      jobRunner.start();
      ControlledMapReduceJob controlledJob = jobRunner.getJob();
      JobID myJobID = jobRunner.getJobID();
      JobInProgress myJob = getJobTracker().getJob(myJobID);
      ControlledMapReduceJob.waitTillNTasksStartRunning(myJob, true, 2);

      LOG.info("Trying to finish 2 maps");
      controlledJob.finishNTasks(true, 2);
View Full Code Here

    props.setProperty(TTConfig.TT_MAP_SLOTS, "2");
    props.setProperty(TTConfig.TT_REDUCE_SLOTS, "2");
    startCluster(true, props);
    LOG.info("Started the cluster");

    ControlledMapReduceJobRunner jobRunner =
        ControlledMapReduceJobRunner
            .getControlledMapReduceJobRunner(createJobConf(), 7, 6);
    jobRunner.start();
    ControlledMapReduceJob controlledJob = jobRunner.getJob();
    JobInProgress jip =
        getMRCluster().getJobTrackerRunner().getJobTracker().getJob(
            jobRunner.getJobID());

    ControlledMapReduceJob.waitTillNTasksStartRunning(jip, true, 4);
    LOG.info("Finishing 3 maps");
    controlledJob.finishNTasks(true, 3);
    ControlledMapReduceJob.waitTillNTotalTasksFinish(jip, true, 3);

    ControlledMapReduceJob.waitTillNTasksStartRunning(jip, true, 4);
    LOG.info("Finishing 4 more maps");
    controlledJob.finishNTasks(true, 4);
    ControlledMapReduceJob.waitTillNTotalTasksFinish(jip, true, 7);

    ControlledMapReduceJob.waitTillNTasksStartRunning(jip, false, 4);
    LOG.info("Finishing 2 reduces");
    controlledJob.finishNTasks(false, 2);
    ControlledMapReduceJob.waitTillNTotalTasksFinish(jip, false, 2);

    ControlledMapReduceJob.waitTillNTasksStartRunning(jip, false, 4);
    LOG.info("Finishing 4 more reduces");
    controlledJob.finishNTasks(false, 4);
    ControlledMapReduceJob.waitTillNTotalTasksFinish(jip, false, 6);

    jobRunner.join();
  }
View Full Code Here

      clusterProps.put("mapred.tasktracker.reduce.tasks.maximum", String.valueOf(0));

      // cluster capacity 2 maps, 0 reduces
      startCluster(1, clusterProps, schedulerProps);

      ControlledMapReduceJobRunner jobRunner =
              ControlledMapReduceJobRunner.getControlledMapReduceJobRunner(
              getJobConf(), 4, 0);
      jobRunner.start();
      ControlledMapReduceJob controlledJob = jobRunner.getJob();
      JobID myJobID = jobRunner.getJobID();
      JobInProgress myJob = getJobTracker().getJob(myJobID);
      ControlledMapReduceJob.waitTillNTasksStartRunning(myJob, true, 2);

      LOG.info("Trying to finish 2 maps");
      controlledJob.finishNTasks(true, 2);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.ControlledMapReduceJob.ControlledMapReduceJobRunner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.