Example usage for org.apache.hadoop.mapred JobConf get

List of usage examples for org.apache.hadoop.mapred JobConf get

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred JobConf get.

Prototype

public String get(String name) 

Source Link

Document

Get the value of the name property, null if no such property exists.

Usage

From source file:com.intel.hadoop.graphbuilder.demoapps.wikipedia.docwordgraph.WordCountGraphTokenizer.java

License:Open Source License

@Override
public void configure(JobConf job) {
    try {/*from w  ww  . j  av a2 s.  co  m*/
        fs = FileSystem.get(job);
    } catch (IOException e1) {
        e1.printStackTrace();
    }

    String path = job.get("Dictionary");
    if (path != null) {
        try {
            loadDictionary(path);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

From source file:com.intel.hadoop.graphbuilder.idnormalize.mapreduce.HashIdMapper.java

License:Open Source License

@Override
public void configure(JobConf job) {
    super.configure(job);
    this.curId = 0;
    try {/*from  ww  w.  j a  v a  2  s.  c o  m*/
        this.graphparser = (GraphParser) Class.forName(job.get("GraphParser")).newInstance();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
}

From source file:com.intel.hadoop.graphbuilder.idnormalize.mapreduce.HashIdReducer.java

License:Open Source License

@Override
public void configure(JobConf job) {
    super.configure(job);
    splitsize = job.getInt("mapred.line.input.format.linespermap", 600000);
    try {/*from   ww  w .ja  v a 2  s .c  o  m*/
        this.graphparser = (GraphParser) Class.forName(job.get("GraphParser")).newInstance();
        this.vidparser = (FieldParser) Class.forName(job.get("VidParser")).newInstance();
        this.vdataparser = (FieldParser) Class.forName(job.get("VdataParser")).newInstance();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
}

From source file:com.intel.hadoop.graphbuilder.idnormalize.mapreduce.SortDictMapper.java

License:Open Source License

@Override
public void configure(JobConf job) {
    super.configure(job);
    this.hashRawVid = job.getBoolean("hashRawVid", true);
    this.numChunks = job.getInt("numChunks", 256);
    try {/*from   www .j a v a2  s.c  o  m*/
        this.vidparser = (FieldParser) Class.forName(job.get("VidParser")).newInstance();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
}

From source file:com.intel.hadoop.graphbuilder.idnormalize.mapreduce.TransEdgeMapper.java

License:Open Source License

@Override
public void configure(JobConf conf) {
    super.configure(conf);
    numChunks = conf.getInt("numChunks", 256);
    dictionaryPath = conf.get("dictionaryPath");
    dict = new HashMap<VidType, Long>();
    dictionaryId = -1;/*from   w  ww . j  a  v  a  2s .c  om*/

    try {
        fs = FileSystem.get(conf);
    } catch (IOException e1) {
        e1.printStackTrace();
    }

    try {
        this.graphparser = (GraphParser) Class.forName(conf.get("GraphParser")).newInstance();
        this.vidparser = (FieldParser) Class.forName(conf.get("VidParser")).newInstance();
        this.edataparser = (FieldParser) Class.forName(conf.get("EdataParser")).newInstance();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }

}

From source file:com.intel.hadoop.graphbuilder.idnormalize.mapreduce.TransEdgeReducer.java

License:Open Source License

@Override
public void configure(JobConf conf) {
    super.configure(conf);
    numChunks = conf.getInt("numChunks", 256);
    dictionaryPath = conf.get("dictionaryPath");
    dict = new HashMap<VidType, Long>();
    dictionaryId = -1;//from w  ww  . ja  va 2s.  c  om

    try {
        fs = FileSystem.get(conf);
    } catch (IOException e1) {
        e1.printStackTrace();
    }

    try {
        this.graphparser = (GraphParser) Class.forName(conf.get("GraphParser")).newInstance();
        this.vidparser = (FieldParser) Class.forName(conf.get("VidParser")).newInstance();
        this.edataparser = (FieldParser) Class.forName(conf.get("EdataParser")).newInstance();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
}

From source file:com.intel.hadoop.graphbuilder.partition.mapreduce.edge.EdgeIngressMapper.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override/* w w w . j a  v  a 2  s  . co m*/
public void configure(JobConf job) {
    super.configure(job);
    this.keyClass = job.getMapOutputKeyClass();
    this.valClass = job.getMapOutputValueClass();
    numprocs = job.getInt("numProcs", 1);
    overpartition = job.getInt("overpartition", 1);

    String ingressMethod = job.get("ingress");
    if (ingressMethod.equals("greedy")) {
        this.ingress = new GreedyIngress<VidType>(numprocs);
    } else {
        this.ingress = new RandomIngress<VidType>(numprocs);
    }

    try {
        this.graphparser = (GraphParser) Class.forName(job.get("GraphParser")).newInstance();
        this.vidparser = (FieldParser) Class.forName(job.get("VidParser")).newInstance();
        this.vdataparser = (FieldParser) Class.forName(job.get("VdataParser")).newInstance();
        this.edataparser = (FieldParser) Class.forName(job.get("EdataParser")).newInstance();
        this.mapKey = (KeyType) keyClass.newInstance();
        this.mapValue = (ValueType) valClass.newInstance();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
}

From source file:com.intel.hadoop.graphbuilder.preprocess.mapreduce.CreateGraphMapper.java

License:Open Source License

@Override
public void configure(JobConf job) {
    super.configure(job);
    try {// www .  ja  v  a2 s  .c o m
        this.tokenizer = (GraphTokenizer) Class.forName(job.get("GraphTokenizer")).newInstance();
        tokenizer.configure(job);
        this.valClass = job.getMapOutputValueClass();
        mapVal = (VertexEdgeUnionType) valClass.newInstance();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
}

From source file:com.intel.hadoop.graphbuilder.preprocess.mapreduce.CreateGraphReducer.java

License:Open Source License

@Override
public void configure(JobConf job) {
    super.configure(job);
    this.valClass = job.getMapOutputValueClass();
    this.noBidir = job.getBoolean("noBidir", false);
    try {/*  w ww .j av a2 s.  com*/
        if (job.get("EdgeFunc") != null) {
            this.EdgeFunc = (Functional) Class.forName(job.get("EdgeFunc")).newInstance();
            this.EdgeFunc.configure(job);
        }
        if (job.get("VertexFunc") != null) {
            this.VertexFunc = (Functional) Class.forName(job.get("VertexFunc")).newInstance();
            this.VertexFunc.configure(job);
        }
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.intel.hadoop.graphbuilder.preprocess.mapreduce.EdgeTransformMapper.java

License:Open Source License

@Override
public void configure(JobConf job) {
    super.configure(job);
    this.reduceEndPoint = job.getBoolean("reduceEndPoint", EdgeTransformMR.SOURCE);
    try {/*  w w  w .j a v a  2 s  . c  om*/
        this.graphparser = (GraphParser) Class.forName(job.get("GraphParser")).newInstance();
        this.vidparser = (FieldParser) Class.forName(job.get("VidParser")).newInstance();
        this.edataparser = (FieldParser) Class.forName(job.get("EdataParser")).newInstance();
        this.valClass = job.getMapOutputValueClass();
        val = (PairListType) valClass.newInstance();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
}