You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/05/17 14:35:54 UTC
[GitHub] [pulsar] eaba commented on a change in pull request #10604: [Schema] Support consume multiple schema types messages by AutoConsumeSchema
eaba commented on a change in pull request #10604:
URL: https://github.com/apache/pulsar/pull/10604#discussion_r633587766
##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/protocol/schema/SchemaHash.java
##########
@@ -36,22 +37,25 @@
private final HashCode hash;
- private SchemaHash(HashCode hash) {
+ private final SchemaType schemaType;
+
+ private SchemaHash(HashCode hash, SchemaType schemaType) {
this.hash = hash;
+ this.schemaType = schemaType;
}
public static SchemaHash of(Schema schema) {
return of(Optional.ofNullable(schema)
.map(Schema::getSchemaInfo)
- .map(SchemaInfo::getSchema).orElse(new byte[0]));
+ .map(SchemaInfo::getSchema).orElse(new byte[0]), schema.getSchemaInfo().getType());
}
public static SchemaHash of(SchemaData schemaData) {
- return of(schemaData.getData());
+ return of(schemaData.getData(), schemaData.getType());
}
- private static SchemaHash of(byte[] schemaBytes) {
Review comment:
u
--
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:
users@infra.apache.org