sijie commented on a change in pull request #2885: Add KeyValueSchema to
satisfy org.apache.kafka.connect.connector.ConnectRecord
URL: https://github.com/apache/pulsar/pull/2885#discussion_r229038641
##########
File path:
pulsar-client-schema/src/main/java/org/apache/pulsar/client/api/Schema.java
##########
@@ -104,6 +105,17 @@ default void validate(byte[] message) {
return JSONSchema.of(clazz);
}
+ /**
+ * Key Value Schema whose underneath schemas are AvroSchema.
+ */
+ static Schema<?> KeyValue(Class key, Class value) {
+ return new KeyValueSchema<>(AvroSchema.of(key), AvroSchema.of(value));
+ }
+
+ static Schema<?> KeyValue(Schema key, Schema value) {
Review comment:
```
static <K, V> Schema<KeyValue<K, V>> KeyValue(Schema<K> key, Schema<V>
value);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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