use of com.palantir.atlasdb.timestamp.SimpleEteTimestampResource in project atlasdb by palantir.
the class AtlasDbEteServer method run.
@Override
public void run(AtlasDbEteConfiguration config, final Environment environment) throws Exception {
TaggedMetricRegistry taggedMetrics = SharedTaggedMetricRegistries.getSingleton();
TransactionManager txManager = tryToCreateTransactionManager(config, environment, taggedMetrics);
Supplier<SweepTaskRunner> sweepTaskRunner = Suppliers.memoize(() -> getSweepTaskRunner(txManager));
TargetedSweeper sweeper = TargetedSweeper.createUninitializedForTest(() -> 1);
Supplier<TargetedSweeper> sweeperSupplier = Suppliers.memoize(() -> initializeAndGet(sweeper, txManager));
ensureTransactionSchemaVersionInstalled(config.getAtlasDbConfig(), config.getAtlasDbRuntimeConfig(), txManager);
if (shouldSetUpBackupAndRestoreResource(config)) {
createAndRegisterBackupAndRestoreResource(config, environment, txManager, taggedMetrics);
}
environment.jersey().register(new SimpleTodoResource(new TodoClient(txManager, sweepTaskRunner, sweeperSupplier)));
environment.jersey().register(SimpleCoordinationResource.create(txManager));
environment.jersey().register(ConjureJerseyFeature.INSTANCE);
environment.jersey().register(new NotInitializedExceptionMapper());
environment.jersey().register(new SimpleEteTimestampResource(txManager));
environment.jersey().register(new SimpleLockResource(txManager));
environment.jersey().register(new EmptyOptionalTo204ExceptionMapper());
}
Aggregations