Search in sources :

Example 1 with ShortAndLongTimeoutServices

use of com.palantir.atlasdb.factory.timelock.ShortAndLongTimeoutServices 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));
}
Also used : ImmutableRemoteServiceConfiguration(com.palantir.atlasdb.http.v2.ImmutableRemoteServiceConfiguration) RemoteServiceConfiguration(com.palantir.atlasdb.http.v2.RemoteServiceConfiguration) AtlasDbMetrics(com.palantir.atlasdb.util.AtlasDbMetrics) AtlasDbHttpProtocolVersion(com.palantir.atlasdb.http.AtlasDbHttpProtocolVersion) ShortAndLongTimeoutServices(com.palantir.atlasdb.factory.timelock.ShortAndLongTimeoutServices) ConjureTimelockService(com.palantir.atlasdb.timelock.api.ConjureTimelockService) TimestampManagementRpcClient(com.palantir.timestamp.TimestampManagementRpcClient) TimeoutSensitiveLockRpcClient(com.palantir.atlasdb.factory.timelock.TimeoutSensitiveLockRpcClient) ClientConfiguration(com.palantir.conjure.java.client.config.ClientConfiguration) DialogueAdaptingTimeLockManagementService(com.palantir.atlasdb.backup.DialogueAdaptingTimeLockManagementService) ConjureTimelockServiceBlocking(com.palantir.atlasdb.timelock.api.ConjureTimelockServiceBlocking) TimeoutSensitiveConjureTimelockService(com.palantir.atlasdb.factory.timelock.TimeoutSensitiveConjureTimelockService) TimeLockManagementService(com.palantir.atlasdb.timelock.api.management.TimeLockManagementService) SafeArg(com.palantir.logsafe.SafeArg) NodeSelectionStrategy(com.palantir.conjure.java.client.config.NodeSelectionStrategy) ConjureLockWatchingServiceBlocking(com.palantir.atlasdb.timelock.lock.watch.ConjureLockWatchingServiceBlocking) UserAgent(com.palantir.conjure.java.api.config.service.UserAgent) Map(java.util.Map) AuxiliaryRemotingParameters(com.palantir.atlasdb.config.AuxiliaryRemotingParameters) TimelockRpcClient(com.palantir.lock.v2.TimelockRpcClient) DialogueAdaptingConjureTimelockService(com.palantir.lock.client.DialogueAdaptingConjureTimelockService) Refreshable(com.palantir.refreshable.Refreshable) MultiClientConjureTimelockServiceBlocking(com.palantir.atlasdb.timelock.api.MultiClientConjureTimelockServiceBlocking) ImmutableMap(com.google.common.collect.ImmutableMap) RetryOnSocketTimeoutExceptionProxy(com.palantir.atlasdb.http.v2.RetryOnSocketTimeoutExceptionProxy) ReloadingFactory(com.palantir.dialogue.clients.DialogueClients.ReloadingFactory) AtlasDbHttpClients(com.palantir.atlasdb.http.AtlasDbHttpClients) DialogueComposingLockRpcClient(com.palantir.lock.client.DialogueComposingLockRpcClient) Set(java.util.Set) FastFailoverProxy(com.palantir.atlasdb.http.v2.FastFailoverProxy) UnknownRemoteDebuggingProxy(com.palantir.atlasdb.http.v2.UnknownRemoteDebuggingProxy) Channel(com.palantir.dialogue.Channel) ConjureTimelockServiceBlockingMetrics(com.palantir.lock.client.ConjureTimelockServiceBlockingMetrics) TaggedMetricRegistry(com.palantir.tritium.metrics.registry.TaggedMetricRegistry) ServerListConfig(com.palantir.atlasdb.config.ServerListConfig) ConjureLockV1ServiceBlocking(com.palantir.lock.ConjureLockV1ServiceBlocking) LockRpcClient(com.palantir.lock.LockRpcClient) AtlasDbRemotingConstants(com.palantir.atlasdb.http.AtlasDbRemotingConstants) ImmutableShortAndLongTimeoutServices(com.palantir.atlasdb.factory.timelock.ImmutableShortAndLongTimeoutServices) DialogueClients(com.palantir.dialogue.clients.DialogueClients) TimeLockManagementServiceBlocking(com.palantir.atlasdb.timelock.api.management.TimeLockManagementServiceBlocking) DialogueClientOptions(com.palantir.atlasdb.http.v2.DialogueClientOptions) TimeoutSensitiveLockRpcClient(com.palantir.atlasdb.factory.timelock.TimeoutSensitiveLockRpcClient) TimeoutSensitiveLockRpcClient(com.palantir.atlasdb.factory.timelock.TimeoutSensitiveLockRpcClient) DialogueComposingLockRpcClient(com.palantir.lock.client.DialogueComposingLockRpcClient) LockRpcClient(com.palantir.lock.LockRpcClient) ConjureLockV1ServiceBlocking(com.palantir.lock.ConjureLockV1ServiceBlocking)

