VMware Tanzu GemFire Native C++ Reference  10.1.5
SystemProperties.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_SYSTEMPROPERTIES_H_
21 #define GEODE_SYSTEMPROPERTIES_H_
22 
23 #include "Properties.hpp"
24 #include "util/LogLevel.hpp"
25 
29 namespace apache {
30 namespace geode {
31 namespace client {
32 
44 class APACHE_GEODE_EXPORT SystemProperties {
45  public:
54  explicit SystemProperties(const std::shared_ptr<Properties>& propertiesPtr,
55  const std::string& configFile = "");
56 
57  SystemProperties(const SystemProperties& rhs) = delete;
58  void operator=(const SystemProperties& rhs) = delete;
59 
64 
66  void logSettings();
67 
68  uint32_t threadPoolSize() const { return m_threadPoolSize; }
69 
74  const std::chrono::milliseconds statisticsSampleInterval() const {
75  return m_statisticsSampleInterval;
76  }
77 
81  bool statisticsEnabled() const { return m_statisticsEnabled; }
82 
86  bool sslEnabled() const { return m_sslEnabled; }
87 
91  bool getEnableTimeStatistics() const /*timestatisticsEnabled()*/
92  {
93  return m_timestatisticsEnabled;
94  } /*m_timestatisticsEnabled*/
95 
99  const std::string& sslKeyStore() const { return m_sslKeyStore; }
100 
104  const std::string& sslKeystorePassword() const {
105  return m_sslKeystorePassword;
106  }
107 
111  const std::string& sslTrustStore() const { return m_sslTrustStore; }
112 
117  const std::string& statisticsArchiveFile() const {
118  return m_statisticsArchiveFile;
119  }
120 
125  const std::string& logFilename() const { return m_logFilename; }
126 
130  LogLevel logLevel() const { return m_logLevel; }
131 
141  bool heapLRULimitEnabled() const { return (m_heapLRULimit > 0); }
142 
150  size_t heapLRULimit() const { return m_heapLRULimit; }
151 
157  int32_t heapLRUDelta() const { return m_heapLRUDelta; }
158 
162  int32_t maxSocketBufferSize() const { return m_maxSocketBufferSize; }
163 
167  const std::chrono::seconds& pingInterval() const { return m_pingInterval; }
168 
172  const std::chrono::seconds& redundancyMonitorInterval() const {
173  return m_redundancyMonitorInterval;
174  }
175 
179  const std::chrono::milliseconds& notifyAckInterval() const {
180  return m_notifyAckInterval;
181  }
182 
187  const std::chrono::milliseconds& notifyDupCheckLife() const {
188  return m_notifyDupCheckLife;
189  }
190 
194  const std::string& durableClientId() const { return m_durableClientId; }
195 
199  const std::chrono::seconds& durableTimeout() const {
200  return m_durableTimeout;
201  }
202 
206  const std::chrono::milliseconds& connectTimeout() const {
207  return m_connectTimeout;
208  }
209 
214  const std::chrono::milliseconds& connectWaitTimeout() const {
215  return m_connectWaitTimeout;
216  }
217 
222  const std::chrono::milliseconds& bucketWaitTimeout() const {
223  return m_bucketWaitTimeout;
224  }
225 
229  const std::string& conflateEvents() const { return m_conflateEvents; }
230 
231  const std::string& name() const { return m_name; }
232 
233  const std::string& cacheXMLFile() const { return m_cacheXMLFile; }
234 
238  uint32_t logFileSizeLimit() const { return m_logFileSizeLimit; }
239 
243  uint32_t logDiskSpaceLimit() const { return m_logDiskSpaceLimit; }
244 
248  uint32_t statsFileSizeLimit() const { return m_statsFileSizeLimit; }
249 
253  uint32_t statsDiskSpaceLimit() const { return m_statsDiskSpaceLimit; }
254 
255  uint32_t connectionPoolSize() const { return m_connectionPoolSize; }
256  void setjavaConnectionPoolSize(uint32_t size) { m_connectionPoolSize = size; }
257 
261  bool enableChunkHandlerThread() const { return m_enableChunkHandlerThread; }
262 
267  m_enableChunkHandlerThread = set;
268  }
269 
275  return m_onClientDisconnectClearPdxTypeIds;
276  }
277 
283  m_onClientDisconnectClearPdxTypeIds = set;
284  }
285 
290  _GEODE_DEPRECATED_(
291  "Diffie-Hellman based credentials encryption is not supported.")
292  const std::string& securityClientDhAlgo() const {
293  return m_securityClientDhAlgo;
294  }
295 
297  const std::string& securityClientKsPath() const {
298  return m_securityClientKsPath;
299  }
300 
304  std::shared_ptr<Properties> getSecurityProperties() const {
305  return m_securityPropertiesPtr;
306  }
307 
311  inline bool isEndpointShufflingDisabled() const {
312  return m_disableShufflingEndpoint;
313  }
314 
319  _GEODE_DEPRECATED_(
320  "Diffie-Hellman based credentials encryption is not supported.")
321  bool isDhOn() const { return false; }
322 
332  inline bool autoReadyForEvents() const { return m_autoReadyForEvents; }
333 
337  const std::chrono::seconds suspendedTxTimeout() const {
338  return m_suspendedTxTimeout;
339  }
340 
344  const std::chrono::milliseconds tombstoneTimeout() const {
345  return m_tombstoneTimeout;
346  }
347 
348  private:
349  std::chrono::milliseconds m_statisticsSampleInterval;
350 
352 
353  std::string m_statisticsArchiveFile;
354 
355  std::string m_logFilename;
356 
357  LogLevel m_logLevel;
358 
359  int m_sessions;
360 
361  std::string m_name;
362 
363  bool m_disableShufflingEndpoint;
364 
365  std::string m_cacheXMLFile;
366 
367  uint32_t m_logFileSizeLimit;
368  uint32_t m_logDiskSpaceLimit;
369 
370  uint32_t m_statsFileSizeLimit;
371  uint32_t m_statsDiskSpaceLimit;
372 
373  uint32_t m_connectionPoolSize;
374 
375  int32_t m_heapLRULimit;
376  int32_t m_heapLRUDelta;
377  int32_t m_maxSocketBufferSize;
378  std::chrono::seconds m_pingInterval;
379  std::chrono::seconds m_redundancyMonitorInterval;
380 
381  std::chrono::milliseconds m_notifyAckInterval;
382  std::chrono::milliseconds m_notifyDupCheckLife;
383 
384  std::shared_ptr<Properties> m_securityPropertiesPtr;
385 
386  std::string m_securityClientDhAlgo;
387  std::string m_securityClientKsPath;
388 
389  std::string m_durableClientId;
390  std::chrono::seconds m_durableTimeout;
391 
392  std::chrono::milliseconds m_connectTimeout;
393  std::chrono::milliseconds m_connectWaitTimeout;
394  std::chrono::milliseconds m_bucketWaitTimeout;
395 
396  bool m_autoReadyForEvents;
397 
398  bool m_sslEnabled;
399  bool m_timestatisticsEnabled;
400  std::string m_sslKeyStore;
401  std::string m_sslTrustStore;
402 
403  std::string m_sslKeystorePassword;
404 
405  std::string m_conflateEvents;
406 
407  uint32_t m_threadPoolSize;
408  std::chrono::seconds m_suspendedTxTimeout;
409  std::chrono::milliseconds m_tombstoneTimeout;
410  bool m_enableChunkHandlerThread;
411  bool m_onClientDisconnectClearPdxTypeIds;
412 
417  void processProperty(const std::string& property, const std::string& value);
418  static bool parseBooleanProperty(const std::string& property,
419  const std::string& value);
420  template <class _Rep, class _Period>
421  static void parseDurationProperty(
422  const std::string& property, const std::string& value,
423  std::chrono::duration<_Rep, _Period>& duration);
424 
425  [[noreturn]] static void throwError(const std::string& msg);
426 
427  public:
428  friend class DistributedSystemImpl;
429 };
430 } // namespace client
431 } // namespace geode
432 } // namespace apache
433 
434 #endif // GEODE_SYSTEMPROPERTIES_H_
apache::geode::client::SystemProperties::heapLRULimitEnabled
bool heapLRULimitEnabled() const
Returns a boolean that specifies if heapLRULimit has been enabled for the process.
Definition: SystemProperties.hpp:141
apache::geode::client::SystemProperties::durableClientId
const std::string & durableClientId() const
Returns the durable client ID.
Definition: SystemProperties.hpp:194
apache::geode::client::SystemProperties::setEnableChunkHandlerThread
void setEnableChunkHandlerThread(bool set)
Enables or disables the chunk handler thread.
Definition: SystemProperties.hpp:266
apache::geode::client::SystemProperties::connectWaitTimeout
const std::chrono::milliseconds & connectWaitTimeout() const
Returns the connect wait timeout(in milliseconds) used for to connect to server This is only applicab...
Definition: SystemProperties.hpp:214
apache::geode::client::SystemProperties::logFilename
const std::string & logFilename() const
Returns the name of the filename into which logging would be done.
Definition: SystemProperties.hpp:125
apache::geode::client::SystemProperties::sslTrustStore
const std::string & sslTrustStore() const
Returns the path of the public key file for SSL use.
Definition: SystemProperties.hpp:111
apache::geode::client::SystemProperties::processProperty
void processProperty(const std::string &property, const std::string &value)
Processes the given property/value pair, saving the results internally:
apache::geode::client::SystemProperties::SystemProperties
SystemProperties(const std::shared_ptr< Properties > &propertiesPtr, const std::string &configFile="")
Constructor.
apache::geode::client::SystemProperties::sslKeyStore
const std::string & sslKeyStore() const
Returns the path of the private key file for SSL use.
Definition: SystemProperties.hpp:99
apache::geode::client::SystemProperties::bucketWaitTimeout
const std::chrono::milliseconds & bucketWaitTimeout() const
Returns the connect wait timeout(in milliseconds) used for to connect to server This is only applicab...
Definition: SystemProperties.hpp:222
apache::geode::client::SystemProperties::statisticsEnabled
bool statisticsEnabled() const
Tells whether statistics needs to be archived or not.
Definition: SystemProperties.hpp:81
apache::geode::client::SystemProperties::maxSocketBufferSize
int32_t maxSocketBufferSize() const
Returns the maximum socket buffer size to use.
Definition: SystemProperties.hpp:162
apache::geode::client::SystemProperties
The SystemProperties class.
Definition: SystemProperties.hpp:44
apache::geode::client::SystemProperties::logSettings
void logSettings()
print all settings to the process log.
apache::geode::client::SystemProperties::statisticsArchiveFile
const std::string & statisticsArchiveFile() const
Returns the name of the filename into which statistics would be archived.
Definition: SystemProperties.hpp:117
apache::geode::client::SystemProperties::enableChunkHandlerThread
bool enableChunkHandlerThread() const
Returns true if chunk handler thread is enabled, false if not.
Definition: SystemProperties.hpp:261
apache::geode::client::SystemProperties::pingInterval
const std::chrono::seconds & pingInterval() const
Returns the time between two consecutive pings to servers.
Definition: SystemProperties.hpp:167
apache::geode::client::SystemProperties::connectTimeout
const std::chrono::milliseconds & connectTimeout() const
Returns the connect timeout used for server and locator handshakes.
Definition: SystemProperties.hpp:206
apache::geode::client::SystemProperties::logLevel
LogLevel logLevel() const
Returns the log level at which logging would be done.
Definition: SystemProperties.hpp:130
apache::geode::client::SystemProperties::redundancyMonitorInterval
const std::chrono::seconds & redundancyMonitorInterval() const
Returns the time between two consecutive checks for redundancy for HA.
Definition: SystemProperties.hpp:172
apache::geode::client::SystemProperties::~SystemProperties
~SystemProperties()
Destructor.
apache::geode::client::SystemProperties::setOnClientDisconnectClearPdxTypeIds
void setOnClientDisconnectClearPdxTypeIds(bool set)
Set to true if app wants to clear pdx type ids when client disconnect.
Definition: SystemProperties.hpp:282
apache::geode::client::SystemProperties::notifyAckInterval
const std::chrono::milliseconds & notifyAckInterval() const
Returns the periodic notify ack interval.
Definition: SystemProperties.hpp:179
apache::geode::client::SystemProperties::durableTimeout
const std::chrono::seconds & durableTimeout() const
Returns the durable timeout.
Definition: SystemProperties.hpp:199
apache::geode::client::SystemProperties::onClientDisconnectClearPdxTypeIds
bool onClientDisconnectClearPdxTypeIds() const
Returns true if app wants to clear pdx type ids when client disconnect.
Definition: SystemProperties.hpp:274
apache::geode::client::SystemProperties::logFileSizeLimit
uint32_t logFileSizeLimit() const
Returns the log-file-size-limit.
Definition: SystemProperties.hpp:238
apache::geode::client::SystemProperties::sslKeystorePassword
const std::string & sslKeystorePassword() const
Returns the client keystore password.
Definition: SystemProperties.hpp:104
apache::geode::client::SystemProperties::heapLRUDelta
int32_t heapLRUDelta() const
Returns the HeapLRUDelta value (a percent value).
Definition: SystemProperties.hpp:157
apache::geode::client::SystemProperties::conflateEvents
const std::string & conflateEvents() const
Returns client Queueconflation option.
Definition: SystemProperties.hpp:229
apache::geode::client::SystemProperties::heapLRULimit
size_t heapLRULimit() const
Returns the HeapLRULimit value (in bytes), the maximum memory that values in a cache can use to store...
Definition: SystemProperties.hpp:150
apache::geode::client::SystemProperties::sslEnabled
bool sslEnabled() const
Whether SSL is enabled for socket connections.
Definition: SystemProperties.hpp:86
apache::geode::client::SystemProperties::statisticsSampleInterval
const std::chrono::milliseconds statisticsSampleInterval() const
Returns the sampling interval of the sampling thread.
Definition: SystemProperties.hpp:74
apache::geode::client::SystemProperties::m_statisticsEnabled
_GEODE_DEPRECATED_("Diffie-Hellman based credentials encryption is not supported.") const std bool m_statisticsEnabled
Return the keystore (.pem file ) path.
Definition: SystemProperties.hpp:290
apache::geode::client::SystemProperties::logDiskSpaceLimit
uint32_t logDiskSpaceLimit() const
Returns the log-disk-space-limit.
Definition: SystemProperties.hpp:243
apache::geode::client::SystemProperties::getEnableTimeStatistics
bool getEnableTimeStatistics() const
Whether time stats are enabled for the statistics.
Definition: SystemProperties.hpp:91
apache::geode::client::SystemProperties::statsFileSizeLimit
uint32_t statsFileSizeLimit() const
Returns the stat-file-space-limit.
Definition: SystemProperties.hpp:248
apache::geode::client::SystemProperties::notifyDupCheckLife
const std::chrono::milliseconds & notifyDupCheckLife() const
Returns the expiry time of an idle event id map entry for duplicate notification checking.
Definition: SystemProperties.hpp:187
Properties.hpp
apache::geode::client::SystemProperties::statsDiskSpaceLimit
uint32_t statsDiskSpaceLimit() const
Returns the stat-disk-size-limit.
Definition: SystemProperties.hpp:253

Apache Geode C++ Cache API Documentation