VMware Tanzu GemFire Native C++ Reference 10.2.7
apache::geode::client::Pool Class Referenceabstract

A pool of connections to connect from a client to a set of Geode Cache Servers. More...

#include <Pool.hpp>

Inherits std::enable_shared_from_this< Pool >.

Public Member Functions

virtual void destroy (bool keepAlive=false)=0
 Destroys this pool closing any connections it produced. More...
 
std::chrono::milliseconds getFreeConnectionTimeout () const
 Returns the connection timeout of this pool. More...
 
std::chrono::milliseconds getIdleTimeout () const
 Gets the idle connection timeout for this pool. More...
 
std::chrono::milliseconds getLoadConditioningInterval () const
 Returns the load conditioning interval of this pool. More...
 
virtual const std::shared_ptr< CacheableStringArraygetLocators () const =0
 Returns an unmodifiable list locators that this pool is using. More...
 
int getMaxConnections () const
 Gets the maximum connections for this pool. More...
 
int getMinConnections () const
 Gets the minimum connections for this pool. More...
 
bool getMultiuserAuthentication () const
 Returns true if multiuser authentication is enabled on this pool. More...
 
virtual const std::string & getName () const =0
 Gets the name of the connection pool. More...
 
int getPendingEventCount () const
 Returns the approximate number of pending subscription events maintained at server for this durable client pool at the time it (re)connected to the server. More...
 
std::chrono::milliseconds getPingInterval () const
 Gets the ping interval for this pool. More...
 
bool getPRSingleHopEnabled () const
 Returns true if single-hop optimization is enabled on this pool. More...
 
virtual std::shared_ptr< QueryServicegetQueryService ()=0
 Returns the QueryService for this Pool. More...
 
std::chrono::milliseconds getReadTimeout () const
 Returns the read timeout of this pool. More...
 
int getRetryAttempts () const
 Gets the retry attempts for this pool. More...
 
const std::string & getServerGroup () const
 Returns the server group of this pool. More...
 
virtual const std::shared_ptr< CacheableStringArraygetServers ()=0
 Returns an unmodifiable list of servers this pool is using. More...
 
std::string getSniProxyHost () const
 Gets the host name of the SniProxy. More...
 
int getSniProxyPort () const
 Gets the port of the SniProxy. More...
 
int getSocketBufferSize () const
 Returns the socket buffer size of this pool. More...
 
std::chrono::milliseconds getStatisticInterval () const
 Gets the statistic interval for this pool. More...
 
std::chrono::milliseconds getSubscriptionAckInterval () const
 Returns the subscription ack interval of this pool. More...
 
bool getSubscriptionEnabled () const
 Returns the true if a server-to-client subscriptions are enabled on this pool. More...
 
std::chrono::milliseconds getSubscriptionMessageTrackingTimeout () const
 Returns the subscription message tracking timeout of this pool. More...
 
int getSubscriptionRedundancy () const
 Returns the subscription redundancy level of this pool. More...
 
bool getThreadLocalConnections () const
 Returns true if thread local connections are enabled on this pool. More...
 
std::chrono::milliseconds getUpdateLocatorListInterval () const
 Gets the update locator list interval for this pool. More...
 
virtual bool isDestroyed () const =0
 Indicates whether this Pool has been destroyed. More...
 
virtual void releaseThreadLocalConnection ()=0
 If this pool was configured to use threadlocalconnections, then this method will release the connection cached for the calling thread. More...
 

Detailed Description

A pool of connections to connect from a client to a set of Geode Cache Servers.

Instances of this interface are created using PoolFactory#create.

Existing instances can be found using PoolFactory#find and PoolFactory#getAll.

The pool name must be configured on the client regions that will use this pool by calling AttributeFactory#setPoolName.

Member Function Documentation

◆ destroy()

virtual void apache::geode::client::Pool::destroy ( bool  keepAlive = false)
pure virtual

