public class PoolingOptionsFactoryBean extends Object implements FactoryBean<com.datastax.driver.core.PoolingOptions>, InitializingBean
FactoryBean for the Cassandra Java driver PoolingOptions.FactoryBean,
InitializingBean,
PoolingOptions| Modifier and Type | Class and Description |
|---|---|
protected static class |
PoolingOptionsFactoryBean.HostDistancePoolingOptions
The HostDistancePoolingOptions class models the
PoolingOptions state and connection settings for a
particular HostDistance. |
| Constructor and Description |
|---|
PoolingOptionsFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected com.datastax.driver.core.PoolingOptions |
configureLocalHostDistancePoolingOptions(com.datastax.driver.core.PoolingOptions poolingOptions)
Configures the
HostDistance.LOCAL connection settings on the given PoolingOptions. |
protected com.datastax.driver.core.PoolingOptions |
configureRemoteHostDistancePoolingOptions(com.datastax.driver.core.PoolingOptions poolingOptions)
Configures the
HostDistance.REMOTE connection settings on the given PoolingOptions. |
int |
getHeartbeatIntervalSeconds()
Gets the heart beat interval, after which a message is sent on an idle connection to make sure it's still alive.
|
int |
getIdleTimeoutSeconds()
Get the timeout before an idle connection is removed.
|
Executor |
getInitializationExecutor()
Gets the
Executor to use for connection initialization. |
Integer |
getLocalCoreConnections()
Gets the core number of connections per host for the
HostDistance.LOCAL scope. |
Integer |
getLocalMaxConnections()
Gets the maximum number of connections per host for the
HostDistance.LOCAL scope. |
Integer |
getLocalMaxSimultaneousRequests()
Gets the maximum number of requests per connection for the
HostDistance.LOCAL scope. |
Integer |
getLocalMinSimultaneousRequests()
Gets the threshold that triggers the creation of a new connection to a host for the
HostDistance.LOCAL
scope. |
Integer |
getMaxQueueSize()
Gets the maximum number of requests that get enqueued if no connection is available.
|
com.datastax.driver.core.PoolingOptions |
getObject() |
Class<?> |
getObjectType() |
int |
getPoolTimeoutMilliseconds()
Gets the timeout when trying to acquire a connection from a host's pool.
|
Integer |
getRemoteCoreConnections()
Gets the core number of connections per host for the
HostDistance.REMOTE scope. |
Integer |
getRemoteMaxConnections()
Gets the maximum number of connections per host for the
HostDistance.REMOTE scope. |
Integer |
getRemoteMaxSimultaneousRequests()
Gets the maximum number of requests per connection for the
HostDistance.REMOTE scope. |
Integer |
getRemoteMinSimultaneousRequests()
Gets the threshold that triggers the creation of a new connection to a host for the
HostDistance.REMOTE
scope. |
boolean |
isSingleton() |
protected PoolingOptionsFactoryBean.HostDistancePoolingOptions |
newLocalHostDistancePoolingOptions()
Constructs and returns a
PoolingOptionsFactoryBean.HostDistancePoolingOptions instance initialized with the
HostDistance.LOCAL-based PoolingOptions as configured on this PoolingOptionsFactoryBean. |
protected PoolingOptionsFactoryBean.HostDistancePoolingOptions |
newRemoteHostDistancePoolingOptions()
Constructs and returns a
PoolingOptionsFactoryBean.HostDistancePoolingOptions instance initialized with the
HostDistance.REMOTE-based PoolingOptions as configured on this PoolingOptionsFactoryBean. |
void |
setHeartbeatIntervalSeconds(int heartbeatIntervalSeconds)
Sets the heart beat interval, after which a message is sent on an idle connection to make sure it's still alive.
|
void |
setIdleTimeoutSeconds(int idleTimeoutSeconds)
Sets the timeout before an idle connection is removed.
|
void |
setInitializationExecutor(Executor initializationExecutor)
Sets the
Executor to use for connection initialization. |
void |
setLocalCoreConnections(Integer localCoreConnections)
Sets the core number of connections per host for the
HostDistance.LOCAL scope. |
void |
setLocalMaxConnections(Integer localMaxConnections)
Sets the maximum number of connections per host for the
HostDistance.LOCAL scope. |
void |
setLocalMaxSimultaneousRequests(Integer localMaxSimultaneousRequests)
Sets the maximum number of requests per connection for the
HostDistance.LOCAL scope. |
void |
setLocalMinSimultaneousRequests(Integer localMinSimultaneousRequests)
Sets the threshold that triggers the creation of a new connection to a host for the
HostDistance.LOCAL
scope. |
void |
setMaxQueueSize(Integer maxQueueSize)
Sets the maximum number of requests that get enqueued if no connection is available.
|
void |
setPoolTimeoutMilliseconds(int poolTimeoutMilliseconds)
Sets the timeout when trying to acquire a connection from a host's pool.
|
void |
setRemoteCoreConnections(Integer remoteCoreConnections)
Sets the core number of connections per host for the
HostDistance.REMOTE scope. |
void |
setRemoteMaxConnections(Integer remoteMaxConnections)
Sets the maximum number of connections per host for the
HostDistance.REMOTE scope. |
void |
setRemoteMaxSimultaneousRequests(Integer remoteMaxSimultaneousRequests)
Sets the maximum number of requests per connection for the
HostDistance.REMOTE scope. |
void |
setRemoteMinSimultaneousRequests(Integer remoteMinSimultaneousRequests)
Sets the threshold that triggers the creation of a new connection to a host for the
HostDistance.REMOTE
scope. |
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionprotected PoolingOptionsFactoryBean.HostDistancePoolingOptions newLocalHostDistancePoolingOptions()
PoolingOptionsFactoryBean.HostDistancePoolingOptions instance initialized with the
HostDistance.LOCAL-based PoolingOptions as configured on this PoolingOptionsFactoryBean.PoolingOptionsFactoryBean.HostDistancePoolingOptions initialized with this
PoolingOptionsFactoryBean's HostDistance.LOCAL-based PoolingOptions.HostDistance.LOCAL,
PoolingOptions,
PoolingOptionsFactoryBean.HostDistancePoolingOptions,
PoolingOptionsFactoryBean.LocalHostDistancePoolingOptionsprotected PoolingOptionsFactoryBean.HostDistancePoolingOptions newRemoteHostDistancePoolingOptions()
PoolingOptionsFactoryBean.HostDistancePoolingOptions instance initialized with the
HostDistance.REMOTE-based PoolingOptions as configured on this PoolingOptionsFactoryBean.PoolingOptionsFactoryBean.HostDistancePoolingOptions initialized with this
PoolingOptionsFactoryBean's HostDistance.REMOTE-based PoolingOptions.HostDistance.REMOTE,
PoolingOptions,
PoolingOptionsFactoryBean.HostDistancePoolingOptions,
PoolingOptionsFactoryBean.RemoteHostDistancePoolingOptionsprotected com.datastax.driver.core.PoolingOptions configureLocalHostDistancePoolingOptions(com.datastax.driver.core.PoolingOptions poolingOptions)
HostDistance.LOCAL connection settings on the given PoolingOptions.poolingOptions - the PoolingOptions to configure.PoolingOptions.HostDistance.LOCAL,
PoolingOptions,
newLocalHostDistancePoolingOptions()protected com.datastax.driver.core.PoolingOptions configureRemoteHostDistancePoolingOptions(com.datastax.driver.core.PoolingOptions poolingOptions)
HostDistance.REMOTE connection settings on the given PoolingOptions.poolingOptions - the PoolingOptions to configure.PoolingOptions.HostDistance.REMOTE,
PoolingOptions,
newRemoteHostDistancePoolingOptions()public com.datastax.driver.core.PoolingOptions getObject()
throws Exception
getObject in interface FactoryBean<com.datastax.driver.core.PoolingOptions>Exceptionpublic Class<?> getObjectType()
getObjectType in interface FactoryBean<com.datastax.driver.core.PoolingOptions>public boolean isSingleton()
isSingleton in interface FactoryBean<com.datastax.driver.core.PoolingOptions>public void setHeartbeatIntervalSeconds(int heartbeatIntervalSeconds)
heartbeatIntervalSeconds - interval in seconds between heartbeat messages to keep idle connections alive.public int getHeartbeatIntervalSeconds()
heartbeatIntervalSeconds.public void setIdleTimeoutSeconds(int idleTimeoutSeconds)
idleTimeoutSeconds - idle timeout in seconds before a connection is removed.public int getIdleTimeoutSeconds()
idleTimeoutSeconds.public void setInitializationExecutor(Executor initializationExecutor)
Executor to use for connection initialization.initializationExecutor - Executor used to initialize the connection.@Nullable public Executor getInitializationExecutor()
Executor to use for connection initialization.initializationExecutor.public void setPoolTimeoutMilliseconds(int poolTimeoutMilliseconds)
poolTimeoutMilliseconds - timeout in milliseconds used to acquire a connection from the host's pool.public int getPoolTimeoutMilliseconds()
poolTimeoutMilliseconds.public void setMaxQueueSize(Integer maxQueueSize)
maxQueueSize - maximum number of requests that get enqueued if no connection is available.public Integer getMaxQueueSize()
maxQueueSize.public void setLocalCoreConnections(@Nullable Integer localCoreConnections)
HostDistance.LOCAL scope.localCoreConnections - core number of local connections per host.@Nullable public Integer getLocalCoreConnections()
HostDistance.LOCAL scope.public void setLocalMaxConnections(@Nullable Integer localMaxConnections)
HostDistance.LOCAL scope.localMaxConnections - max number of local connections per host.@Nullable public Integer getLocalMaxConnections()
HostDistance.LOCAL scope.localMaxConnections.public void setLocalMaxSimultaneousRequests(@Nullable Integer localMaxSimultaneousRequests)
HostDistance.LOCAL scope.localMaxSimultaneousRequests - max number of requests for local connections.@Nullable public Integer getLocalMaxSimultaneousRequests()
HostDistance.LOCAL scope.localMaxSimultaneousRequests.public void setLocalMinSimultaneousRequests(@Nullable Integer localMinSimultaneousRequests)
HostDistance.LOCAL
scope.localMinSimultaneousRequests - threshold triggering the creation of local connections to a host.@Nullable public Integer getLocalMinSimultaneousRequests()
HostDistance.LOCAL
scope.localMinSimultaneousRequests.public void setRemoteCoreConnections(@Nullable Integer remoteCoreConnections)
HostDistance.REMOTE scope.remoteCoreConnections - core number of remote connections per host.@Nullable public Integer getRemoteCoreConnections()
HostDistance.REMOTE scope.public void setRemoteMaxConnections(@Nullable Integer remoteMaxConnections)
HostDistance.REMOTE scope.remoteMaxConnections - max number of remote connections per host.@Nullable public Integer getRemoteMaxConnections()
HostDistance.REMOTE scope.remoteMaxConnections.public void setRemoteMaxSimultaneousRequests(@Nullable Integer remoteMaxSimultaneousRequests)
HostDistance.REMOTE scope.remoteMaxSimultaneousRequests - max number of requests for local connections.@Nullable public Integer getRemoteMaxSimultaneousRequests()
HostDistance.REMOTE scope.remoteMaxSimultaneousRequests.public void setRemoteMinSimultaneousRequests(@Nullable Integer remoteMinSimultaneousRequests)
HostDistance.REMOTE
scope.remoteMinSimultaneousRequests - threshold triggering the creation of remote connections to a host.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.