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)
            throws IOException 

Source Link

Usage

From source file:com.dasasian.chok.testutil.integration.HadoopMiniCluster.java

License:Apache License

public void start() throws IOException {
    LOG.info("starting hadoop cluster...");
    Configuration conf = new Configuration();
    System.setProperty("test.build.data", "build");
    System.setProperty("hadoop.log.dir", "build/logs");

    _dfsCluster = new MiniDFSCluster(_namenodePort, conf, _datanodeCount, true, true, StartupOption.REGULAR,
            null);//from   www.ja  v a 2 s  .c o m
    LOG.info("started namnode on " + conf.get(IHadoopConstants.NAMENODE));

    _mrCluster = new MiniMRCluster(_jobtrackerPort, 0, _tasktrackerCount, conf.get(IHadoopConstants.NAMENODE),
            1);
    LOG.info("started jobtracker on " + _mrCluster.createJobConf().get(IHadoopConstants.JOBTRACKER));
}