Package io.oxia.client.api
Interface SharedResources.Builder
- Enclosing interface:
- SharedResources
public static interface SharedResources.Builder
Builder for a
SharedResources pool.-
Method Summary
Modifier and TypeMethodDescriptionauthentication(Authentication authentication) Configure the authentication used by the shared connections.batchingThreads(int batchingThreads) Set the number of shared batch-assembly threads (reads and writes each get this many).build()Build theSharedResourcespool.connectionBackoff(Duration minDelay, Duration maxDelay) Configure the connection backoff policy for the shared connections.connectionKeepAliveTime(Duration keepAliveTime) Configure the keep-alive interval for the shared connections.connectionKeepAliveTimeout(Duration keepAliveTimeout) Configure the keep-alive timeout for the shared connections.enableTls(boolean enableTls) Configure whether to enable TLS for the shared connections.maxConnectionPerNode(int connections) Configure the maximum number of shared connections to each Oxia server node.numWorkerThreads(int numWorkerThreads) Set the number of threads in the shared background thread pool.openTelemetry(OpenTelemetry openTelemetry) Configure the OpenTelemetry instance used for shared-resource metrics.
-
Method Details
-
numWorkerThreads
Set the number of threads in the shared background thread pool.Default is the number of available processors.
- Parameters:
numWorkerThreads- the number of worker threads- Returns:
- the builder instance
-
batchingThreads
Set the number of shared batch-assembly threads (reads and writes each get this many).These threads are shared by every client built on this pool, so the total number of batching threads stays fixed no matter how many clients are created. Default is
1.- Parameters:
batchingThreads- the number of shared batching threads- Returns:
- the builder instance
-
enableTls
Configure whether to enable TLS for the shared connections.Default is
false.- Parameters:
enableTls- true to enable TLS- Returns:
- the builder instance
-
authentication
Configure the authentication used by the shared connections.- Parameters:
authentication- the authentication instance- Returns:
- the builder instance
-
connectionKeepAliveTime
Configure the keep-alive interval for the shared connections.Default is
10 sec.- Parameters:
keepAliveTime- the keep-alive interval- Returns:
- the builder instance
-
connectionKeepAliveTimeout
Configure the keep-alive timeout for the shared connections.Default is
3 sec.- Parameters:
keepAliveTimeout- the keep-alive timeout- Returns:
- the builder instance
-
connectionBackoff
Configure the connection backoff policy for the shared connections.Defaults are
min=100millis, max=30sec.- Parameters:
minDelay- the minimum delay between retriesmaxDelay- the maximum delay between retries- Returns:
- the builder instance
-
maxConnectionPerNode
Configure the maximum number of shared connections to each Oxia server node.Default is
1.- Parameters:
connections- the maximum number of connections- Returns:
- the builder instance
-
openTelemetry
Configure the OpenTelemetry instance used for shared-resource metrics.By default, the global OpenTelemetry instance is used if available.
- Parameters:
openTelemetry- an OpenTelemetry instance- Returns:
- the builder instance
-
build
SharedResources build()Build theSharedResourcespool.- Returns:
- the shared resources instance
-