sijie commented on a change in pull request #4211:
[issue#4155][pulsar-clients]Support key value schema versioning
URL: https://github.com/apache/pulsar/pull/4211#discussion_r281060462
##########
File path:
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Schema.java
##########
@@ -111,6 +111,21 @@ default T decode(byte[] bytes, byte[] schemaVersion) {
return decode(bytes);
}
+ /**
+ * At present, this method is provided for KeyValueSchema.
+ * Decode a byte array into an object using keyBytes, keyBytes and a given
version.
+ *
+ * @param keyBytes the byte array to decode
+ * @param valueBytes the byte array to decode
+ * @param schemaVersion
+ * the schema version to decode the object. null indicates
using latest version.
+ * @return the deserialized object
+ */
+ default T decode(byte[] keyBytes, byte[] valueBytes, byte[] schemaVersion)
{
Review comment:
It doesn't seem to be a good idea to add this method to `Schema` interface.
It should be just in `KeyValueSchema`, because you can cast a Schema to
`KeyValueSchema` anyway.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services