// Path: src/main/java/org/apache/hadoop/mapred/HFSPScheduler.java
// enum QueueType {
//   TRAIN, SIZE_BASED
// };


import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import junit.framework.TestCase;
import org.apache.hadoop.mapred.HFSPScheduler.QueueType;
import org.apache.hadoop.mapred.UtilsForTests.FakeClock;
import org.apache.hadoop.mapreduce.TaskType;
import org.apache.hadoop.mapreduce.server.jobtracker.TaskTracker;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Test;
  private JobTracker jobTracker;
  private static int jtPort = 8012;

  @Override
  protected void setUp() throws Exception {
    HFSPFakeJobInProgress.jobCounter = 0;
    System.setProperty("hadoop.log.dir",
        "/tmp/testHFSP_" + Long.toString(System.currentTimeMillis()));
    this.setUpLog4J();
    this.setUpCluster(1, 2, false);
  }

  private void setUpLog4J() {
    // BasicConfigurator.configure();
    Logger.getRootLogger().setLevel(Level.INFO);
    Logger.getLogger(JobTracker.class).setLevel(Level.DEBUG);
    Logger.getLogger(HFSPScheduler.class).setLevel(Level.DEBUG);
  }

  private void setUpCluster(int numRacks, int numNodesPerRack,
      boolean assignMultiple) throws IOException, IllegalArgumentException,
      InstantiationException, IllegalAccessException,
      InvocationTargetException, InterruptedException {
    this.conf = new JobConf();
    this.conf.setInt(HFSPScheduler.TRAINER_MIN_MAPS_KEYNAME, 0);
    this.conf.setInt(CompletedTasksTrainer.NUM_MAP_COMPLETED_KEY, 1);
    this.conf.setInt(HFSPScheduler.TRAINER_MIN_REDUCES_KEYNAME, 0);
    this.conf.setInt(SojournTrainer.getSojournConfKeyname(
        HFSPScheduler.PREFIX_KEYNAME, TaskType.REDUCE), 1);

// Path: src/main/java/org/apache/hadoop/mapred/HFSPScheduler.java
// enum QueueType {
//   TRAIN, SIZE_BASED
// };


// Path: src/test/java/org/apache/hadoop/mapred/TestHFSP.java
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import junit.framework.TestCase;
import org.apache.hadoop.mapred.HFSPScheduler.QueueType;
import org.apache.hadoop.mapred.UtilsForTests.FakeClock;
import org.apache.hadoop.mapreduce.TaskType;
import org.apache.hadoop.mapreduce.server.jobtracker.TaskTracker;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Test;

  private JobTracker jobTracker;
  private static int jtPort = 8012;

  @Override
  protected void setUp() throws Exception {
    HFSPFakeJobInProgress.jobCounter = 0;
    System.setProperty("hadoop.log.dir",
        "/tmp/testHFSP_" + Long.toString(System.currentTimeMillis()));
    this.setUpLog4J();
    this.setUpCluster(1, 2, false);
  }

  private void setUpLog4J() {
    // BasicConfigurator.configure();
    Logger.getRootLogger().setLevel(Level.INFO);
    Logger.getLogger(JobTracker.class).setLevel(Level.DEBUG);
    Logger.getLogger(HFSPScheduler.class).setLevel(Level.DEBUG);
  }

  private void setUpCluster(int numRacks, int numNodesPerRack,
      boolean assignMultiple) throws IOException, IllegalArgumentException,
      InstantiationException, IllegalAccessException,
      InvocationTargetException, InterruptedException {
    this.conf = new JobConf();
    this.conf.setInt(HFSPScheduler.TRAINER_MIN_MAPS_KEYNAME, 0);
    this.conf.setInt(CompletedTasksTrainer.NUM_MAP_COMPLETED_KEY, 1);
    this.conf.setInt(HFSPScheduler.TRAINER_MIN_REDUCES_KEYNAME, 0);
    this.conf.setInt(SojournTrainer.getSojournConfKeyname(
        HFSPScheduler.PREFIX_KEYNAME, TaskType.REDUCE), 1);

    this.conf.set("mapred.job.tracker", "localhost:0");