Class ConnectionPoolConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.AbstractPersistenceConfigurationChildBuilder
-
- org.infinispan.configuration.cache.AbstractStoreConfigurationChildBuilder<S>
-
- org.infinispan.persistence.remote.configuration.AbstractRemoteStoreConfigurationChildBuilder<RemoteStoreConfigurationBuilder>
-
- org.infinispan.persistence.remote.configuration.ConnectionPoolConfigurationBuilder
-
- All Implemented Interfaces:
Builder<ConnectionPoolConfiguration>,ConfigurationChildBuilder,PersistenceConfigurationChildBuilder,StoreConfigurationChildBuilder<RemoteStoreConfigurationBuilder>,RemoteStoreConfigurationChildBuilder<RemoteStoreConfigurationBuilder>
public class ConnectionPoolConfigurationBuilder extends AbstractRemoteStoreConfigurationChildBuilder<RemoteStoreConfigurationBuilder> implements Builder<ConnectionPoolConfiguration>
ConnectionPoolConfigurationBuilder. Specifies connection pooling properties for the HotRod client.- Since:
- 5.2
- Author:
- Tristan Tarrant
-
-
Field Summary
-
Fields inherited from class org.infinispan.persistence.remote.configuration.AbstractRemoteStoreConfigurationChildBuilder
attributes, builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.infinispan.commons.configuration.attributes.AttributeSetattributes()Configurationbuild()ClusteringConfigurationBuilderclustering()ConnectionPoolConfigurationcreate()Create the configuration beanCustomInterceptorsConfigurationBuildercustomInterceptors()Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptorsEncodingConfigurationBuilderencoding()ConnectionPoolConfigurationBuilderexhaustedAction(ExhaustedAction exhaustedAction)Specifies what happens when asking for a connection from a server's pool, and that pool is exhausted.ExpirationConfigurationBuilderexpiration()protected ConfigurationBuildergetBuilder()IndexingConfigurationBuilderindexing()InvocationBatchingConfigurationBuilderinvocationBatching()LockingConfigurationBuilderlocking()ConnectionPoolConfigurationBuildermaxActive(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.ConnectionPoolConfigurationBuildermaxIdle(int maxIdle)Deprecated.since 10.0.ConnectionPoolConfigurationBuildermaxPendingRequests(int maxPendingRequests)Specifies maximum number of requests sent over single connection at one instant.ConnectionPoolConfigurationBuildermaxTotal(int maxTotal)Deprecated.since 10.0.ConnectionPoolConfigurationBuildermaxWait(int maxWait)The amount of time in milliseconds to wait for a connection to become available when the exhausted action isExhaustedAction.WAIT, after which aNoSuchElementExceptionwill be thrown.MemoryConfigurationBuildermemory()ConnectionPoolConfigurationBuilderminEvictableIdleTime(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.ConnectionPoolConfigurationBuilderminIdle(int minIdle)Sets a target value for the minimum number of idle connections (per server) that should always be available.PersistenceConfigurationBuilderpersistence()ConnectionPoolConfigurationBuilderread(ConnectionPoolConfiguration template)Reads the configuration from an already created configuration bean into this builder.SecurityConfigurationBuildersecurity()booleansimpleCache()ConfigurationChildBuildersimpleCache(boolean simpleCache)SitesConfigurationBuildersites()StatisticsConfigurationBuilderstatistics()ConfigurationChildBuildertemplate(boolean template)ConnectionPoolConfigurationBuildertestWhileIdle(boolean testWhileIdle)Deprecated.since 10.0.ConnectionPoolConfigurationBuildertimeBetweenEvictionRuns(long timeBetweenEvictionRuns)Deprecated.since 10.0.TransactionConfigurationBuildertransaction()UnsafeConfigurationBuilderunsafe()voidvalidate(GlobalConfiguration globalConfig)-
Methods inherited from class org.infinispan.persistence.remote.configuration.AbstractRemoteStoreConfigurationChildBuilder
addServer, asyncExecutorFactory, balancingStrategy, connectionPool, connectionTimeout, forceReturnValues, getRemoteStoreBuilder, hotRodWrapping, keySizeEstimate, marshaller, marshaller, protocolVersion, rawValues, remoteCacheName, remoteSecurity, socketTimeout, tcpNoDelay, transportFactory, transportFactory, valueSizeEstimate
-
Methods inherited from class org.infinispan.configuration.cache.AbstractStoreConfigurationChildBuilder
addProperty, async, fetchPersistentState, ignoreModifications, maxBatchSize, preload, purgeOnStartup, segmented, shared, transactional, withProperties, writeOnly
-
Methods inherited from interface org.infinispan.configuration.cache.ConfigurationChildBuilder
build, clustering, customInterceptors, encoding, expiration, indexing, invocationBatching, jmxStatistics, locking, memory, security, simpleCache, simpleCache, sites, statistics, template, transaction, unsafe
-
Methods inherited from interface org.infinispan.configuration.cache.PersistenceConfigurationChildBuilder
persistence
-
Methods inherited from interface org.infinispan.configuration.cache.StoreConfigurationChildBuilder
addProperty, async, fetchPersistentState, ignoreModifications, maxBatchSize, preload, purgeOnStartup, segmented, shared, transactional, withProperties, writeOnly
-
-
-
-
Method Detail
-
attributes
public org.infinispan.commons.configuration.attributes.AttributeSet attributes()
-
exhaustedAction
public ConnectionPoolConfigurationBuilder exhaustedAction(ExhaustedAction exhaustedAction)
Specifies what happens when asking for a connection from a server's pool, and that pool is exhausted.
-
maxActive
public 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. When non-positive, there is no limit to the number of connections per server. When maxActive is reached, the connection pool for that server is said to be exhausted. The default setting for this parameter is -1, i.e. there is no limit.
-
maxTotal
@Deprecated public ConnectionPoolConfigurationBuilder maxTotal(int maxTotal)
Deprecated.since 10.0. This method has no effectSets a global limit on the number persistent connections that can be in circulation within the combined set of servers. When non-positive, there is no limit to the total number of persistent connections in circulation. When maxTotal is exceeded, all connections pools are exhausted. The default setting for this parameter is -1 (no limit).
-
maxIdle
@Deprecated public ConnectionPoolConfigurationBuilder maxIdle(int maxIdle)
Deprecated.since 10.0. This method has no effectControls the maximum number of idle persistent connections, per server, at any time. When negative, there is no limit to the number of connections that may be idle per server. The default setting for this parameter is -1.
-
maxWait
public ConnectionPoolConfigurationBuilder maxWait(int maxWait)
The amount of time in milliseconds to wait for a connection to become available when the exhausted action isExhaustedAction.WAIT, after which aNoSuchElementExceptionwill be thrown. If a negative value is supplied, the pool will block indefinitely.
-
minIdle
public ConnectionPoolConfigurationBuilder minIdle(int minIdle)
Sets a target value for the minimum number of idle connections (per server) that should always be available. If this parameter is set to a positive number and timeBetweenEvictionRunsMillis > 0, each time the idle connection eviction thread runs, it will try to create enough idle instances so that there will be minIdle idle instances available for each server. The default setting for this parameter is 1.
-
timeBetweenEvictionRuns
@Deprecated public ConnectionPoolConfigurationBuilder timeBetweenEvictionRuns(long timeBetweenEvictionRuns)
Deprecated.since 10.0. This method has no effectIndicates how long the eviction thread should sleep before "runs" of examining idle connections. When non-positive, no eviction thread will be launched. The default setting for this parameter is 2 minutes.
-
minEvictableIdleTime
public 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. When non-positive, no connection will be dropped from the pool due to idle time alone. This setting has no effect unless timeBetweenEvictionRunsMillis > 0. The default setting for this parameter is 1800000(30 minutes).
-
testWhileIdle
@Deprecated public ConnectionPoolConfigurationBuilder testWhileIdle(boolean testWhileIdle)
Deprecated.since 10.0. This method has no effectIndicates whether or not idle connections should be validated by sending an TCP packet to the server, during idle connection eviction runs. Connections that fail to validate will be dropped from the pool. This setting has no effect unless timeBetweenEvictionRunsMillis > 0. The default setting for this parameter is true.
-
maxPendingRequests
public ConnectionPoolConfigurationBuilder maxPendingRequests(int maxPendingRequests)
Specifies maximum number of requests sent over single connection at one instant. Connections with more concurrent requests will be ignored in the pool when choosing available connection and the pool will try to create a new connection if all connections are utilized. Only if the new connection cannot be created and theexhausted actionis set toExhaustedAction.WAITthe 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.
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validatein interfaceConfigurationChildBuilder- Overrides:
validatein classAbstractRemoteStoreConfigurationChildBuilder<RemoteStoreConfigurationBuilder>
-
create
public ConnectionPoolConfiguration create()
Description copied from interface:BuilderCreate the configuration bean- Specified by:
createin interfaceBuilder<ConnectionPoolConfiguration>- Returns:
-
read
public ConnectionPoolConfigurationBuilder read(ConnectionPoolConfiguration template)
Description copied from interface:BuilderReads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
readin interfaceBuilder<ConnectionPoolConfiguration>- Parameters:
template- the configuration from which to "clone" this config if needed.
-
template
public ConfigurationChildBuilder template(boolean template)
- Specified by:
templatein interfaceConfigurationChildBuilder
-
simpleCache
public ConfigurationChildBuilder simpleCache(boolean simpleCache)
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
clustering
public ClusteringConfigurationBuilder clustering()
- Specified by:
clusteringin interfaceConfigurationChildBuilder
-
customInterceptors
@Deprecated public CustomInterceptorsConfigurationBuilder customInterceptors()
Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptors- Specified by:
customInterceptorsin interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encodingin interfaceConfigurationChildBuilder
-
expiration
public ExpirationConfigurationBuilder expiration()
- Specified by:
expirationin interfaceConfigurationChildBuilder
-
indexing
public IndexingConfigurationBuilder indexing()
- Specified by:
indexingin interfaceConfigurationChildBuilder
-
invocationBatching
public InvocationBatchingConfigurationBuilder invocationBatching()
- Specified by:
invocationBatchingin interfaceConfigurationChildBuilder
-
statistics
public StatisticsConfigurationBuilder statistics()
- Specified by:
statisticsin interfaceConfigurationChildBuilder
-
persistence
public PersistenceConfigurationBuilder persistence()
- Specified by:
persistencein interfaceConfigurationChildBuilder
-
locking
public LockingConfigurationBuilder locking()
- Specified by:
lockingin interfaceConfigurationChildBuilder
-
security
public SecurityConfigurationBuilder security()
- Specified by:
securityin interfaceConfigurationChildBuilder
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transactionin interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafein interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sitesin interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memoryin interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
buildin interfaceConfigurationChildBuilder
-
-