You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by anil gupta <an...@gmail.com> on 2014/08/03 07:01:45 UTC

Protobuf (Protos) for Coprocessors in HBase0.98

Hi All,

I am trying to upgrade to HBase0.98 from HBase0.94.
It seems like Coprocessors of HBase0.94 needs to be completely rewritten
because of ProtoBuf.
I started reading about ProtoBuf last week. I am still learning it.

I am trying to port SortingCoprocessor(HBase-7474)  to 0.98. I need to use
Scan message in my Sorting.Proto. Scan message is defined in Client.proto
file in HBase0.98.

Now, as per Protobuf document for importing Client.proto in Sorting.proto.
Compilation of Sorting.proto needs local copy of  Client.proto and other
dependent proto files.(
https://developers.google.com/protocol-buffers/docs/proto#other)
I am reluctant to make a local copy of Client.proto and other dependent
proto files in my project because in future if there is any update to
protos in HBase then i will need to do maintenance in my code base.
Is there any neat trick in Protobuf to avoid copying HBase proto files to
my project? If not, what would be the best approach?

I am also planning to update the patch of HBase-7474.

Here is my initial/tentative proto definition for Sorting CP that i am
trying to compile(inspired from Aggregate.proto):






























*option java_package = "com.intuit.hbase.protobuf.generated";option
java_outer_classname = "SortingProtos";option java_generic_services =
true;option java_generate_equals_and_hash = true; option optimize_for =
SPEED;import "Client.proto";message SortingRequest {  /** The request
passed to the SortingService consists of three parts* (1) the (canonical)
classname of the ColumnInterpreter implementation * (2) the Scan query* (3)
any bytes required to construct the ColumnInterpreter object* properly*/
required string interpreter_class_name = 1;  required Scan scan = 2;
optional bytes interpreter_specific_bytes = 3; }message SortingResponse {
repeated bytes first_part = 1;  optional bytes second_part = 2;}service
SortingService {  rpc SortIncreasing (SortingRequest) returns
(SortingResponse);   rpc sortDecreasing (SortingRequest) returns
(SortingResponse);}*


-- 
Thanks & Regards,
Anil Gupta