use of org.projectnessie.server.store.TableCommitMetaStoreWorker in project nessie by projectnessie.
the class PersistVersionStoreExtension method afterBeanDiscovery.
@SuppressWarnings("unused")
public void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager bm) {
TableCommitMetaStoreWorker storeWorker = new TableCommitMetaStoreWorker();
abd.addBean().addType(new TypeLiteral<VersionStore<Content, CommitMeta, Type>>() {
}).addQualifier(Default.Literal.INSTANCE).scope(ApplicationScoped.class).produceWith(i -> new PersistVersionStore<>(databaseAdapter.get(), storeWorker));
}
use of org.projectnessie.server.store.TableCommitMetaStoreWorker 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.server.store.TableCommitMetaStoreWorker in project nessie by projectnessie.
the class PersistVersionStoreExtension method afterBeanDiscovery.
@SuppressWarnings("unused")
public void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager bm) {
TableCommitMetaStoreWorker storeWorker = new TableCommitMetaStoreWorker();
abd.addBean().addType(new TypeLiteral<VersionStore<Content, CommitMeta, Type>>() {
}).addQualifier(Default.Literal.INSTANCE).scope(ApplicationScoped.class).produceWith(i -> new PersistVersionStore<>(databaseAdapter.get(), storeWorker));
}
use of org.projectnessie.server.store.TableCommitMetaStoreWorker 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