20#ifndef GEODE_POOLFACTORY_H_
21#define GEODE_POOLFACTORY_H_
26#include "internal/chrono/duration.hpp"
27#include "internal/geode_globals.hpp"
90 static const int DEFAULT_SOCKET_BUFFER_SIZE = 32768;
102 static const int DEFAULT_MIN_CONNECTIONS = 1;
108 static const int DEFAULT_MAX_CONNECTIONS = -1;
121 static const int DEFAULT_RETRY_ATTEMPTS = -1;
146 static const bool DEFAULT_SUBSCRIPTION_ENABLED =
false;
154 static const int DEFAULT_SUBSCRIPTION_REDUNDANCY = 0;
161 static const std::chrono::milliseconds
180 static constexpr bool DEFAULT_THREAD_LOCAL_CONN =
false;
186 static constexpr bool DEFAULT_MULTIUSER_SECURE_MODE =
false;
192 static constexpr bool DEFAULT_PR_SINGLE_HOP_ENABLED =
true;
212 std::chrono::milliseconds connectionTimeout);
229 std::chrono::milliseconds loadConditioningInterval);
365 std::chrono::milliseconds updateLocatorListInterval);
381 std::chrono::milliseconds statisticInterval);
473 std::chrono::milliseconds messageTrackingTimeout);
487 std::chrono::milliseconds ackInterval);
515 std::shared_ptr<Pool>
create(std::string name);
545 std::shared_ptr<PoolAttributes> m_attrs;
546 bool m_isSubscriptionRedundancy;
547 bool m_addedServerOrLocator;
548 const Cache& m_cache;
552 friend class PoolManagerImpl;
554 friend class CacheXmlCreation;
Caches are obtained from the create method on the CacheFactory#create class.
Definition: Cache.hpp:65
Top level class for configuring and using Geode on a client.This should be called once to create Cach...
Definition: CacheFactory.hpp:48
This interface provides for the configuration and creation of instances of Pool.
Definition: PoolFactory.hpp:68
PoolFactory & setLoadConditioningInterval(std::chrono::milliseconds loadConditioningInterval)
Sets the load conditioning interval for this pool.
PoolFactory & reset()
Resets the configuration of this factory to its defaults.
PoolFactory & setStatisticInterval(std::chrono::milliseconds statisticInterval)
The frequency with which the client statistics must be sent to the server.
PoolFactory & setSubscriptionMessageTrackingTimeout(std::chrono::milliseconds messageTrackingTimeout)
Sets the messageTrackingTimeout attribute which is the time-to-live period for subscription events th...
PoolFactory & setIdleTimeout(std::chrono::milliseconds)
Sets the amount of time a connection can be idle before expiring the connection.
static const std::chrono::milliseconds DEFAULT_UPDATE_LOCATOR_LIST_INTERVAL
The default frequency to update the locator list.
Definition: PoolFactory.hpp:133
PoolFactory & setSubscriptionAckInterval(std::chrono::milliseconds ackInterval)
Sets the is the interval to wait before sending acknowledgements to the bridge server for events rece...
PoolFactory & setSubscriptionEnabled(bool enabled)
If set to true then the created pool will have server-to-client subscriptions enabled.
static const std::string DEFAULT_SERVER_GROUP
The default server group.
Definition: PoolFactory.hpp:175
PoolFactory & setThreadLocalConnections(bool threadLocalConnections)
Sets the thread local connections policy for this pool.
PoolFactory & setRetryAttempts(int retryAttempts)
Set the number of times to retry a request after timeout/exception.
PoolFactory & addServer(const std::string &host, int port)
Adds a server, given its host and port, to this factory.
static const std::chrono::milliseconds DEFAULT_READ_TIMEOUT
The default amount of time to wait for a response from a server.
Definition: PoolFactory.hpp:96
PoolFactory & setSocketBufferSize(int bufferSize)
Sets the socket buffer size for each connection made in this pool.
PoolFactory & setSubscriptionRedundancy(int redundancy)
Sets the redundancy level for this pools server-to-client subscriptions.
PoolFactory & setReadTimeout(std::chrono::milliseconds timeout)
Sets the duration to wait for a response from a server before timing out the operation and trying ano...
static const std::chrono::milliseconds DEFAULT_SUBSCRIPTION_MESSAGE_TRACKING_TIMEOUT
The default amount of time that messages sent from a server to a client will be tracked.
Definition: PoolFactory.hpp:162
PoolFactory & addLocator(const std::string &host, int port)
Adds a locator, given its host and port, to this factory.
static const std::chrono::milliseconds DEFAULT_IDLE_TIMEOUT
The default amount of time to wait for a connection to become idle.
Definition: PoolFactory.hpp:114
PoolFactory & setFreeConnectionTimeout(std::chrono::milliseconds connectionTimeout)
Sets the free connection timeout for this pool.
PoolFactory & setPingInterval(std::chrono::milliseconds pingInterval)
The frequency with which servers must be pinged to verify that they are still alive.
static const std::chrono::milliseconds DEFAULT_STATISTIC_INTERVAL
The default frequency that client statistics are sent to the server.
Definition: PoolFactory.hpp:140
static const std::chrono::milliseconds DEFAULT_LOAD_CONDITIONING_INTERVAL
The default interval in which the pool will check to see if a connection to a given server should be ...
Definition: PoolFactory.hpp:83
PoolFactory & setMaxConnections(int maxConnections)
Sets the max number of client to server connections that the pool will create.
PoolFactory & setServerGroup(std::string group)
Configures the group which contains all the servers that this pool connects to.
PoolFactory & setUpdateLocatorListInterval(std::chrono::milliseconds updateLocatorListInterval)
The frequency with which client updates the locator list.
PoolFactory & setMultiuserAuthentication(bool multiuserAuthentication)
Sets whether Pool is in multi user secure mode.
PoolFactory & setPRSingleHopEnabled(bool enabled)
By default setPRSingleHopEnabled is true.
static const std::chrono::milliseconds DEFAULT_SUBSCRIPTION_ACK_INTERVAL
The default amount of time to wait before sending an acknowledgement to the server about events recei...
Definition: PoolFactory.hpp:169
static const std::chrono::milliseconds DEFAULT_PING_INTERVAL
The default frequency, to ping servers.
Definition: PoolFactory.hpp:127
PoolFactory & setMinConnections(int minConnections)
Sets the minimum number of connections to keep available at all times.
PoolFactory & setSniProxy(std::string hostname, uint16_t port)
Set proxy info for SNI connection.
static const std::chrono::milliseconds DEFAULT_FREE_CONNECTION_TIMEOUT
The default amount of time which we will wait for a free connection if max connections is set and all...
Definition: PoolFactory.hpp:75
std::shared_ptr< Pool > create(std::string name)
Creates a new Pool for connecting a client to a set of Geode Cache Servers.
Manages creation and access to connection pools for clients.
Definition: PoolManager.hpp:61