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 toreadfrom.#表名
scan - The scan instance withthe columns, time range etc.#对表的扫描操作
mapper - The mapper class to use.
outputKeyClass - The class ofthe output key.
outputValueClass - The class ofthe 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 foranyofthe configured job classes via the distributed cache (tmpjars).
Throws:
IOException - When setting up the details fails.