Skip to content

Conversation

@nlu90
Copy link
Member

@nlu90 nlu90 commented Feb 20, 2020

Fixes #4804

Motivation

Allow specifying null key or null value in KeyValue Schema

Modifications

  • encode null key/value information in KeyValue

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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): no
  • The public API: no
  • The schema: yes
  • The default values of configurations: no
  • The wire protocol: no
  • The rest endpoints: no
  • The admin cli options: no
  • Anything that affects deployment: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@nlu90 nlu90 requested a review from sijie February 20, 2020 19:14
Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nlu90 can you add unit tests? It would be great to cover different serialization format as well.

ByteBuffer byteBuffer = ByteBuffer.allocate(4 + keyBytes.length + 4 + valueBytes.length);
byteBuffer.putInt(keyBytes.length).put(keyBytes).putInt(valueBytes.length).put(valueBytes);

int keyEncodeLength = 1 + (null == keyBytes ? 0 : 4 + keyBytes.length);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that it is breaking the backward compatibility. Because it introduces a new format of how key/value is stored. Can we introduce versioning to the format and use message properties to indicate which version of the forrmat that is used for serializing key/value pairs?

@codelipenghui
Copy link
Contributor

@gaoran10 Could you please help take a look at this PR? Looks related to #6379.

codelipenghui pushed a commit that referenced this pull request Jun 4, 2020
Fixes #4804  

Thanks, @nlu90, work at #6384.

### Motivation

Currently, the KeyValue schema doesn't handle `null` key and `null` value well.
@codelipenghui
Copy link
Contributor

close via #7139

cdbartholomew pushed a commit to kafkaesque-io/pulsar that referenced this pull request Jul 24, 2020
Fixes apache#4804  

Thanks, @nlu90, work at apache#6384.

### Motivation

Currently, the KeyValue schema doesn't handle `null` key and `null` value well.
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
Fixes apache#4804  

Thanks, @nlu90, work at apache#6384.

### Motivation

Currently, the KeyValue schema doesn't handle `null` key and `null` value well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyValue schema doesn't handle null key and null value well

3 participants