Destroys this pool closing any connections it produced.

Parameters
keepAlivedefines whether the server should keep the durable client's subscriptions alive for the timeout period.
Exceptions
IllegalStateExceptionif the pool is still in use.

◆ getFreeConnectionTimeout()

std::chrono::milliseconds apache::geode::client::Pool::getFreeConnectionTimeout ( ) const

Returns the connection timeout of this pool.

See also
PoolFactory::setFreeConnectionTimeout

◆ getIdleTimeout()

std::chrono::milliseconds apache::geode::client::Pool::getIdleTimeout ( ) const

Gets the idle connection timeout for this pool.

See also
PoolFactory::setIdleTimeout(long)

◆ getLoadConditioningInterval()

std::chrono::milliseconds apache::geode::client::Pool::getLoadConditioningInterval ( ) const

Returns the load conditioning interval of this pool.

See also
PoolFactory::setLoadConditioningInterval

◆ getLocators()

virtual const std::shared_ptr< CacheableStringArray > apache::geode::client::Pool::getLocators ( ) const
pure virtual

Returns an unmodifiable list locators that this pool is using.

Each locator was either added explicitly when the pool was created or was discovered using the explicit locators.

If a pool has no locators, then it cannot discover servers or locators at runtime.

◆ getMaxConnections()

int apache::geode::client::Pool::getMaxConnections ( ) const

Gets the maximum connections for this pool.

See also
PoolFactory::setMaxConnections(int)

◆ getMinConnections()

int apache::geode::client::Pool::getMinConnections ( ) const

Gets the minimum connections for this pool.

See also
PoolFactory::setMinConnections(int)

◆ getMultiuserAuthentication()

bool apache::geode::client::Pool::getMultiuserAuthentication ( ) const

Returns true if multiuser authentication is enabled on this pool.

See also
PoolFactory::setMultiuserAuthentication

◆ getName()

virtual const std::string & apache::geode::client::Pool::getName ( ) const
pure virtual

Gets the name of the connection pool.

Returns
the name of the pool
See also
PoolFactory::create

◆ getPendingEventCount()

int apache::geode::client::Pool::getPendingEventCount ( ) const

Returns the approximate number of pending subscription events maintained at server for this durable client pool at the time it (re)connected to the server.

Server would start dispatching these events to this durable client pool when it receives Cache#readyForEvents() from it.

Durable clients can call this method on reconnect to assess the amount of 'stale' data i.e. events accumulated at server while this client was away and, importantly, before calling Cache#readyForEvents().

Any number of invocations of this method during a single session will return the same value.

It may return a zero value if there are no events pending at server for this client pool. A negative value returned tells us that no queue was available at server for this client pool.

A value -1 indicates that this client pool reconnected to server after its 'durable-client-timeout' period elapsed and hence its subscription queue at server was removed, possibly causing data loss.

A value -2 indicates that this client pool connected to server for the first time.

Returns
int The number of subscription events maintained at server for this durable client pool at the time this pool (re)connected. A negative value indicates no queue was found for this client pool.
Exceptions
IllegalStateExceptionIf called by a non-durable client or if invoked any time after invocation of Cache#readyForEvents().
Since
8.1

◆ getPingInterval()

std::chrono::milliseconds apache::geode::client::Pool::getPingInterval ( ) const

Gets the ping interval for this pool.

See also
PoolFactory::setPingInterval(long)

◆ getPRSingleHopEnabled()

bool apache::geode::client::Pool::getPRSingleHopEnabled ( ) const

Returns true if single-hop optimization is enabled on this pool.

See also
PoolFactory::setPRSingleHopEnabled

◆ getQueryService()

virtual std::shared_ptr< QueryService > apache::geode::client::Pool::getQueryService ( )
pure virtual

Returns the QueryService for this Pool.

The query operations performed using this QueryService will be executed on the servers that are associated with this pool. To perform Query operation on the local cache obtain the QueryService instance from the Cache.

