Example usage for org.apache.hadoop.mapred HadoopTestCase LOCAL_MR

List of usage examples for org.apache.hadoop.mapred HadoopTestCase LOCAL_MR

Introduction

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

Prototype

int LOCAL_MR

To view the source code for org.apache.hadoop.mapred HadoopTestCase LOCAL_MR.

Click Source Link

Usage

From source file:com.hdfs.concat.clean.TestClean.java

License:Apache License

public TestClean() throws IOException {
    super(HadoopTestCase.LOCAL_MR, HadoopTestCase.LOCAL_FS, 1, 1);
}

From source file:com.hive_unit.HiveTestBase.java

License:Apache License

public HiveTestBase() throws IOException {
    super(HadoopTestCase.LOCAL_MR, HadoopTestCase.LOCAL_FS, 1, 1);
    Map<String, String> env = new HashMap<String, String>();
    env.putAll(System.getenv());//  w  w  w .j  ava2s  .  c o m

    if (System.getenv("HADOOP_HOME") == null) {
        String shome = System.getProperty("user.home");
        if (shome != null) {
            File hadoopHome = new File(new File(shome, "hadoop"), "hadoop-1.2.1_local");
            if (hadoopHome.exists()) {
                env.put("HADOOP_HOME", hadoopHome.getAbsolutePath());
                EnvironmentHack.setEnv(env);
                LOGGER.info(String.format("HADOOP_HOME was set by hiveunit to %1$s.",
                        System.getenv("HADOOP_HOME")));
            }
            File target = new File("target/hadoop-1.2.1");
            if (target.exists()) {
                env.put("HADOOP_HOME", target.getAbsolutePath());
                EnvironmentHack.setEnv(env);
                LOGGER.info(String.format("HADOOP_HOME was set by hiveunit to %1$s.",
                        System.getenv("HADOOP_HOME")));
            }
        } else {
            LOGGER.info(String.format("HADOOP_HOME was found in environment as %1$s. Using that for hiveunit.",
                    System.getenv("HADOOP_HOME")));
        }
        //detect variable or hadoop in path and throw exception here?
    }
}

From source file:com.jointhegrid.hive_test.HiveTestBase.java

License:Apache License

public HiveTestBase() throws IOException {
    super(HadoopTestCase.LOCAL_MR, HadoopTestCase.LOCAL_FS, 1, 1);

    try {/*from   w ww . j  a v a2  s  .c o m*/
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    Map<String, String> env = new HashMap<String, String>();
    env.putAll(System.getenv());
    if (System.getenv("HADOOP_HOME") == null) {
        String shome = System.getProperty("user.home");
        if (shome != null) {
            File home = new File(shome);
            File hadoopR = new File(home, "hadoop");
            File hadoopHome = new File(hadoopR, "hadoop-0.20.2_local");
            if (hadoopHome.exists()) {
                env.put("HADOOP_HOME", hadoopHome.getAbsolutePath());
                EnvironmentHack.setEnv(env);
            }
            File target = new File("target/hadoop-0.20.2");
            if (target.exists()) {
                env.put("HADOOP_HOME", target.getAbsolutePath());
                EnvironmentHack.setEnv(env);
            }
        }
    }
}

From source file:io.vitess.hadoop.MapReduceIT.java

License:Apache License

public MapReduceIT() throws IOException {
    super(HadoopTestCase.LOCAL_MR, HadoopTestCase.LOCAL_FS, 1, 1);
}

From source file:seoeun.hadoop.multipleoutputs.TestMRMultipleOutputs.java

License:Apache License

public TestMRMultipleOutputs() throws IOException {
    super(HadoopTestCase.LOCAL_MR, HadoopTestCase.LOCAL_FS, 1, 1);
}