use of com.palantir.atlasdb.timelock.AsyncTimelockServiceImpl in project atlasdb by palantir.
the class AsyncTimeLockServicesCreator method createRawAsyncTimelockService.
private static AsyncTimelockService createRawAsyncTimelockService(String client, Supplier<ManagedTimestampService> timestampServiceSupplier) {
ScheduledExecutorService reaperExecutor = new InstrumentedScheduledExecutorService(PTExecutors.newSingleThreadScheduledExecutor(new ThreadFactoryBuilder().setNameFormat("async-lock-reaper-" + client + "-%d").setDaemon(true).build()), AtlasDbMetrics.getMetricRegistry(), "async-lock-reaper");
ScheduledExecutorService timeoutExecutor = new InstrumentedScheduledExecutorService(PTExecutors.newSingleThreadScheduledExecutor(new ThreadFactoryBuilder().setNameFormat("async-lock-timeouts-" + client + "-%d").setDaemon(true).build()), AtlasDbMetrics.getMetricRegistry(), "async-lock-timeouts");
return new AsyncTimelockServiceImpl(AsyncLockService.createDefault(reaperExecutor, timeoutExecutor), timestampServiceSupplier.get());
}
Aggregations