use of com.palantir.lock.client.DialogueComposingLockRpcClient in project atlasdb by palantir.
the class AtlasDbDialogueServiceProvider method getLockRpcClient.
public LockRpcClient getLockRpcClient() {
ConjureLockV1ServiceBlocking shortTimeoutDialogueService = dialogueClientFactory.get(ConjureLockV1ServiceBlocking.class, TIMELOCK_SHORT_TIMEOUT);
ConjureLockV1ServiceBlocking longTimeoutDialogueService = dialogueClientFactory.get(ConjureLockV1ServiceBlocking.class, TIMELOCK_LONG_TIMEOUT);
ShortAndLongTimeoutServices<LockRpcClient> legacyRpcClients = ImmutableShortAndLongTimeoutServices.<LockRpcClient>builder().shortTimeout(createDialogueProxyWithShortTimeout(LockRpcClient.class)).longTimeout(createDialogueProxyWithLongTimeout(LockRpcClient.class)).build();
return new TimeoutSensitiveLockRpcClient(ImmutableShortAndLongTimeoutServices.<ConjureLockV1ServiceBlocking>builder().shortTimeout(shortTimeoutDialogueService).longTimeout(longTimeoutDialogueService).build().map(proxy -> wrapInProxy(ConjureLockV1ServiceBlocking.class, proxy)).map(service -> AtlasDbMetrics.instrumentWithTaggedMetrics(taggedMetricRegistry, ConjureLockV1ServiceBlocking.class, service)).zipWith(legacyRpcClients, DialogueComposingLockRpcClient::new));
}
Aggregations