Exceptions
unSupportedException when Pool is in multi user mode.
See also
Cache::getQueryService
Returns
the QueryService

◆ getReadTimeout()

std::chrono::milliseconds apache::geode::client::Pool::getReadTimeout ( ) const

Returns the read timeout of this pool.

See also
PoolFactory::setReadTimeout

◆ getRetryAttempts()

int apache::geode::client::Pool::getRetryAttempts ( ) const

Gets the retry attempts for this pool.

See also
PoolFactory::setRetryAttempts(int)

◆ getServerGroup()

const std::string & apache::geode::client::Pool::getServerGroup ( ) const

Returns the server group of this pool.

See also
PoolFactory::setServerGroup

◆ getServers()

virtual const std::shared_ptr< CacheableStringArray > apache::geode::client::Pool::getServers ( )
pure virtual

Returns an unmodifiable list of servers this pool is using.

These servers where either added explicitly when the pool was created or were discovered using this pools locators.

◆ getSniProxyHost()

std::string apache::geode::client::Pool::getSniProxyHost ( ) const

Gets the host name of the SniProxy.

See also
PoolFactory::setSniProxy(string, int)

◆ getSniProxyPort()

int apache::geode::client::Pool::getSniProxyPort ( ) const

Gets the port of the SniProxy.

See also
PoolFactory::setSniProxy(string, int)

◆ getSocketBufferSize()

int apache::geode::client::Pool::getSocketBufferSize ( ) const

Returns the socket buffer size of this pool.

See also
PoolFactory::setSocketBufferSize

◆ getStatisticInterval()

std::chrono::milliseconds apache::geode::client::Pool::getStatisticInterval ( ) const

Gets the statistic interval for this pool.

See also
PoolFactory::setStatisticInterval(int)

◆ getSubscriptionAckInterval()

std::chrono::milliseconds apache::geode::client::Pool::getSubscriptionAckInterval ( ) const

Returns the subscription ack interval of this pool.

See also
PoolFactory::setSubscriptionAckInterval(int)

◆ getSubscriptionEnabled()

bool apache::geode::client::Pool::getSubscriptionEnabled ( ) const

Returns the true if a server-to-client subscriptions are enabled on this pool.

See also
PoolFactory::setSubscriptionEnabled

◆ getSubscriptionMessageTrackingTimeout()

std::chrono::milliseconds apache::geode::client::Pool::getSubscriptionMessageTrackingTimeout ( ) const

Returns the subscription message tracking timeout of this pool.

See also
PoolFactory::setSubscriptionMessageTrackingTimeout

◆ getSubscriptionRedundancy()

int apache::geode::client::Pool::getSubscriptionRedundancy ( ) const

Returns the subscription redundancy level of this pool.

See also
PoolFactory::setSubscriptionRedundancy

◆ getThreadLocalConnections()

bool apache::geode::client::Pool::getThreadLocalConnections ( ) const

Returns true if thread local connections are enabled on this pool.

See also
PoolFactory::setThreadLocalConnections

◆ getUpdateLocatorListInterval()

std::chrono::milliseconds apache::geode::client::Pool::getUpdateLocatorListInterval ( ) const

Gets the update locator list interval for this pool.

See also
PoolFactory::setUpdateLocatorListInterval(long)

◆ isDestroyed()

virtual bool apache::geode::client::Pool::isDestroyed ( ) const
pure virtual

Indicates whether this Pool has been destroyed.

Returns
true if the pool has been destroyed.

◆ releaseThreadLocalConnection()

virtual void apache::geode::client::Pool::releaseThreadLocalConnection ( )
pure virtual

If this pool was configured to use threadlocalconnections, then this method will release the connection cached for the calling thread.

The connection will then be available for use by other threads.

If this pool is not using threadlocalconnections, this method will have no effect.


Apache Geode C++ Cache API Documentation