hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: is there a way to verify whether deployed coprocessor is loaded.
Date Thu, 16 Jul 2015 13:42:49 GMT
Can you show us how you formed Get request for row key 0?

In general you can add logging in your observer so that you can find whether it is called
by examining region server log. 


> On Jul 16, 2015, at 6:18 AM, James Teng <tenglinxiao@outlook.com> wrote:
> 
> hi all,Today when i tried to use hbase coprocessor, i encountered some issues there,
and below is detailed problem:i have defined one pretty simple region observer:public class
ClientGetRegionObserver extends BaseRegionObserver {
>    public void preGet(ObserverContext<RegionCoprocessorEnvironment> e, Get get,
List<KeyValue> results) throws IOException {
>        if (Bytes.equals(get.getRow(), Bytes.toBytes(0))) {
>            KeyValue kv = new KeyValue(Bytes.toBytes(0), Bytes.toBytes("d"), Bytes.toBytes("test"),
Bytes.toBytes("xxx"));
>            results.add(kv);
>            e.bypass();
>        }
>    }
> }and here is the config in hbase-site.xml <property>                <name>hbase.coprocessor.region.classes</name>
               <value>com.dianping.hbase.ClientGetRegionObserver</value>     
  </property>
> if the coprocessor works as expected, then i should get a column with value 'xxx' when
i issues a get request with row key 0. but it doesn't.could anyone give me some tips on this?
> thanks!
> james.                         

Mime
View raw message