HBase和MapReduce框架之TableMapReduceUtil类

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. 

猜你喜欢

转载自blog.csdn.net/liu16659/article/details/80792462