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

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

Introduction

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

Prototype

String DEFAULT_APPLICATION_NAME

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

Click Source Link

Document

Default application name

Usage

From source file:org.apache.tez.mapreduce.client.YARNRunner.java

License:Apache License

private DAG createDAG(FileSystem fs, JobID jobId, Configuration[] stageConfs, String jobSubmitDir,
        Credentials ts, Map<String, LocalResource> jobLocalResources) throws IOException {

    String jobName = stageConfs[0].get(MRJobConfig.JOB_NAME, YarnConfiguration.DEFAULT_APPLICATION_NAME);
    DAG dag = DAG.create(jobName);/*from w ww .j a v  a  2s .  c o  m*/

    LOG.info("Number of stages: " + stageConfs.length);

    List<TaskLocationHint> mapInputLocations = getMapLocationHintsFromInputSplits(jobId, fs, stageConfs[0],
            jobSubmitDir);
    List<TaskLocationHint> reduceInputLocations = null;

    Vertex[] vertices = new Vertex[stageConfs.length];
    for (int i = 0; i < stageConfs.length; i++) {
        vertices[i] = createVertexForStage(stageConfs[i], jobLocalResources,
                i == 0 ? mapInputLocations : reduceInputLocations, i, stageConfs.length);
    }

    for (int i = 0; i < vertices.length; i++) {
        dag.addVertex(vertices[i]);
        if (i > 0) {
            // Set edge conf based on Input conf (compression etc properties for MapReduce are
            // w.r.t Outputs - MAP_OUTPUT_COMPRESS for example)
            Map<String, String> partitionerConf = null;
            if (stageConfs[i - 1] != null) {
                partitionerConf = Maps.newHashMap();
                for (Map.Entry<String, String> entry : stageConfs[i - 1]) {
                    partitionerConf.put(entry.getKey(), entry.getValue());
                }
            }
            OrderedPartitionedKVEdgeConfig edgeConf = OrderedPartitionedKVEdgeConfig
                    .newBuilder(stageConfs[i - 1].get(TezRuntimeConfiguration.TEZ_RUNTIME_KEY_CLASS),
                            stageConfs[i - 1].get(TezRuntimeConfiguration.TEZ_RUNTIME_VALUE_CLASS),
                            MRPartitioner.class.getName(), partitionerConf)
                    .configureInput().useLegacyInput().done().setFromConfiguration(stageConfs[i - 1]).build();
            Edge edge = Edge.create(vertices[i - 1], vertices[i], edgeConf.createDefaultEdgeProperty());
            dag.addEdge(edge);
        }

    }
    return dag;
}

From source file:org.apache.tez.mapreduce.YARNRunner.java

License:Apache License

private DAG createDAG(FileSystem fs, JobID jobId, Configuration[] stageConfs, String jobSubmitDir,
        Credentials ts, Map<String, LocalResource> jobLocalResources) throws IOException {

    String jobName = stageConfs[0].get(MRJobConfig.JOB_NAME, YarnConfiguration.DEFAULT_APPLICATION_NAME);
    DAG dag = new DAG(jobName);

    LOG.info("Number of stages: " + stageConfs.length);

    List<TaskLocationHint> mapInputLocations = getMapLocationHintsFromInputSplits(jobId, fs, stageConfs[0],
            jobSubmitDir);//from w w  w . jav a 2 s  . c  o  m
    List<TaskLocationHint> reduceInputLocations = null;

    Vertex[] vertices = new Vertex[stageConfs.length];
    for (int i = 0; i < stageConfs.length; i++) {
        vertices[i] = createVertexForStage(stageConfs[i], jobLocalResources,
                i == 0 ? mapInputLocations : reduceInputLocations, i, stageConfs.length);
    }

    for (int i = 0; i < vertices.length; i++) {
        dag.addVertex(vertices[i]);
        if (i > 0) {
            EdgeProperty edgeProperty = new EdgeProperty(ConnectionPattern.BIPARTITE, SourceType.STABLE,
                    new OutputDescriptor(OnFileSortedOutput.class.getName(), null),
                    new InputDescriptor(ShuffledMergedInput.class.getName(), null));

            Edge edge = null;
            edge = new Edge(vertices[i - 1], vertices[i], edgeProperty);
            dag.addEdge(edge);
        }

    }
    return dag;
}