Example usage for org.apache.hadoop.yarn.conf YarnConfiguration TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_DONE_DIR

List of usage examples for org.apache.hadoop.yarn.conf YarnConfiguration TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_DONE_DIR

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.conf YarnConfiguration TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_DONE_DIR.

Prototype

String TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_DONE_DIR

To view the source code for org.apache.hadoop.yarn.conf YarnConfiguration TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_DONE_DIR.

Click Source Link

Usage

From source file:org.apache.tez.dag.history.ats.acls.TestATSHistoryV15.java

License:Apache License

@BeforeClass
public static void setup() throws IOException {
    try {//from   w  w w . ja  v a 2 s  . c o m
        conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, TEST_ROOT_DIR);
        dfsCluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).format(true).racks(null).build();
        remoteFs = dfsCluster.getFileSystem();
    } catch (IOException io) {
        throw new RuntimeException("problem starting mini dfs cluster", io);
    }

    if (mrrTezCluster == null) {
        try {
            mrrTezCluster = new MiniTezClusterWithTimeline(TestATSHistoryV15.class.getName(), 1, 1, 1, true);
            Configuration conf = new Configuration();
            conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
            conf.set("fs.defaultFS", remoteFs.getUri().toString()); // use HDFS
            conf.setInt("yarn.nodemanager.delete.debug-delay-sec", 20000);
            atsActivePath = new Path("/tmp/ats/active/" + random.nextInt(100000));
            Path atsDonePath = new Path("/tmp/ats/done/" + random.nextInt(100000));
            conf.setDouble(YarnConfiguration.TIMELINE_SERVICE_VERSION, 1.5);

            remoteFs.mkdirs(atsActivePath);
            remoteFs.mkdirs(atsDonePath);

            conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 1);
            conf.set(YarnConfiguration.TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_ACTIVE_DIR,
                    remoteFs.resolvePath(atsActivePath).toString());
            conf.set(YarnConfiguration.TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_DONE_DIR,
                    remoteFs.resolvePath(atsDonePath).toString());

            mrrTezCluster.init(conf);
            mrrTezCluster.start();
        } catch (Throwable e) {
            LOG.info("Failed to start Mini Tez Cluster", e);
        }
    }
    user = UserGroupInformation.getCurrentUser().getShortUserName();
    timelineAddress = mrrTezCluster.getConfig().get(YarnConfiguration.TIMELINE_SERVICE_WEBAPP_ADDRESS);
    if (timelineAddress != null) {
        // Hack to handle bug in MiniYARNCluster handling of webapp address
        timelineAddress = timelineAddress.replace("0.0.0.0", "localhost");
    }
}