Search in sources :

Example 11 with StorageManager

use of com.hortonworks.registries.storage.StorageManager in project registry by hortonworks.

the class TransactionTest method setUp.

@Before
public void setUp() throws Exception {
    connectionBuilder = new HikariCPConnectionBuilder(HikariBasicConfig.getH2HikariConfig());
    MySqlExecutor queryExecutor = new MySqlExecutor(new ExecutionConfig(-1), connectionBuilder);
    StorageManager jdbcStorageManager = new JdbcStorageManager(queryExecutor);
    transactionManager = (TransactionManager) jdbcStorageManager;
    jdbcStorageManager.registerStorables(StorageUtils.getStorableEntities());
    dbFileStorage = new DbFileStorage();
    dbFileStorage.setStorageManager(jdbcStorageManager);
    runScript("create_fileblob.sql");
}
Also used : HikariCPConnectionBuilder(com.hortonworks.registries.storage.impl.jdbc.connection.HikariCPConnectionBuilder) MySqlExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor) JdbcStorageManager(com.hortonworks.registries.storage.impl.jdbc.JdbcStorageManager) StorageManager(com.hortonworks.registries.storage.StorageManager) ExecutionConfig(com.hortonworks.registries.storage.impl.jdbc.config.ExecutionConfig) JdbcStorageManager(com.hortonworks.registries.storage.impl.jdbc.JdbcStorageManager) Before(org.junit.Before)

Example 12 with StorageManager

use of com.hortonworks.registries.storage.StorageManager in project registry by hortonworks.

the class TestApplication method getStorageManager.

private StorageManager getStorageManager(StorageProviderConfiguration storageProviderConfiguration) {
    final String providerClass = storageProviderConfiguration.getProviderClass();
    StorageManager storageManager = null;
    try {
        storageManager = (StorageManager) Class.forName(providerClass).newInstance();
    } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
    storageManager.init(storageProviderConfiguration.getProperties());
    return storageManager;
}
Also used : CacheBackedStorageManager(com.hortonworks.registries.storage.CacheBackedStorageManager) StorageManager(com.hortonworks.registries.storage.StorageManager)

Example 13 with StorageManager

use of com.hortonworks.registries.storage.StorageManager in project registry by hortonworks.

the class TestApplication method run.

@Override
public void run(TestConfiguration testConfiguration, Environment environment) throws Exception {
    StorageManager storageManager = getCacheBackedDao(testConfiguration);
    final TagService tagService = new CatalogTagService(storageManager);
    final TagCatalogResource tagCatalogResource = new TagCatalogResource(tagService);
    environment.jersey().register(tagCatalogResource);
    environment.jersey().register(MultiPartFeature.class);
}
Also used : CacheBackedStorageManager(com.hortonworks.registries.storage.CacheBackedStorageManager) StorageManager(com.hortonworks.registries.storage.StorageManager)

Example 14 with StorageManager

use of com.hortonworks.registries.storage.StorageManager 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

StorageManager (com.hortonworks.registries.storage.StorageManager)14 CacheBackedStorageManager (com.hortonworks.registries.storage.CacheBackedStorageManager)6 Storable (com.hortonworks.registries.storage.Storable)4 StorableKey (com.hortonworks.registries.storage.StorableKey)3 CacheBuilder (com.google.common.cache.CacheBuilder)2 FileStorage (com.hortonworks.registries.common.util.FileStorage)2 HAServerNotificationManager (com.hortonworks.registries.schemaregistry.HAServerNotificationManager)2 TransactionManager (com.hortonworks.registries.storage.TransactionManager)2 StorageWriter (com.hortonworks.registries.storage.cache.writer.StorageWriter)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Before (org.junit.Before)2 Logger (org.slf4j.Logger)2 LoggerFactory (org.slf4j.LoggerFactory)2 Preconditions (com.google.common.base.Preconditions)1 QueryParam (com.hortonworks.registries.common.QueryParam)1