Search in sources :

Example 1 with DefaultSchemaRegistry

use of com.hortonworks.registries.schemaregistry.DefaultSchemaRegistry in project registry by hortonworks.

the class SchemaRegistryModule method getResources.

@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);
    SchemaRegistryResource schemaRegistryResource = new SchemaRegistryResource(schemaRegistry, leadershipParticipant);
    ConfluentSchemaRegistryCompatibleResource confluentSchemaRegistryResource = new ConfluentSchemaRegistryCompatibleResource(schemaRegistry, leadershipParticipant);
    return Arrays.asList(schemaRegistryResource, confluentSchemaRegistryResource);
}
Also used : Collection(java.util.Collection) Map(java.util.Map) DefaultSchemaRegistry(com.hortonworks.registries.schemaregistry.DefaultSchemaRegistry)

Example 2 with DefaultSchemaRegistry

use of com.hortonworks.registries.schemaregistry.DefaultSchemaRegistry in project registry by hortonworks.

the class AvroSchemaRegistryTest method setup.

@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());
    schemaRegistry.init(Collections.<String, Object>emptyMap());
}
Also used : InMemoryStorageManager(com.hortonworks.registries.storage.impl.memory.InMemoryStorageManager) StorageManager(com.hortonworks.registries.storage.StorageManager) InMemoryStorageManager(com.hortonworks.registries.storage.impl.memory.InMemoryStorageManager) Map(java.util.Map) HAServerNotificationManager(com.hortonworks.registries.schemaregistry.HAServerNotificationManager) DefaultSchemaRegistry(com.hortonworks.registries.schemaregistry.DefaultSchemaRegistry) Before(org.junit.Before)

Aggregations

DefaultSchemaRegistry (com.hortonworks.registries.schemaregistry.DefaultSchemaRegistry)2 Map (java.util.Map)2 HAServerNotificationManager (com.hortonworks.registries.schemaregistry.HAServerNotificationManager)1 StorageManager (com.hortonworks.registries.storage.StorageManager)1 InMemoryStorageManager (com.hortonworks.registries.storage.impl.memory.InMemoryStorageManager)1 Collection (java.util.Collection)1 Before (org.junit.Before)1