Hi Joerg, Try changing the table attribute name to "COPROCESSOR$1" -- it is currently case sensitive (we should probably change that).
After doing that, look for lines like the following in the region server log: "Load coprocessor ... from HTD of <tablename> successfully." or "attribute '...' has invalid coprocessor spec" --gh On Wed, Apr 20, 2011 at 8:58 AM, Joerg Schad <20seco...@web.de> wrote: > Hi, > I would like to test the new Coprocessor feature and overwrite the prePut > function of the the RegionOberserver. > Unfortunately the function is never executed... I am using the current > snapshot from the repository. > Can anyone point me into the right direction? Or is there any way to check > whether it loaded correctly? > > Thanks for any support > Joerg > > > //register the Coprocessor > HTableDescriptor desc = new HTableDescriptor(tName); > Path path = new Path("/Users/hbase/conf/CP.jar"); > desc.setValue("Coprocessor$1", > path.toString() + ":" + "Coprocessor.PrePut" + > ":" + Coprocessor.Priority.USER); > admin.createTable(desc); > //test the whether it works > > > > > //actual class > public class PrePut extends BaseRegionObserverCoprocessor { > @Override > public void prePut( final ObserverContext<RegionCoprocessorEnvironment> > e, final Map<byte[], > List<KeyValue>> familyMap, final boolean writeToWAL) throws > IOException { > > //some more Code > > //bypass normal system call > e.bypass(); > > } > } >