Example usage for org.apache.mahout.common HadoopUtil getCustomJobName

List of usage examples for org.apache.mahout.common HadoopUtil getCustomJobName

Introduction

In this page you can find the example usage for org.apache.mahout.common HadoopUtil getCustomJobName.

Prototype

public static String getCustomJobName(String className, JobContext job, Class<? extends Mapper> mapper,
            Class<? extends Reducer> reducer) 

Source Link

Usage

From source file:my.mahout.AbstractJob.java

License:Apache License

protected Job prepareJob(Path inputPath, Path outputPath, Class<? extends InputFormat> inputFormat,
        Class<? extends Mapper> mapper, Class<? extends Writable> mapperKey,
        Class<? extends Writable> mapperValue, Class<? extends OutputFormat> outputFormat, String jobname)
        throws IOException {

    Job job = HadoopUtil.prepareJob(inputPath, outputPath, inputFormat, mapper, mapperKey, mapperValue,
            outputFormat, getConf());/*from  w  ww .j  a v a2s .  c  o m*/

    String name = jobname != null ? jobname
            : HadoopUtil.getCustomJobName(getClass().getSimpleName(), job, mapper, Reducer.class);

    job.setJobName(name);
    return job;

}

From source file:my.mahout.AbstractJob.java

License:Apache License

protected Job prepareJob(Path inputPath, Path outputPath, Class<? extends InputFormat> inputFormat,
        Class<? extends Mapper> mapper, Class<? extends Writable> mapperKey,
        Class<? extends Writable> mapperValue, Class<? extends Reducer> reducer,
        Class<? extends Writable> reducerKey, Class<? extends Writable> reducerValue,
        Class<? extends OutputFormat> outputFormat) throws IOException {
    Job job = HadoopUtil.prepareJob(inputPath, outputPath, inputFormat, mapper, mapperKey, mapperValue, reducer,
            reducerKey, reducerValue, outputFormat, getConf());
    job.setJobName(HadoopUtil.getCustomJobName(getClass().getSimpleName(), job, mapper, Reducer.class));
    return job;//  w  w  w.ja  v  a2s.co  m
}