Hi, I will try that now. How does that mechanism work?
The custom filter is serialized according to the Writable interface by writing it to a DataOutput. How is the Object reconstructed from that? Does HBase use reflection for that? How does HBase know the class name? Kind regards, Michael El lun, 09-02-2009 a las 09:07 -0800, stack escribió: > 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 <[email protected]> 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 > > > > > > > >
