hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Helmling <ghelml...@gmail.com>
Subject Re: Coprocessor not executing (current Snapshot)
Date Wed, 20 Apr 2011 17:49:21 GMT
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 <20seconds@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();
>
>   }
> }
>

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