Pivotal GemFire Native Client Cache Reference  9.0.6
gemfire::Pool Class Referenceabstract

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

Inherits gemfire::SharedBase.

Public Member Functions

virtual void destroy (bool keepAlive=false)=0
 Destroys this pool closing any connections it produced. More...
 
int getFreeConnectionTimeout () const
 Returns the connection timeout of this pool. More...
 
long getIdleTimeout () const
 Gets the idle connection timeout for this pool. More...
 
int getLoadConditioningInterval () const
 Returns the load conditioning interval of this pool. More...
 
virtual const CacheableStringArrayPtr getLocators () 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 char * 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...
 
long getPingInterval () const
 Gets the ping interval for this pool. More...
 
bool getPRSingleHopEnabled () const
 Returns true if single-hop optimisation is enabled on this pool. More...
 
virtual QueryServicePtr getQueryService ()=0
 Returns the QueryService for this Pool. More...
 
int getReadTimeout () const
 Returns the read timeout of this pool. More...
 
int getRetryAttempts () const
 Gets the retry attempts for this pool. More...
 
const char * getServerGroup () const
 Returns the server group of this pool. More...
 
virtual const CacheableStringArrayPtr getServers ()=0
 Returns an unmodifiable list of servers this pool is using. More...
 
int getSocketBufferSize () const
 Returns the socket buffer size of this pool. More...
 
int getStatisticInterval () const
 Gets the statistic interval for this pool. More...
 
int 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...
 
int 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...
 
long 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...
 
void preserveSB () const
 Atomically increment reference count. More...
 
int32_t refCount ()
 
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. 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 GemFire 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

virtual void gemfire::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.
int gemfire::Pool::getFreeConnectionTimeout ( ) const

Returns the connection timeout of this pool.

See also
PoolFactory::setFreeConnectionTimeout
long gemfire::Pool::getIdleTimeout ( ) const

Gets the idle connection timeout for this pool.

See also
PoolFactory::setIdleTimeout(long)
int gemfire::Pool::getLoadConditioningInterval ( ) const

Returns the load conditioning interval of this pool.

See also
PoolFactory::setLoadConditioningInterval
virtual const CacheableStringArrayPtr gemfire::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.

int gemfire::Pool::getMaxConnections ( ) const

Gets the maximum connections for this pool.

See also
PoolFactory::setMaxConnections(int)
int gemfire::Pool::getMinConnections ( ) const

Gets the minimum connections for this pool.

See also
PoolFactory::setMinConnections(int)
bool gemfire::Pool::getMultiuserAuthentication ( ) const

Returns true if multiuser authentication is enabled on this pool.

See also
PoolFactory::setMultiuserAuthentication
virtual const char* gemfire::Pool::getName ( ) const
pure virtual

Gets the name of the connection pool.

Returns
the name of the pool
See also
PoolFactory::create
int gemfire::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
long gemfire::Pool::getPingInterval ( ) const

Gets the ping interval for this pool.

See also
PoolFactory::setPingInterval(long)
bool gemfire::Pool::getPRSingleHopEnabled ( ) const

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

See also
PoolFactory::setPRSingleHopEnabled
virtual QueryServicePtr gemfire::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
int gemfire::Pool::getReadTimeout ( ) const

Returns the read timeout of this pool.

See also
PoolFactory::setReadTimeout
int gemfire::Pool::getRetryAttempts ( ) const

Gets the retry attempts for this pool.

See also
PoolFactory::setRetryAttempts(int)
const char* gemfire::Pool::getServerGroup ( ) const

Returns the server group of this pool.

See also
PoolFactory::setServerGroup
virtual const CacheableStringArrayPtr gemfire::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.

int gemfire::Pool::getSocketBufferSize ( ) const

Returns the socket buffer size of this pool.

See also
PoolFactory::setSocketBufferSize
int gemfire::Pool::getStatisticInterval ( ) const

Gets the statistic interval for this pool.

See also
PoolFactory::setStatisticInterval(int)
int gemfire::Pool::getSubscriptionAckInterval ( ) const

Returns the subscription ack interval of this pool.

See also
PoolFactory::setSubscriptionAckInterval(int)
bool gemfire::Pool::getSubscriptionEnabled ( ) const

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

See also
PoolFactory::setSubscriptionEnabled
int gemfire::Pool::getSubscriptionMessageTrackingTimeout ( ) const

Returns the subscription message tracking timeout of this pool.

See also
PoolFactory::setSubscriptionMessageTrackingTimeout
int gemfire::Pool::getSubscriptionRedundancy ( ) const

Returns the subscription redundancy level of this pool.

See also
PoolFactory::setSubscriptionRedundancy
bool gemfire::Pool::getThreadLocalConnections ( ) const

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

See also
PoolFactory::setThreadLocalConnections
long gemfire::Pool::getUpdateLocatorListInterval ( ) const

Gets the update locator list interval for this pool.

See also
PoolFactory::setUpdateLocatorListInterval(long)
virtual bool gemfire::Pool::isDestroyed ( ) const
pure virtual

Indicates whether this Pool has been destroyed.

Returns
true if the pool has been destroyed.
void gemfire::SharedBase::preserveSB ( ) const
inherited

Atomically increment reference count.

int32_t gemfire::SharedBase::refCount ( )
inlineinherited
Returns
the reference count
void gemfire::SharedBase::releaseSB ( ) const
inherited

Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.

virtual void gemfire::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.


GemFire C++ Cache API Documentation