HBase和MapReduce框架之TableMapReduceUtil类

  • initTableMapperJob方法
public static void initTableMapperJob(String table, 
                                      Scan scan, 
                                      Class<? extends TableMapper> mapper, 
                                      Class<?> outputKeyClass, 
                                      Class<?> outputValueClass, 
                                      org.apache.hadoop.mapreduce.Job job, 
                                      boolean addDependencyJars, 
                                      Class<? extends org.apache.hadoop.mapreduce.InputFormat> inputFormatClass) 
                               throws IOException 
 
Use this before submitting a TableMap job. It will appropriately set up the job. 
 
Parameters: 
    table - The table name to read from.#表名 
    scan - The scan instance with the columns, time range etc.#对表的扫描操作 
    mapper - The mapper class to use. 
    outputKeyClass - The class of the output key. 
    outputValueClass - The class of the output value. 
    job - The current job to adjust. Make sure the passed job is carrying all necessary HBase configuration. 
    addDependencyJars - upload HBase jars and jars for any of the configured job classes via the distributed cache (tmpjars). 
Throws: 
    IOException - When setting up the details fails. 

评论关闭
IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

HBase和MapReduce框架之TableMapReduceUtil类