use of com.palantir.atlasdb.factory.timelock.ImmutableShortAndLongTimeoutServices 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));
}
use of com.palantir.atlasdb.factory.timelock.ImmutableShortAndLongTimeoutServices in project atlasdb by palantir.
the class AtlasDbDialogueServiceProvider method getConjureTimelockService.
public ConjureTimelockService getConjureTimelockService() {
ConjureTimelockServiceBlocking longTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_LONG_TIMEOUT);
ConjureTimelockServiceBlocking shortTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_SHORT_TIMEOUT);
ConjureTimelockServiceBlockingMetrics conjureTimelockServiceBlockingMetrics = ConjureTimelockServiceBlockingMetrics.of(taggedMetricRegistry);
ShortAndLongTimeoutServices<ConjureTimelockService> shortAndLongTimeoutServices = ImmutableShortAndLongTimeoutServices.<ConjureTimelockServiceBlocking>builder().longTimeout(longTimeoutService).shortTimeout(shortTimeoutService).build().map(proxy -> wrapInProxy(ConjureTimelockServiceBlocking.class, proxy)).map(service -> AtlasDbMetrics.instrumentWithTaggedMetrics(taggedMetricRegistry, ConjureTimelockServiceBlocking.class, service)).map(instrumentedService -> new DialogueAdaptingConjureTimelockService(instrumentedService, conjureTimelockServiceBlockingMetrics));
return new TimeoutSensitiveConjureTimelockService(shortAndLongTimeoutServices);
}
Aggregations