incubator-mrunit-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brock Noland <br...@cloudera.com>
Subject Re: Unit testing for hbase mapreduce mapper
Date Wed, 14 Mar 2012 14:46:18 GMT
Hi,

Have you tried testing a TableMapper with MRUnit?  I don't see a
reason why it wouldn't work. Of course you'd have to create your
ImmuatbleBytesWritable and Result objects.

Brock

On Mon, Mar 12, 2012 at 8:30 PM, Anthony Mak <Anthony.Mak@optus.com.au> wrote:
> hi,
>
> I can find resource on how to unit test using Mrunit for a class that implements a Mapper
or Reducer, but how can test the following map() method of MyMapper which extends the TableMapper,
which reads from hbase?
> Is it possible to unit test MyMapper below? Any pointers will be very helpful :)
>
> import org.apache.hadoop.hbase.mapreduce.TableMapper;
>
> public class MyMapper extends
>                TableMapper<ImmutableBytesWritable, DoubleWritable> {
> ....
>        protected void map(
>                        ImmutableBytesWritable key,
>                        org.apache.hadoop.hbase.client.Result result,
>                        org.apache.hadoop.mapreduce.Mapper<ImmutableBytesWritable,
org.apache.hadoop.hbase.client.Result, ImmutableBytesWritable, DoubleWritable>.Context
context)
>                        throws java.io.IOException, InterruptedException {
>
> Please reply to:
>  anthony.mak@optus.com.au
>
> Thanks you so much.
>
> Kind Regards,
> Anthony Mak



-- 
Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/

Mime
View raw message