hamr.core.general.job.GeneralJob.java Source code

Java tutorial

Introduction

Here is the source code for hamr.core.general.job.GeneralJob.java

Source

/*
  Copyright (c) 2015, Yiju Wei. 
    
  HAMR is a Frame let you use annotations to describe and execute a MapReduce process.
    
  This program is free software; you can redistribute it and/or modify it under the terms
  of the GNU General Public License as published by the Free Software Foundation; version 2
  of the License.
    
  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.
    
  You should have received a copy of the GNU General Public License along with this
  program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth
  Floor, Boston, MA 02110-1301  USA
    
 */
package hamr.core.general.job;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Job;

import hamr.core.general.bean.AnnotedBean;
import hamr.core.general.group.GeneralGroupComparator;
import hamr.core.general.mapper.GeneralMapper;
import hamr.core.general.partitioner.GeneralPartitioner;
import hamr.core.general.reducer.GeneralReducer;

public class GeneralJob {

    public static void generalization(Class<? extends AnnotedBean> abClass, Job job) {
        job.setMapperClass(GeneralMapper.class);
        job.setPartitionerClass(GeneralPartitioner.class);
        job.setMapOutputKeyClass(abClass);
        job.setMapOutputValueClass(NullWritable.class);
        job.setReducerClass(GeneralReducer.class);
        job.setGroupingComparatorClass(GeneralGroupComparator.class);
    }

}