Example 2 with ShortAndLongTimeoutServices

use of com.palantir.atlasdb.factory.timelock.ShortAndLongTimeoutServices 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);
}
Also used : ImmutableRemoteServiceConfiguration(com.palantir.atlasdb.http.v2.ImmutableRemoteServiceConfiguration) RemoteServiceConfiguration(com.palantir.atlasdb.http.v2.RemoteServiceConfiguration) AtlasDbMetrics(com.palantir.atlasdb.util.AtlasDbMetrics) AtlasDbHttpProtocolVersion(com.palantir.atlasdb.http.AtlasDbHttpProtocolVersion) ShortAndLongTimeoutServices(com.palantir.atlasdb.factory.timelock.ShortAndLongTimeoutServices) ConjureTimelockService(com.palantir.atlasdb.timelock.api.ConjureTimelockService) TimestampManagementRpcClient(com.palantir.timestamp.TimestampManagementRpcClient) TimeoutSensitiveLockRpcClient(com.palantir.atlasdb.factory.timelock.TimeoutSensitiveLockRpcClient) ClientConfiguration(com.palantir.conjure.java.client.config.ClientConfiguration) DialogueAdaptingTimeLockManagementService(com.palantir.atlasdb.backup.DialogueAdaptingTimeLockManagementService) ConjureTimelockServiceBlocking(com.palantir.atlasdb.timelock.api.ConjureTimelockServiceBlocking) TimeoutSensitiveConjureTimelockService(com.palantir.atlasdb.factory.timelock.TimeoutSensitiveConjureTimelockService) TimeLockManagementService(com.palantir.atlasdb.timelock.api.management.TimeLockManagementService) SafeArg(com.palantir.logsafe.SafeArg) NodeSelectionStrategy(com.palantir.conjure.java.client.config.NodeSelectionStrategy) ConjureLockWatchingServiceBlocking(com.palantir.atlasdb.timelock.lock.watch.ConjureLockWatchingServiceBlocking) UserAgent(com.palantir.conjure.java.api.config.service.UserAgent) Map(java.util.Map) AuxiliaryRemotingParameters(com.palantir.atlasdb.config.AuxiliaryRemotingParameters) TimelockRpcClient(com.palantir.lock.v2.TimelockRpcClient) DialogueAdaptingConjureTimelockService(com.palantir.lock.client.DialogueAdaptingConjureTimelockService) Refreshable(com.palantir.refreshable.Refreshable) MultiClientConjureTimelockServiceBlocking(com.palantir.atlasdb.timelock.api.MultiClientConjureTimelockServiceBlocking) ImmutableMap(com.google.common.collect.ImmutableMap) RetryOnSocketTimeoutExceptionProxy(com.palantir.atlasdb.http.v2.RetryOnSocketTimeoutExceptionProxy) ReloadingFactory(com.palantir.dialogue.clients.DialogueClients.ReloadingFactory) AtlasDbHttpClients(com.palantir.atlasdb.http.AtlasDbHttpClients) DialogueComposingLockRpcClient(com.palantir.lock.client.DialogueComposingLockRpcClient) Set(java.util.Set) FastFailoverProxy(com.palantir.atlasdb.http.v2.FastFailoverProxy) UnknownRemoteDebuggingProxy(com.palantir.atlasdb.http.v2.UnknownRemoteDebuggingProxy) Channel(com.palantir.dialogue.Channel) ConjureTimelockServiceBlockingMetrics(com.palantir.lock.client.ConjureTimelockServiceBlockingMetrics) TaggedMetricRegistry(com.palantir.tritium.metrics.registry.TaggedMetricRegistry) ServerListConfig(com.palantir.atlasdb.config.ServerListConfig) ConjureLockV1ServiceBlocking(com.palantir.lock.ConjureLockV1ServiceBlocking) LockRpcClient(com.palantir.lock.LockRpcClient) AtlasDbRemotingConstants(com.palantir.atlasdb.http.AtlasDbRemotingConstants) ImmutableShortAndLongTimeoutServices(com.palantir.atlasdb.factory.timelock.ImmutableShortAndLongTimeoutServices) DialogueClients(com.palantir.dialogue.clients.DialogueClients) TimeLockManagementServiceBlocking(com.palantir.atlasdb.timelock.api.management.TimeLockManagementServiceBlocking) DialogueClientOptions(com.palantir.atlasdb.http.v2.DialogueClientOptions) TimeoutSensitiveConjureTimelockService(com.palantir.atlasdb.factory.timelock.TimeoutSensitiveConjureTimelockService) DialogueAdaptingConjureTimelockService(com.palantir.lock.client.DialogueAdaptingConjureTimelockService) ConjureTimelockServiceBlockingMetrics(com.palantir.lock.client.ConjureTimelockServiceBlockingMetrics) ConjureTimelockService(com.palantir.atlasdb.timelock.api.ConjureTimelockService) TimeoutSensitiveConjureTimelockService(com.palantir.atlasdb.factory.timelock.TimeoutSensitiveConjureTimelockService) DialogueAdaptingConjureTimelockService(com.palantir.lock.client.DialogueAdaptingConjureTimelockService) ConjureTimelockServiceBlocking(com.palantir.atlasdb.timelock.api.ConjureTimelockServiceBlocking) MultiClientConjureTimelockServiceBlocking(com.palantir.atlasdb.timelock.api.MultiClientConjureTimelockServiceBlocking)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)2 DialogueAdaptingTimeLockManagementService (com.palantir.atlasdb.backup.DialogueAdaptingTimeLockManagementService)2 AuxiliaryRemotingParameters (com.palantir.atlasdb.config.AuxiliaryRemotingParameters)2 ServerListConfig (com.palantir.atlasdb.config.ServerListConfig)2 ImmutableShortAndLongTimeoutServices (com.palantir.atlasdb.factory.timelock.ImmutableShortAndLongTimeoutServices)2 ShortAndLongTimeoutServices (com.palantir.atlasdb.factory.timelock.ShortAndLongTimeoutServices)2 TimeoutSensitiveConjureTimelockService (com.palantir.atlasdb.factory.timelock.TimeoutSensitiveConjureTimelockService)2 TimeoutSensitiveLockRpcClient (com.palantir.atlasdb.factory.timelock.TimeoutSensitiveLockRpcClient)2 AtlasDbHttpClients (com.palantir.atlasdb.http.AtlasDbHttpClients)2 AtlasDbHttpProtocolVersion (com.palantir.atlasdb.http.AtlasDbHttpProtocolVersion)2 AtlasDbRemotingConstants (com.palantir.atlasdb.http.AtlasDbRemotingConstants)2 DialogueClientOptions (com.palantir.atlasdb.http.v2.DialogueClientOptions)2 FastFailoverProxy (com.palantir.atlasdb.http.v2.FastFailoverProxy)2 ImmutableRemoteServiceConfiguration (com.palantir.atlasdb.http.v2.ImmutableRemoteServiceConfiguration)2 RemoteServiceConfiguration (com.palantir.atlasdb.http.v2.RemoteServiceConfiguration)2 RetryOnSocketTimeoutExceptionProxy (com.palantir.atlasdb.http.v2.RetryOnSocketTimeoutExceptionProxy)2 UnknownRemoteDebuggingProxy (com.palantir.atlasdb.http.v2.UnknownRemoteDebuggingProxy)2 ConjureTimelockService (com.palantir.atlasdb.timelock.api.ConjureTimelockService)2 ConjureTimelockServiceBlocking (com.palantir.atlasdb.timelock.api.ConjureTimelockServiceBlocking)2 MultiClientConjureTimelockServiceBlocking (com.palantir.atlasdb.timelock.api.MultiClientConjureTimelockServiceBlocking)2