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");
}
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;
}
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);
}
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());
}
Aggregations