norbert icon indicating copy to clipboard operation
norbert copied to clipboard

Added support for building against Protobuf 2.6

Open stromnet opened this issue 9 years ago • 0 comments

This adds support for building with protobuf 2.6.1. For me, the main reason is that protobuf 2.5+ has OSGI headers, but other pro's with 2.6 exists. However, 2.4 and 2.6 are not proto-generated-code-compatible so I've made it optional to use 2.6.

Since ProtoUtils does some speedup-magic, special care had to be taken. The ByteString(byte[]) constructor is gone in 2.6. Instead a new LiteralByteString class exists. ProtoUtils will auto-detect if this exists, and use that approach instead.

Possible optimisation would be to ensure fastByteStringToByteArray is either a 2.4 or 2.6 implementation, rather than checking every time. Unfortunately I'm not fluent enough in scala, so I haven't quite figured out how to do that (if it is even possible)

Note that the builder must manually rebuild the protocols in cluster/src/main/protobuf, since the generated files are NOT compatible!

stromnet avatar Mar 04 '15 15:03 stromnet