hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Seibold <seib...@in.tum.de>
Subject Re: HBase: scanner with custom filter causes Exception
Date Tue, 10 Feb 2009 07:04:23 GMT
Hi,

Sorry, the abstract is a typo. Actually I created a Filter hierachy with
an abstract base class. I omitted that for brevity.

Kind regards,
Michael

El lun, 09-02-2009 a las 14:09 -0800, Dru Jensen escribiรณ:
> Can you can do a new() on an abstract class?
> On Feb 9, 2009, at 9:07 AM, stack wrote:
> 
> > Your new class needs to be on the server's CLASSPATH as well as on the
> > client-side.
> > St.Ack
> >
> >
> >
> > On Mon, Feb 9, 2009 at 4:26 AM, Michael Seibold <seibold@in.tum.de>  
> > wrote:
> >
> >> Hi,
> >>
> >> I want to create a scanner with a custom filter, but always get the
> >> exception below.
> >>
> >> 1. I have implemented the RowFilterInterface:
> >>
> >> public abstract class CustomFilter implements RowFilterInterface {
> >>
> >> //...implemented method from interface RowFilterInterface
> >>
> >>       public boolean filterRowKey(byte[] rowKey) {
> >> ...
> >>
> >>
> >> //...implemented method from interface Writable
> >>       public void write(DataOutput out) throws IOException {
> >>               out.writeUTF(str);
> >>       }
> >>
> >>       public void readFields(DataInput in) throws IOException {
> >>               str = in.readUTF();
> >>       }
> >>
> >>       public static CustomFilter read(DataInput in) throws  
> >> IOException
> >>       {
> >>               CustomFilter f = new CustomFilter();
> >>               f.readFields(in);
> >>               return f;
> >>       }
> >> }
> >>
> >> 2. I create the scanner the following way:
> >>
> >> RowFilterInterface customScanFilter = new CustomFilter();
> >> table.getScanner(scanColumns, scanStartRow, customScanFilter);
> >>
> >>
> >> 3. I get the following exception in the region server:
> >> ERROR org.apache.hadoop.hbase.regionserver.HRegionServer
> >> : org.apache.hadoop.hbase.UnknownScannerException: Name: -1
> >> INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handl
> >> call next(-1, 30) from 127.0.0.1:54631: error: org.apache.hadoop.
> >> hbase.UnknownScannerException: Name: -1
> >> org.apache.hadoop.hbase.UnknownScannerException: Name: -1
> >>       at
> >> org.apache.hadoop.hbase.regionserver.HRegionServer.next(HRegionServer
> >> .java:1568)
> >>       at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
> >>       at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> >> sorImpl.java:25)
> >>       at java.lang.reflect.Method.invoke(Method.java:597)
> >>       at org.apache.hadoop.hbase.ipc.HBaseRPC
> >> $Server.call(HBaseRPC.java:632)
> >>       at org.apache.hadoop.hbase.ipc.HBaseServer
> >> $Handler.run(HBaseServer.java:
> >> 895)
> >>
> >> What am I doing wrong? Does the region server need the java source  
> >> code
> >> of my custom filter? Currently java source code of my custom filter  
> >> is
> >> only available on the client machine, not on the machine where the
> >> region server is installed? How is this "mobile-code" via the  
> >> Writable
> >> interface supposed to work? How do I make my custom scanner available
> >> for the region server?
> >>
> >> Kind regards,
> >> Michael
> >>
> >>
> >>
> >>
> 


Mime
View raw message