hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Helmling <ghelml...@gmail.com>
Subject Re: RegionObserver Coprocessor PreGet
Date Wed, 02 Feb 2011 17:59:53 GMT
Hi JS,

For a real (though a little complicated) example of coprocessors, you can
check out the HBase security code.  The latest working code is up on github:

https://github.com/trendmicro/hbase/tree/security

See the org.apache.hadoop.hbase.security.rbac.AccessController class for the
actual RegionObserver implementation.


> Here my questions
> a) I extended my class from BaseRegionObserverCoprocessor instead of
> BaseRegionObserver, is that correct? Or where is the later class located?
>

Yes, BaseRegionObserverCoprocessor is correct.


> b) as in difference to the example BaseRegionObserverCoprocessor.preGet()
> has return type void, how could I actually change the Get Object to be
> returned?
>

In preGet(), you can change the request criteria by mutating the Get
directly (calling either setXXX or mutating the family map).  You can also
provide your own results and preempt the Get processing by mutating the
List<KeyValue> results and then calling
RegionCoprocessorEnvironment.bypass() to short-circuit the processing.

C) is there some other code example for using BaseRegionObserver
> Coprocessor? The javadoc example is somehow incomplete (but also extends
> BaseRegionObserverCoprocessor)
>
>
See the HBase security code above.  It's one application.  Also see the test
code, though it's pretty simple --
org.apache.hadoop.hbase.coprocessor.TestRegionObserverInterface and
TestRegionObserverStacking.


> Sorry if these questions are trivial, just getting started...
>

Not at all, _everyone_ is just getting started with coprocessors! :)


--gh

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