public class ConnectionPoolConfigurationBuilder extends AbstractConfigurationChildBuilder implements Builder<ConnectionPoolConfiguration>
Modifier and Type | Method and Description |
---|---|
ConnectionPoolConfiguration |
create()
Create the configuration bean
|
ConnectionPoolConfigurationBuilder |
exhaustedAction(ExhaustedAction exhaustedAction)
Specifies what happens when asking for a connection from a server's pool, and that pool is
exhausted.
|
ConnectionPoolConfigurationBuilder |
lifo(boolean enabled)
Deprecated.
Always LIFO.
|
ConnectionPoolConfigurationBuilder |
maxActive(int maxActive)
Controls the maximum number of connections per server that are allocated (checked out to
client threads, or idle in the pool) at one time.
|
ConnectionPoolConfigurationBuilder |
maxIdle(int maxIdle)
Deprecated.
Unsupported with Netty pool implementation.
|
ConnectionPoolConfigurationBuilder |
maxPendingRequests(int maxPendingRequests)
Specifies maximum number of requests sent over single connection at one instant.
|
ConnectionPoolConfigurationBuilder |
maxTotal(int maxTotal)
Deprecated.
Since with Netty implementation we keep a pool-per-server we can't limit totals.
While setting a total number of connections may seem convenient, it leads to port exhaustion
under heavy load: the pool keeps closing and opening connections in a fast succession and
since port is not freed by operating system immediately after closing that (it's in TIME_WAIT
state), the client runs out of available ports (<64k) soon.
|
ConnectionPoolConfigurationBuilder |
maxWait(long maxWait)
The amount of time in milliseconds to wait for a connection to become available when the
exhausted action is
ExhaustedAction.WAIT , after which a NoSuchElementException
will be thrown. |
ConnectionPoolConfigurationBuilder |
minEvictableIdleTime(long minEvictableIdleTime)
Specifies the minimum amount of time that an connection may sit idle in the pool before it is
eligible for eviction due to idle time.
|
ConnectionPoolConfigurationBuilder |
minIdle(int minIdle)
Sets a target value for the minimum number of idle connections (per server) that should always
be available.
|
ConnectionPoolConfigurationBuilder |
numTestsPerEvictionRun(int numTestsPerEvictionRun)
Deprecated.
Unsupported with Netty pool implementation.
|
ConnectionPoolConfigurationBuilder |
read(ConnectionPoolConfiguration template)
Reads the configuration from an already created configuration bean into this builder.
|
ConnectionPoolConfigurationBuilder |
testOnBorrow(boolean testOnBorrow)
Deprecated.
|
ConnectionPoolConfigurationBuilder |
testOnReturn(boolean testOnReturn)
Deprecated.
|
ConnectionPoolConfigurationBuilder |
testWhileIdle(boolean testWhileIdle)
Deprecated.
|
ConnectionPoolConfigurationBuilder |
timeBetweenEvictionRuns(long timeBetweenEvictionRuns)
Deprecated.
Connection eviction uses the event-loop executor thread.
|
void |
validate()
Validate the data in this builder before building the configuration bean
|
ConnectionPoolConfigurationBuilder |
withPoolProperties(Properties properties)
Configures the connection pool parameter according to properties
|
addCluster, addJavaSerialWhiteList, addServer, addServers, asyncExecutorFactory, balancingStrategy, balancingStrategy, balancingStrategy, batchSize, build, classLoader, clientIntelligence, connectionPool, connectionTimeout, consistentHashImpl, consistentHashImpl, forceReturnValues, keySizeEstimate, marshaller, marshaller, marshaller, maxRetries, protocolVersion, security, socketTimeout, tcpKeepAlive, tcpNoDelay, transportFactory, transportFactory, valueSizeEstimate, version, withProperties
public ConnectionPoolConfigurationBuilder exhaustedAction(ExhaustedAction exhaustedAction)
@Deprecated public ConnectionPoolConfigurationBuilder lifo(boolean enabled)
public ConnectionPoolConfigurationBuilder maxActive(int maxActive)
@Deprecated public ConnectionPoolConfigurationBuilder maxTotal(int maxTotal)
public ConnectionPoolConfigurationBuilder maxWait(long maxWait)
ExhaustedAction.WAIT
, after which a NoSuchElementException
will be thrown. If a negative value is supplied, the pool will block indefinitely.@Deprecated public ConnectionPoolConfigurationBuilder maxIdle(int maxIdle)
public ConnectionPoolConfigurationBuilder minIdle(int minIdle)
@Deprecated public ConnectionPoolConfigurationBuilder numTestsPerEvictionRun(int numTestsPerEvictionRun)
@Deprecated public ConnectionPoolConfigurationBuilder timeBetweenEvictionRuns(long timeBetweenEvictionRuns)
public ConnectionPoolConfigurationBuilder minEvictableIdleTime(long minEvictableIdleTime)
@Deprecated public ConnectionPoolConfigurationBuilder testOnBorrow(boolean testOnBorrow)
@Deprecated public ConnectionPoolConfigurationBuilder testOnReturn(boolean testOnReturn)
@Deprecated public ConnectionPoolConfigurationBuilder testWhileIdle(boolean testWhileIdle)
public ConnectionPoolConfigurationBuilder maxPendingRequests(int maxPendingRequests)
exhausted action
is set to ExhaustedAction.WAIT
the pool will allow sending the request over one of the over-utilized
connections.
The rule of thumb is that this should be set to higher values if the values are small (< 1kB) and to lower values
if the entries are big (> 10kB).
Default setting for this parameter is 5.public ConnectionPoolConfigurationBuilder withPoolProperties(Properties properties)
public void validate()
Builder
validate
in interface Builder<ConnectionPoolConfiguration>
public ConnectionPoolConfiguration create()
Builder
create
in interface Builder<ConnectionPoolConfiguration>
public ConnectionPoolConfigurationBuilder read(ConnectionPoolConfiguration template)
Builder
read
in interface Builder<ConnectionPoolConfiguration>
template
- the configuration from which to "clone" this config if needed.Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.