Example usage for org.apache.hadoop.conf Configuration addDefaultResource

List of usage examples for org.apache.hadoop.conf Configuration addDefaultResource

Introduction

In this page you can find the example usage for org.apache.hadoop.conf Configuration addDefaultResource.

Prototype

public static synchronized void addDefaultResource(String name) 

Source Link

Document

Add a default resource.

Usage

From source file:org.elasticsearch.hadoop.integration.yarn.YarnTestCluster.java

License:Apache License

@Override
protected void before() throws Throwable {
    if (yarnCluster != null) {
        return;//w ww . j  a  v a  2 s . c o  m
    }

    System.out.println("Starting YARN cluster...");

    //tempDir = System.getProperty("java.io.tmpdir");
    //System.setProperty("java.io.tmpdir", "/tmp-yarn");

    //        FileContext.DEFAULT_PERM.fromShort((short) 777);
    //        FileContext.DIR_DEFAULT_PERM.fromShort((short) 777);
    //        FileContext.FILE_DEFAULT_PERM.fromShort((short) 777);
    //ContainerExecutor.TASK_LAUNCH_SCRIPT_PERMISSION.fromShort((short) 777);

    // make sure to use IP discovery
    Configuration.addDefaultResource("yarn-test-site.xml");

    cfg.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, "build/es-yarn/" + CLUSTER_NAME + "-dfs");

    dfsCluster = new MiniDFSCluster.Builder(cfg).numDataNodes(nodes).build();
    System.out.println("Started DFS cluster...");

    cfg.set(YarnConfiguration.YARN_MINICLUSTER_FIXED_PORTS, "true");
    yarnCluster = new MiniYARNCluster(CLUSTER_NAME, nodes, 1, 1);
    yarnCluster.init(cfg);
    yarnCluster.start();
    System.out.println("Started YARN cluster...");
}

From source file:org.goldenorb.conf.OrbConfiguration.java

License:Apache License

/**
 * //from   w  ww  . j a va2s . c  o  m
 * @param  Configuration conf
 * @returns Configuration
 */
private static Configuration addOrbResources(Configuration conf) {
    conf.addDefaultResource("orb-default.xml");
    conf.addDefaultResource("orb-site.xml");
    return conf;
}

From source file:org.janusgraph.hadoop.compat.h2.ImmutableConfiguration.java

License:Apache License

public static void addDefaultResource(String name) {
    Configuration.addDefaultResource(name);
}

From source file:org.unigram.likelike.lsh.LSHRecommendations.java

License:Apache License

/**
 * Add configuration from xml files.//from   w w w . j av  a2s.c o  m
 */
private void setDefaultConfiguration() {
    Configuration.addDefaultResource("conf/likelike-default.xml");
    Configuration.addDefaultResource("conf/likelike-site.xml");
}