use of com.palantir.lock.client.RequestBatchersFactory in project atlasdb by palantir.
the class TimeLockHelperServices method create.
static TimeLockHelperServices create(String namespace, MetricsManager metricsManager, Set<Schema> schemas, LockWatchStarter lockWatchStarter, LockWatchCachingConfig lockWatchCachingConfig, Supplier<Optional<RequestBatchersFactory.MultiClientRequestBatchers>> requestBatcherProvider) {
LockWatchManagerInternal lockWatchManager = LockWatchManagerImpl.create(metricsManager, schemas, lockWatchStarter, lockWatchCachingConfig);
LockWatchCache lockWatchCache = lockWatchManager.getCache();
RequestBatchersFactory requestBatchersFactory = RequestBatchersFactory.create(lockWatchCache, Namespace.of(namespace), requestBatcherProvider.get());
return ImmutableTimeLockHelperServices.builder().lockWatchManager(lockWatchManager).requestBatchersFactory(requestBatchersFactory).build();
}
use of com.palantir.lock.client.RequestBatchersFactory in project atlasdb by palantir.
the class InMemoryTimelockServices method getLegacyTimelockService.
public TimelockService getLegacyTimelockService() {
RequestBatchersFactory requestBatchersFactory = helperServices.requestBatchersFactory();
TransactionStarter transactionStarter = TransactionStarter.create(lockLeaseService, requestBatchersFactory);
CommitTimestampGetter commitTimestampGetter = requestBatchersFactory.createBatchingCommitTimestampGetter(lockLeaseService);
NamespacedTimelockRpcClient namespacedTimelockRpcClient = new InMemoryNamespacedTimelockRpcClient(getTimelockService());
return new RemoteTimelockServiceAdapter(namespacedTimelockRpcClient, namespacedConjureTimelockService, lockLeaseService, transactionStarter, commitTimestampGetter);
}
Aggregations