Pivotal GemFire Native C++ Reference  10.1.3
Pool.hpp
Go to the documentation of this file.
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 
38 namespace apache {
39 namespace geode {
40 namespace client {
41 
42 class AuthenticatedView;
43 class Cache;
44 class CacheFactory;
45 class PoolAttributes;
46 class CacheImpl;
47 class Properties;
48 class QueryService;
49 
63 class APACHE_GEODE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
64  public:
71  virtual const std::string& getName() const = 0;
72 
77  std::chrono::milliseconds getFreeConnectionTimeout() const;
78 
83  std::chrono::milliseconds getLoadConditioningInterval() const;
84 
89  int getSocketBufferSize() const;
90 
95  std::chrono::milliseconds getReadTimeout() const;
96 
101  int getMinConnections() const;
102 
107  int getMaxConnections() const;
108 
113  std::chrono::milliseconds getIdleTimeout() const;
114 
119  std::chrono::milliseconds getPingInterval() const;
120 
125  std::chrono::milliseconds getUpdateLocatorListInterval() const;
126 
131  std::chrono::milliseconds getStatisticInterval() const;
132 
137  int getRetryAttempts() const;
138 
144  bool getSubscriptionEnabled() const;
145 
150  int getSubscriptionRedundancy() const;
151 
156  std::chrono::milliseconds getSubscriptionMessageTrackingTimeout() const;
157 
162  std::chrono::milliseconds getSubscriptionAckInterval() const;
163 
168  const std::string& getServerGroup() const;
169 
175  bool getThreadLocalConnections() const;
176 
182  bool getMultiuserAuthentication() const;
183 
188  bool getPRSingleHopEnabled() const;
189 
198  virtual void releaseThreadLocalConnection() = 0;
199 
208  virtual const std::shared_ptr<CacheableStringArray> getLocators() const = 0;
209 
217  virtual const std::shared_ptr<CacheableStringArray> getServers() = 0;
218 
227  virtual void destroy(bool keepAlive = false) = 0;
228 
235  virtual bool isDestroyed() const = 0;
236 
248  virtual std::shared_ptr<QueryService> getQueryService() = 0;
249 
250  virtual ~Pool();
251 
284  int getPendingEventCount() const;
285 
286  protected:
287  explicit Pool(std::shared_ptr<PoolAttributes> attr);
288  std::shared_ptr<PoolAttributes> m_attrs;
289 
290  private:
301  virtual AuthenticatedView createAuthenticatedView(
302  std::shared_ptr<Properties> credentials, CacheImpl* cacheImpl);
303 
304  Pool(const Pool&);
305 
306  friend class PoolFactory;
307  friend class CacheFactory;
308  friend class CacheImpl;
309 };
310 
311 } // namespace client
312 } // namespace geode
313 } // namespace apache
314 
315 #endif // GEODE_POOL_H_
apache::geode::client::AuthenticatedView
Creates an authenticated cache view to allow credential based access to region services.
Definition: AuthenticatedView.hpp:46
apache::geode::client::Pool
A pool of connections to connect from a client to a set of Geode Cache Servers.
Definition: Pool.hpp:63
CacheableBuiltins.hpp
Contains generic template definitions for Cacheable types and instantiations for built-in types.
CacheFactory.hpp
apache::geode::client::PoolFactory
This interface provides for the configuration and creation of instances of Pool.
Definition: PoolFactory.hpp:68
apache::geode::client::CacheFactory
Definition: CacheFactory.hpp:48
Cache.hpp

Apache Geode C++ Cache API Documentation