bbende commented on a change in pull request #4120: NIFI-7221 Support v2/v3
protocols with HWX Schema Registry
URL: https://github.com/apache/nifi/pull/4120#discussion_r395212660
##########
File path:
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/StandardSchemaIdentifier.java
##########
@@ -25,15 +25,18 @@
private final Optional<String> name;
private final OptionalLong identifier;
private final OptionalInt version;
+ private final OptionalLong schemaVersionId;
private final Optional<String> branch;
- StandardSchemaIdentifier(final String name, final Long identifier, final
Integer version, final String branch) {
+ StandardSchemaIdentifier(final String name, final Long identifier, final
Integer version,
+ final Long schemaVersionId, final String branch) {
this.name = Optional.ofNullable(name);
- this.identifier = identifier == null ? OptionalLong.empty() :
OptionalLong.of(identifier);;
- this.version = version == null ? OptionalInt.empty() :
OptionalInt.of(version);;
+ this.identifier = identifier == null ? OptionalLong.empty() :
OptionalLong.of(identifier);
+ this.version = version == null ? OptionalInt.empty() :
OptionalInt.of(version);
+ this.schemaVersionId = schemaVersionId == null ? OptionalLong.empty()
: OptionalLong.of(schemaVersionId);
this.branch = Optional.ofNullable(branch);
- if (this.name == null && this.identifier == null) {
+ if ((this.name == null && this.identifier == null) ||
this.schemaVersionId == null) {
Review comment:
Since we have a constant for an EMPTY schema:
`SchemaIdentifier EMPTY = new StandardSchemaIdentifier(null, null, null,
null, null);`
I think it makes more sense to get rid of this check all together since it
wasn't actually doing anything before.
----------------------------------------------------------------
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