You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by "Eric Z. Beard" <er...@gmail.com> on 2013/06/20 15:20:31 UTC

initTableMapperJob with a List of Scans

Hello,

With a regular map reduce job using MultipleInputs.addInputPath, you can specify a different mapper class for each input.  With the HBase initTableMapperJob, each Scan Result gets handled by the same mapper.  How can you tell which table you are dealing with in the mapper?

Thanks,

Eric Z. Beard

Re: initTableMapperJob with a List of Scans

Posted by Jeff Kolesky <je...@opower.com>.
You should be able to get the table name from the split.  Within the map()
method:

((TableSplit)context.getInputSplit()).getTableName()

That will return the name of the table as a byte array.

Jeff




On Thu, Jun 20, 2013 at 6:20 AM, Eric Z. Beard <er...@gmail.com> wrote:

> Hello,
>
> With a regular map reduce job using MultipleInputs.addInputPath, you can
> specify a different mapper class for each input.  With the HBase
> initTableMapperJob, each Scan Result gets handled by the same mapper.  How
> can you tell which table you are dealing with in the mapper?
>
> Thanks,
>
> Eric Z. Beard




-- 
*Jeff Kolesky*
Chief Software Architect
*Opower*