Package io.tarantool.driver.api
Interface TarantoolClientConfigurator<SELF extends TarantoolClientConfigurator<SELF>>
-
- All Known Subinterfaces:
TarantoolClientBuilder
- All Known Implementing Classes:
TarantoolClientBuilderImpl
,TarantoolClientConfiguratorImpl
public interface TarantoolClientConfigurator<SELF extends TarantoolClientConfigurator<SELF>>
Tarantool client configurator interface.Provides a single entry point for configuring all types of Tarantool clients.
-
-
Method Summary
-
-
-
Method Detail
-
withProxyMethodMapping
SELF withProxyMethodMapping()
Specify using the default CRUD proxy operations mapping configuration. For using the default operations mapping, make sure the tarantool/crud module is installed as a dependency and enabled in your application.- Returns:
- this instance of builder
TarantoolClientConfigurator
-
withProxyMethodMapping
SELF withProxyMethodMapping(UnaryOperator<ProxyOperationsMappingConfig.Builder> builder)
Configure a custom operations proxy configuration. This configuration allows specifying custom Lua function names callable on the Tarantool server, for replacing the default space operations with these functions calls. This allows, for example, replacing the default schema retrieving method or writing a custom "insert" implementation.- Parameters:
builder
- builder provider instance, e.g. a lambda function taking the builder- Returns:
- this instance of builder
TarantoolClientConfigurator
-
withRetryingByNumberOfAttempts
SELF withRetryingByNumberOfAttempts(int numberOfAttempts)
Specify the number of retry attempts for each request.- Parameters:
numberOfAttempts
- the number of retry attempts for each request- Returns:
- this instance of builder
TarantoolClientConfigurator
-
withRetryingByNumberOfAttempts
SELF withRetryingByNumberOfAttempts(int numberOfAttempts, UnaryOperator<TarantoolRequestRetryPolicies.AttemptsBoundRetryPolicyFactory.Builder<Predicate<Throwable>>> policy)
Configure the attempts bound request retry policy. Only the requests that failed with known network exceptions will be retried by default.- Parameters:
numberOfAttempts
- the number of retry attempts for each requestpolicy
- builder provider forTarantoolRequestRetryPolicies.AttemptsBoundRetryPolicy
, e.g. a lambda function taking the builder- Returns:
- this instance of builder
TarantoolClientConfigurator
-
withRetryingByNumberOfAttempts
<T extends Predicate<Throwable>> SELF withRetryingByNumberOfAttempts(int numberOfAttempts, T exceptionsCheck, UnaryOperator<TarantoolRequestRetryPolicies.AttemptsBoundRetryPolicyFactory.Builder<T>> policy)
Configure the attempts bound request retry policy.- Type Parameters:
T
- callback type for exceptions check- Parameters:
numberOfAttempts
- the number of retry attempts for each requestexceptionsCheck
- function checking whether the given exception may be retriedpolicy
- builder provider forTarantoolRequestRetryPolicies.AttemptsBoundRetryPolicy
, e.g. a lambda function taking the builder- Returns:
- this instance of builder
TarantoolClientConfigurator
-
withRetryingIndefinitely
SELF withRetryingIndefinitely(UnaryOperator<TarantoolRequestRetryPolicies.InfiniteRetryPolicyFactory.Builder<Predicate<Throwable>>> policy)
Configure the infinite request retry policy. Only the requests that failed with known network exceptions will be retried by default.- Parameters:
policy
- builder provider forTarantoolRequestRetryPolicies.InfiniteRetryPolicy
, e.g. a lambda function taking the builder- Returns:
- this instance of builder
TarantoolClientConfigurator
-
withRetryingIndefinitely
<T extends Predicate<Throwable>> SELF withRetryingIndefinitely(T callback, UnaryOperator<TarantoolRequestRetryPolicies.InfiniteRetryPolicyFactory.Builder<T>> policy)
Configure the infinite request retry policy.- Type Parameters:
T
- callback type for exceptions check- Parameters:
policy
- builder provider forTarantoolRequestRetryPolicies.InfiniteRetryPolicy
, e.g. a lambda function taking the buildercallback
- function checking whether the given exception may be retried- Returns:
- this instance of builder
TarantoolClientConfigurator
-
withRetrying
SELF withRetrying(RequestRetryPolicyFactory factory)
Specify a custom request retry policy factory. A request retry policy encapsulates an algorithm of checking if a particular failed request needs to be repeated. The built-in request retry policies include customizable policy variants with a bounded or unbounded number of retries.- Parameters:
factory
-RequestRetryPolicyFactory
- Returns:
- this instance of builder
TarantoolClientConfigurator
- See Also:
TarantoolRequestRetryPolicies
-
build
TarantoolClient<TarantoolTuple,TarantoolResult<TarantoolTuple>> build()
Build the configured Tarantool client instance. Call this when you have specified all necessary settings.- Returns:
- instance of tarantool tuple client
TarantoolClient
-
-