Example usage for org.apache.hadoop.mapred MiniMRCluster MiniMRCluster

List of usage examples for org.apache.hadoop.mapred MiniMRCluster MiniMRCluster

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred MiniMRCluster MiniMRCluster.

Prototype

public MiniMRCluster(int jobTrackerPort, int taskTrackerPort, int numTaskTrackers, String namenode, int numDir,
            String[] racks, String[] hosts) throws IOException 

Source Link

Usage

From source file:org.lilyproject.testfw.HadoopLauncher.java

License:Apache License

public void startMiniMapReduceCluster() throws IOException {
    System.out.println("Starting mini mapreduce cluster...");
    // These are needed for the new and improved Map/Reduce framework
    System.setProperty("hadoop.log.dir", new File(baseTempDir, "hadooplogs").getAbsolutePath());
    conf.set("mapred.output.dir", new File(baseTempDir, "mapred").getAbsolutePath());
    mrCluster = new MiniMRCluster(9001, 0, 1, FileSystem.get(conf).getUri().toString(), 1, null,
            new String[] { "localhost" });
    System.out.println("Mini mapreduce cluster started");
    conf.set("mapred.job.tracker", mrCluster.createJobConf().get("mapred.job.tracker"));
}