Search in sources :

Example 1 with RequestBatchersFactory

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();
}
Also used : LockWatchCache(com.palantir.lock.watch.LockWatchCache) LockWatchManagerInternal(com.palantir.atlasdb.keyvalue.api.watch.LockWatchManagerInternal) RequestBatchersFactory(com.palantir.lock.client.RequestBatchersFactory)

Example 2 with RequestBatchersFactory

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);
}
Also used : RemoteTimelockServiceAdapter(com.palantir.lock.client.RemoteTimelockServiceAdapter) RequestBatchersFactory(com.palantir.lock.client.RequestBatchersFactory) TransactionStarter(com.palantir.lock.client.TransactionStarter) CommitTimestampGetter(com.palantir.lock.client.CommitTimestampGetter) NamespacedTimelockRpcClient(com.palantir.lock.v2.NamespacedTimelockRpcClient)

Aggregations

RequestBatchersFactory (com.palantir.lock.client.RequestBatchersFactory)2 LockWatchManagerInternal (com.palantir.atlasdb.keyvalue.api.watch.LockWatchManagerInternal)1 CommitTimestampGetter (com.palantir.lock.client.CommitTimestampGetter)1 RemoteTimelockServiceAdapter (com.palantir.lock.client.RemoteTimelockServiceAdapter)1 TransactionStarter (com.palantir.lock.client.TransactionStarter)1 NamespacedTimelockRpcClient (com.palantir.lock.v2.NamespacedTimelockRpcClient)1 LockWatchCache (com.palantir.lock.watch.LockWatchCache)1