-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[schema] key/value schema enhancement #4548
Conversation
*Motivation* - The code for encoding and decoding key/value schema is spreading over multiple places. - Make code changes to prepare supporting key/value schema in AUTO consumers - Make schema tools display key/value schema in a pretty format *Modifications* - Move the common logic of encoding and decoding key/value schema to a common class KeyValueSchemaInfo - Expose the common class in DefaultImplementation so that it can be available for public usage - Fix the display problem on displaying key/value schema *Verify this change* - Add bunch of the unit tests for key/value schemas
retest this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm. just left a question
@@ -36,7 +37,7 @@ | |||
/** | |||
* Message schema definition | |||
*/ | |||
public interface Schema<T> { | |||
public interface Schema<T> extends SchemaWriter<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why consider to inherit SchemaWriter?
* @param valueWriter a writer to encode value object | ||
* @return the encoded bytes array | ||
*/ | ||
public static <K, V> byte[] encode(K key, SchemaWriter<K> keyWriter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codelipenghui since I only need a serialize method for serializing K or V into bytes. so I use SchemaWriter
as the interface in the util functions. To use existing Schema interface, I extend Schema interface to SchemaWriter
. Maybe I can just rewrite it using a different approach to get rid of extending Schema from SchemaWriter. Let me give it a shot.
@codelipenghui I have addressed your comment. PTAL |
run java8 tests |
@sijie 👍, LGTM. |
run java8 tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, lgtm.
run java8 tests |
1 similar comment
run java8 tests |
Motivation Pulsar 2.4.0 Added schema versioning to support multi version messages produce and consume apache#3876 apache#3670 apache#4211 apache#4325 apache#4548. but the doc is not updated accordingly. Modifications Update the schema version in the pulsar registry doc for releases 2.4.0/2.4.1/2.4.2.
Motivation
Modifications
Verify this change