hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john smith <js1987.sm...@gmail.com>
Subject Re: Implementing TableMap interface
Date Fri, 24 Jul 2009 12:46:11 GMT
Thanks for replying Daniel,

The link you have provided gives the  info about adding a new jar to the
classpath .. Thats fine ...
Suppose consider the above program written by Bharath ..

It contains ...

package "org.apache.hadoop.hbase.mapred" ..

This means that the new class should be in that jar in that particular
folder ..  I think this is different to adding a new jar to classpath ..

any comments?

2009/7/24 Jean-Daniel Cryans <jdcryans@apache.org>

> Please see the doc
>
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/mapred/package-summary.html#classpath
>
> J-D
>
> 2009/7/24 john smith <js1987.smith@gmail.com>:
> > Yes i too have the same problem .. Can anyone tell me in detail how to
> > add new classes to the existing hbase jar or do we have a different
> > method to include our own classes in the program ..
> >
> > On 7/24/09, bharath vissapragada <bharathvissapragada1990@gmail.com>
> wrote:
> >> Thanks it worked fine .. Do i need to update hbase-x.x.jar ?? or is
> there
> >> some other procedure to use it in my program ... because when i updated
> >> hbase-x.x.jar .. it gave me NoClassDefFoundError while running my
> program!!
> >>
> >>
> >>
> >> 2009/7/24 Doğacan Güney <dogacan@gmail.com>
> >>
> >>> n Jul 24, 2009, at 1:00 PM, bharath vissapragada wrote:
> >>>
> >>>  Hi all,
> >>>>
> >>>> I wanted to implement TableMap interface so that "map" function can
> emit
> >>>> <Text,Text>.. I wrote the code as follows
> >>>>
> >>>>
> -------------------------------------------------------------------------------------------------------
> >>>> package org.apache.hadoop.hbase.mapred;
> >>>>
> >>>> import java.io.IOException;
> >>>> import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
> >>>> import org.apache.hadoop.hbase.io.RowResult;
> >>>> import org.apache.hadoop.io.Text;
> >>>> import org.apache.hadoop.mapred.JobConf;
> >>>> import org.apache.hadoop.mapred.MapReduceBase;
> >>>> import org.apache.hadoop.mapred.OutputCollector;
> >>>> import org.apache.hadoop.mapred.Reporter;
> >>>>
> >>>> public class MyTableMap
> >>>> extends MapReduceBase
> >>>> implements TableMap<ImmutableBytesWritable, RowResult> {
> >>>>
> >>>>  /** constructor */
> >>>>  public MyTableMap() {
> >>>>   super();
> >>>>  }
> >>>> @SuppressWarnings("unchecked")
> >>>>  public static void initJob(String table, String columns,
> >>>>   Class<? extends TableMap> mapper, JobConf job) {
> >>>>   TableMapReduceUtil.initTableMapJob(table, columns, mapper,
> >>>>     Text.class,
> >>>>     Text.class, job);
> >>>>  }
> >>>> public void map(ImmutableBytesWritable key, RowResult value,
> >>>>     OutputCollector<Text,Text> output,
> >>>>     @SuppressWarnings("unused") Reporter reporter) throws IOException
> {
> >>>>   output.collect(new Text("ss"), new Text("pp"));
> >>>>  }
> >>>> }
> >>>>
> >>>> When i compile this code .. i get the following error ....
> >>>>
> >>>> MyTableMap.java:35: org.apache.hadoop.hbase.mapred.MyTableMap is not
> >>>> abstract and does not override abstract method
> >>>>
> >>>>
> map(org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.io.RowResult,org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.io.RowResult>,org.apache.hadoop.mapred.Reporter)
> >>>> in org.apache.hadoop.mapred.Mapper
> >>>> public class MyTableMap
> >>>>      ^
> >>>> Can anyone help me out!!
> >>>>
> >>>
> >>> Your class should implement TableMap<Text, Text> not TableMap<IBW,
RR>.
> >>>
> >>> --
> >>> Doğacan Güney
> >>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message