[ https://issues.apache.org/jira/browse/NIFI-4935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16400924#comment-16400924 ]
ASF GitHub Bot commented on NIFI-4935: -------------------------------------- Github user bbende commented on a diff in the pull request: https://github.com/apache/nifi/pull/2523#discussion_r174888759 --- Diff: nifi-nar-bundles/nifi-confluent-platform-bundle/nifi-confluent-schema-registry-service/src/main/java/org/apache/nifi/confluent/schemaregistry/ConfluentSchemaRegistry.java --- @@ -176,28 +178,33 @@ public void onEnabled(final ConfigurationContext context) { return baseUrls; } - @Override - public String retrieveSchemaText(final String schemaName) throws IOException, SchemaNotFoundException { - final RecordSchema schema = retrieveSchema(schemaName); - return schema.getSchemaText().get(); - } + private RecordSchema retrieveSchemaByName(final SchemaIdentifier schemaIdentifier) throws IOException, SchemaNotFoundException { + final Optional<String> schemaName = schemaIdentifier.getName(); + if (!schemaName.isPresent()) { + throw new org.apache.nifi.schema.access.SchemaNotFoundException("Cannot retrieve schema because Schema Name is not present"); + } - @Override - public String retrieveSchemaText(final long schemaId, final int version) throws IOException, SchemaNotFoundException { - final RecordSchema schema = retrieveSchema(schemaId, version); - return schema.getSchemaText().get(); + final RecordSchema schema = client.getSchema(schemaName.get()); + return schema; } - @Override - public RecordSchema retrieveSchema(final String schemaName) throws IOException, SchemaNotFoundException { - final RecordSchema schema = client.getSchema(schemaName); + private RecordSchema retrieveSchemaByIdAndVersion(final SchemaIdentifier schemaIdentifier) throws IOException, SchemaNotFoundException { --- End diff -- Good point, I'll change that > Support Schema Branches when using HWX Schema Registry > ------------------------------------------------------ > > Key: NIFI-4935 > URL: https://issues.apache.org/jira/browse/NIFI-4935 > Project: Apache NiFi > Issue Type: Improvement > Reporter: Bryan Bende > Assignee: Bryan Bende > Priority: Minor > > The latest version of Hortonworks Schema Registry now supports a > forking/branching concept. This means that when retrieving a schema by name, > it may be desirable to also specify a branch name, as the default would > retrieve from the "master" branch. We'll need to pass down an optional branch > name to the SchemaRegistry implementations. -- This message was sent by Atlassian JIRA (v7.6.3#76005)