VMware VMware GemFire Native C++ Reference 10.4.3
Loading...
Searching...
No Matches
Pool.hpp
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#ifndef GEODE_POOL_H_
21#define GEODE_POOL_H_
22
23#include <chrono>
24#include <iosfwd>
25#include <memory>
26
27#include "Cache.hpp"
28#include "CacheFactory.hpp"
29#include "CacheableBuiltins.hpp"
30#include "internal/chrono/duration.hpp"
31#include "internal/geode_base.hpp"
32#include "internal/geode_globals.hpp"
33
34namespace apache {
35namespace geode {
36namespace client {
37
38class AuthenticatedView;
39class Cache;
40class CacheFactory;
41class PoolAttributes;
42class CacheImpl;
43class Properties;
44class QueryService;
45
59class APACHE_GEODE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
60 public:
67 virtual const std::string& getName() const = 0;
68
73 std::chrono::milliseconds getFreeConnectionTimeout() const;
74
79 std::chrono::milliseconds getLoadConditioningInterval() const;
80
86
91 std::chrono::milliseconds getReadTimeout() const;
92
97 const std::string& getSniProxyHost() const;
98
103 uint16_t getSniProxyPort() const;
104
109 int getMinConnections() const;
110
115 int getMaxConnections() const;
116
121 std::chrono::milliseconds getIdleTimeout() const;
122
127 std::chrono::milliseconds getPingInterval() const;
128
133 std::chrono::milliseconds getUpdateLocatorListInterval() const;
134
139 std::chrono::milliseconds getStatisticInterval() const;
140
145 int getRetryAttempts() const;
146
153
159
164 std::chrono::milliseconds getSubscriptionMessageTrackingTimeout() const;
165
170 std::chrono::milliseconds getSubscriptionAckInterval() const;
171
176 const std::string& getServerGroup() const;
177
184
191
197
207
216 virtual const std::shared_ptr<CacheableStringArray> getLocators() const = 0;
217
225 virtual const std::shared_ptr<CacheableStringArray> getServers() = 0;
226
235 virtual void destroy(bool keepAlive = false) = 0;
236
243 virtual bool isDestroyed() const = 0;
244
256 virtual std::shared_ptr<QueryService> getQueryService() = 0;
257
258 virtual ~Pool();
259
293
294 protected:
295 explicit Pool(std::shared_ptr<PoolAttributes> attr);
296 std::shared_ptr<PoolAttributes> m_attrs;
297
298 private:
309 virtual AuthenticatedView createAuthenticatedView(
310 std::shared_ptr<Properties> credentials, CacheImpl* cacheImpl);
311
312 Pool(const Pool&);
313
314 friend class PoolFactory;
315 friend class CacheFactory;
316 friend class CacheImpl;
317};
318
319} // namespace client
320} // namespace geode
321} // namespace apache
322
323#endif // GEODE_POOL_H_
Contains generic template definitions for Cacheable types and instantiations for built-in types.
Creates an authenticated cache view to allow credential based access to region services.
Definition AuthenticatedView.hpp:46
Top level class for configuring and using Geode on a client.This should be called once to create Cach...
Definition CacheFactory.hpp:48
A pool of connections to connect from a client to a set of Geode Cache Servers.
Definition Pool.hpp:59
int getRetryAttempts() const
Gets the retry attempts for this pool.
std::chrono::milliseconds getReadTimeout() const
Returns the read timeout of this pool.
bool getSubscriptionEnabled() const
Returns the true if a server-to-client subscriptions are enabled on this pool.
std::chrono::milliseconds getPingInterval() const
Gets the ping interval for this pool.
std::chrono::milliseconds getSubscriptionMessageTrackingTimeout() const
Returns the subscription message tracking timeout of this pool.
virtual const std::shared_ptr< CacheableStringArray > getServers()=0
Returns an unmodifiable list of servers this pool is using.
uint16_t getSniProxyPort() const
Gets the port of the SniProxy.
std::chrono::milliseconds getIdleTimeout() const
Gets the idle connection timeout for this pool.
const std::string & getSniProxyHost() const
Gets the host name of the SniProxy.
std::chrono::milliseconds getFreeConnectionTimeout() const
Returns the connection timeout of this pool.
bool getMultiuserAuthentication() const
Returns true if multiuser authentication is enabled on this pool.
virtual const std::string & getName() const =0
Gets the name of the connection pool.
virtual void releaseThreadLocalConnection()=0
If this pool was configured to use threadlocalconnections, then this method will release the connecti...
std::chrono::milliseconds getStatisticInterval() const
Gets the statistic interval for this pool.
int getSubscriptionRedundancy() const
Returns the subscription redundancy level of this pool.
virtual void destroy(bool keepAlive=false)=0
Destroys this pool closing any connections it produced.
const std::string & getServerGroup() const
Returns the server group of this pool.
bool getPRSingleHopEnabled() const
Returns true if single-hop optimization is enabled on this pool.
int getPendingEventCount() const
Returns the approximate number of pending subscription events maintained at server for this durable c...
int getSocketBufferSize() const
Returns the socket buffer size of this pool.
std::chrono::milliseconds getLoadConditioningInterval() const
Returns the load conditioning interval of this pool.
int getMaxConnections() const
Gets the maximum connections for this pool.
virtual const std::shared_ptr< CacheableStringArray > getLocators() const =0
Returns an unmodifiable list locators that this pool is using.
std::chrono::milliseconds getSubscriptionAckInterval() const
Returns the subscription ack interval of this pool.
std::chrono::milliseconds getUpdateLocatorListInterval() const
Gets the update locator list interval for this pool.
int getMinConnections() const
Gets the minimum connections for this pool.
virtual std::shared_ptr< QueryService > getQueryService()=0
Returns the QueryService for this Pool.
bool getThreadLocalConnections() const
Returns true if thread local connections are enabled on this pool.
virtual bool isDestroyed() const =0
Indicates whether this Pool has been destroyed.
This interface provides for the configuration and creation of instances of Pool.
Definition PoolFactory.hpp:68

Apache Geode C++ Cache API Documentation