@Override public List<Object> getResources() { Collection<Map<String, Object>> schemaProviders = (Collection<Map<String, Object>>) config.get(SCHEMA_PROVIDERS); DefaultSchemaRegistry schemaRegistry = new DefaultSchemaRegistry(storageManager, fileStorage, schemaProviders, haServerNotificationManager); schemaRegistry.init(config); SchemaRegistryVersion schemaRegistryVersion = SchemaRegistryServiceInfo.get().version(); LOG.info("SchemaRegistry is starting with {}", schemaRegistryVersion); SchemaRegistryResource schemaRegistryResource = new SchemaRegistryResource(schemaRegistry, leadershipParticipant, schemaRegistryVersion); ConfluentSchemaRegistryCompatibleResource confluentSchemaRegistryResource = new ConfluentSchemaRegistryCompatibleResource(schemaRegistry, leadershipParticipant); return Arrays.asList(schemaRegistryResource, confluentSchemaRegistryResource); }
@Override public List<Object> getResources() { Collection<Map<String, Object>> schemaProviders = (Collection<Map<String, Object>>) config.get(SCHEMA_PROVIDERS); DefaultSchemaRegistry schemaRegistry = new DefaultSchemaRegistry(storageManager, fileStorage, schemaProviders, haServerNotificationManager, new SchemaLockManager(transactionManager)); schemaRegistry.init(config); SchemaRegistryVersion schemaRegistryVersion = SchemaRegistryServiceInfo.get().version(); LOG.info("SchemaRegistry is starting with {}", schemaRegistryVersion); SchemaRegistryResource schemaRegistryResource = new SchemaRegistryResource(schemaRegistry, leadershipParticipant, schemaRegistryVersion); ConfluentSchemaRegistryCompatibleResource confluentSchemaRegistryResource = new ConfluentSchemaRegistryCompatibleResource(schemaRegistry, leadershipParticipant); return Arrays.asList(schemaRegistryResource, confluentSchemaRegistryResource); }
public MockSchemaRegistryClient() { StorageManager storageManager = new InMemoryStorageManager(); Collection<Map<String, Object>> schemaProvidersConfig = Collections.singleton(Collections.singletonMap("providerClass", AvroSchemaProvider.class.getName())); this.schemaRegistry = new DefaultSchemaRegistry(storageManager, null, schemaProvidersConfig, new HAServerNotificationManager(), new SchemaLockManager(new NOOPTransactionManager())); this.schemaRegistry.init(Collections.<String, Object>emptyMap()); }
@Before public void setup() throws IOException { schema1 = getSchema("/device.avsc"); schema2 = getSchema("/device-compat.avsc"); schemaName = "org.hwx.schemas.test-schema." + UUID.randomUUID(); StorageManager storageManager = new InMemoryStorageManager(); Collection<Map<String, Object>> schemaProvidersConfig = Collections.singleton(Collections.singletonMap("providerClass", AvroSchemaProvider.class.getName())); schemaRegistry = new DefaultSchemaRegistry(storageManager, null, schemaProvidersConfig, new HAServerNotificationManager(), new SchemaLockManager(new NOOPTransactionManager())); schemaRegistry.init(Collections.<String, Object>emptyMap()); }