Database Reference
In-Depth Information
Finally, register the coprocessor as follows:
<property>
<name>ObserverCoprocessorEx</name>
<value>com.ch5.ObserverCoprocessorEx</value>
</property>
To register multiple coprocessors, a comma-separated list needs to be provided with
the value property. Once the coprocessor is registered, the status of a coprocessor can
also be checked using the following HBase shell command:
hbase(main):020:0>status 'ObserverCoprocessorEx'
The endpoint coprocessor
Endpoint coprocessors are powerful and store procedures, such as features provided
by HBase. These coprocessors can be invoked at any time from the client. Once
invoked, the endpoint coprocessor implementation will be executed at the target
region or regions and will return the results to the calling client.
The endpoint coprocessor is also an interface to dynamically extend the RPC
protocol used by HBase. Once the endpoint coprocessor implementation is installed,
it unfolds additional methods to the client. Using these extensions, new features
can be added to HBase without modifying or recompiling HBase binaries. These
endpoints are deined and callable as " protocol buffers ( protobuf )" services.
Protocol buffers are Google's language-neutral, platform-neutral,
extensible mechanism to serialize structured data. Once the structure
for the data is deined, it can be easily written and read, using special
generated source code to and from a variety of data streams and using
a variety of languages—Java, C++, or Python. For more details, refer to
https://developers.google.com/protocol-buffers/ .
The following steps need to be performed to build a custom endpoint coprocessor:
1. Deine the coprocessor service and the supporting message types for the
RPC methods in a .proto ile.
2.
Run the protoc command to generate the service and message code.
3.
Provide implementation for the following:
° Implement the protobuf service interface
° Create a new org.apache.hadoop.hbase.coprocessor.
CoprocessorService interface. This interface is required to
register the exposed service with RegionCoprocessorHost .
 
Search WWH ::




Custom Search