BewareMyPower opened a new pull request #11388:
URL: https://github.com/apache/pulsar/pull/11388


   ### Motivation
   
   It's a feature catchup of https://github.com/apache/pulsar/pull/8372, which 
implemented protobuf native schema in Java client. This PR is to support 
protobuf native schema in C++ client.
   
   ### Modifications
   
   Since the protobuf native schema is based on protobuf-v3, we need to upgrade 
the protobuf to 3.x.y in build/docker/Dockerfile. From 
https://github.com/apache/pulsar/pull/9046 and PIP-75, the patched protobuf 
2.4.1 were replaced by lightproto, so this PR removes protobuf.patch and 
install protobuf 3.17.1 instead of 2.4.1.
   
   In addition, when I installed the `rvm` in docker image, it failed to 
download GPG keys from remote server. So I adopted another way to download 
keys, see https://rvm.io/rvm/security#alternatives. The updated image has 
already been uploaded as apachepulsar/pulsar-build:ubuntu-16.04-pb3 so the 
related scripts are updated as well.
   
   For C++ source code, the modifications are:
   - Add the `PROTOBUF_NATIVE` schema and make methods of `Commands` recognize 
it so that the schema can be serialized to the actual `CommandXXX` struct.
   - Add a dependent header, which contains the `createProtobufNativeSchema` 
function to create a protobuf native `SchemaInfo` based on a protobuf 
descriptor. It's not included in `pulsar/Client.h` because it depends on 
protobuf header. If users don't want to use protobuf native schema, they need 
no extra protobuf dependency.
   - Change the dependency from protobuf-lite to protobuf because the 
implementation relies on the protobuf descriptor, which is not supported in 
protobuf-lite.
   - Add tests for protobuf native schema, which uses the same proto files with 
Java client's unit tests.
   
   Since the depended protobuf version has been upgraded, the related documents 
are updated as well.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests `ProtobufNativeSchemaTests`.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (**yes**)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to