use of com.hortonworks.registries.schemaregistry.cache.SchemaBranchCache in project registry by hortonworks.
the class DefaultSchemaRegistry method init.
@Override
public void init(Map<String, Object> props) {
storageManager.registerStorables(Arrays.asList(SchemaMetadataStorable.class, SchemaVersionStorable.class, SchemaVersionStateStorable.class, SchemaFieldInfoStorable.class, SerDesInfoStorable.class, SchemaSerDesMapping.class, SchemaBranchStorable.class, SchemaBranchVersionMapping.class, HostConfigStorable.class));
Options options = new Options(props);
schemaBranchCache = new SchemaBranchCache(options.getMaxSchemaCacheSize(), options.getSchemaExpiryInSecs(), createSchemaBranchFetcher());
SchemaMetadataFetcher schemaMetadataFetcher = createSchemaMetadataFetcher();
schemaVersionLifecycleManager = new SchemaVersionLifecycleManager(storageManager, props, schemaMetadataFetcher, schemaBranchCache, haServerNotificationManager);
Collection<? extends SchemaProvider> schemaProviders = initSchemaProviders(schemaProvidersConfig, schemaVersionLifecycleManager.getSchemaVersionRetriever());
this.schemaTypeWithProviders = schemaProviders.stream().collect(Collectors.toMap(SchemaProvider::getType, Function.identity()));
schemaProviderInfos = Collections.unmodifiableList(schemaProviders.stream().map(schemaProvider -> new SchemaProviderInfo(schemaProvider.getType(), schemaProvider.getName(), schemaProvider.getDescription(), schemaProvider.getDefaultSerializerClassName(), schemaProvider.getDefaultDeserializerClassName())).collect(Collectors.toList()));
}
Aggregations