use of com.hortonworks.registries.schemaregistry.SchemaVersionRetriever in project registry by hortonworks.
the class AbstractAvroSnapshotDeserializer method doInit.
@Override
public void doInit(Map<String, ?> config) {
super.doInit(config);
SchemaVersionRetriever schemaVersionRetriever = createSchemaVersionRetriever();
avroSchemaResolver = new AvroSchemaResolver(schemaVersionRetriever);
useSpecificAvroReader = (boolean) getValue(config, SPECIFIC_AVRO_READER, false);
}
use of com.hortonworks.registries.schemaregistry.SchemaVersionRetriever in project registry by hortonworks.
the class AvroCompositeSchemasTest method testComposites.
@Before
public void testComposites() throws Exception {
versions = new HashMap<>();
versions.put("utils", cretaeSchemaVersionInfo("/avro/composites/util.avsc"));
versions.put("account", cretaeSchemaVersionInfo("/avro/composites/account.avsc"));
versions.put("account-cyclic", cretaeSchemaVersionInfo("/avro/composites/account-cyclic.avsc"));
versions.put("account-dep", cretaeSchemaVersionInfo("/avro/composites/account-dep.avsc"));
avroSchemaProvider = new AvroSchemaProvider();
SchemaVersionRetriever schemaVersionRetriever = new SchemaVersionRetriever() {
@Override
public SchemaVersionInfo retrieveSchemaVersion(SchemaVersionKey key) throws SchemaNotFoundException {
return versions.get(key.getSchemaName());
}
@Override
public SchemaVersionInfo retrieveSchemaVersion(SchemaIdVersion key) throws SchemaNotFoundException {
return null;
}
};
Map<String, Object> config = Collections.singletonMap(SchemaProvider.SCHEMA_VERSION_RETRIEVER_CONFIG, schemaVersionRetriever);
avroSchemaProvider.init(config);
}
Aggregations