commonlib/src/main/java/com/streamsets/pipeline/lib/util/AvroSchemaHelper.java
public Schema loadFromRegistry(String subject, int schemaId) throws SchemaRegistryException {
    try {
      if (isEmpty(subject)) {
        return loadFromRegistry(schemaId);
      } else {
        return loadFromRegistry(subject);
      }
    } catch (SchemaRegistryException e) {
      throw new SchemaRegistryException(e);
    }
  }
public Schema loadFromRegistry(String subject, int schemaId) throws SchemaRegistryException {
    try {
      if (isEmpty(subject)) {
        return loadFromRegistry(schemaId);
      } else {
        return loadFromRegistry(subject);
      }
    } catch (SchemaRegistryException e) {
      throw new SchemaRegistryException(e);
    }
  }
Parses and returns an Avro schema loaded from the schema registry using the provided schema ID
if available, or the latest version of a schema for the specified subject.
@param subject optional schema subject (if schema ID is provided)
@param schemaId optional schema ID (if subject is provided)
@return parsed avro schema
@throws SchemaRegistryException if there is an error with the registry client