use of org.projectnessie.quarkus.config.VersionStoreConfig.VersionStoreType in project nessie by projectnessie.
the class DatabaseAdapterProvider method produceDatabaseAdapter.
@Produces
@Singleton
@Startup
public DatabaseAdapter produceDatabaseAdapter() {
VersionStoreType versionStoreType = storeConfig.getVersionStoreType();
LOGGER.info("Using {} Version store", versionStoreType);
TableCommitMetaStoreWorker storeWorker = new TableCommitMetaStoreWorker();
DatabaseAdapter databaseAdapter = databaseAdapterBuilder.select(new Literal(versionStoreType)).get().newDatabaseAdapter(new GenericContentVariantSupplier<>(storeWorker));
databaseAdapter.initializeRepo(serverConfig.getDefaultBranch());
if (storeConfig.isTracingEnabled()) {
databaseAdapter = new TracingDatabaseAdapter(databaseAdapter);
}
return databaseAdapter;
}
use of org.projectnessie.quarkus.config.VersionStoreConfig.VersionStoreType in project nessie by projectnessie.
the class ConfigurableVersionStoreFactory method getVersionStore.
/**
* Version store producer.
*/
@Produces
@Singleton
@Startup
public VersionStore<Content, CommitMeta, Content.Type> getVersionStore() {
VersionStoreType versionStoreType = storeConfig.getVersionStoreType();
try {
TableCommitMetaStoreWorker storeWorker = new TableCommitMetaStoreWorker();
VersionStore<Content, CommitMeta, Content.Type> versionStore = new PersistVersionStore<>(databaseAdapter, storeWorker);
if (storeConfig.isTracingEnabled()) {
versionStore = new TracingVersionStore<>(versionStore);
}
if (storeConfig.isMetricsEnabled()) {
versionStore = new MetricsVersionStore<>(versionStore);
}
return versionStore;
} catch (RuntimeException | IOError e) {
LOGGER.error("Failed to configure/start {} version store", versionStoreType, e);
throw e;
}
}
Aggregations