Hi During one of the tasks that we were doing, we wanted to upgrade to pb 3 and we found exactly the same issue as you have explained here wrt to ByteString encapsulating the LiteralByteString.
The task that we were doing was with HBase trunk (which will be coming out as HBase-2.0). Hence as part of this JIRA https://issues.apache.org/jira/browse/HBASE-16567 The changes to HBaseZeroCopyByteString has been removed. Not only that we have shaded the protobuf 3.1 inside HBase so that we can accomodate our own extension/changes to protobuf to suit our needs. What is the version of hbase are you using? In your class path since you have already upgraded the pb to the latest and your version of hbase using the older pb may have some conflicts. I don't have a soln to this right now but just highlighting the fact that the community has already accomodated itself for the future pb releases and changes. Regards Ram On Wed, May 24, 2017 at 2:06 PM, Jing Zhang <[email protected] > wrote: > Hi, developers, > > My company uses HBase, and in our code base, we need to use both HBase and > protobuf. > > However, for some reason we need to upgrade protobuf to the latest version, > but I found the recent protobuf changes affect HBase. Its class > 'LiteralByteString' which HBase uses has been encapsulated into a private > static class inside class 'ByteString' since protobuf 3.0.0 Beta3 (Or some > version before or after). > > In class 'ZeroCopyLiteralString' > (hbase-protocol/src/main/java/com/google/protobuf/), I tried to use > 'UnsafeByteOperation.unsafeWrap' instead, but failed at method > 'zeroCopyGetBytes'. > > I wonder whether there is an approach in HBase to accommodate to protobuf's > change and what's you suggest to make the changes. Also, do you have plan > to change the relevant codes to be compatible with the new version of > protobuf? > > Hope to get your help! Perhaps my question has been asked before, but I'm a > freshman to HBase it's difficult to find the topic in a large mail list. So > please share the link if it does exist. > > Thanks very much! > > -- > > Jing. >
