VMware Tanzu GemFire Native C++ Reference 10.3.0
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
29namespace apache {
30namespace geode {
31namespace client {
32
44class 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
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 { return m_timestatisticsEnabled; }
92
96 const std::string& sslKeyStore() const { return m_sslKeyStore; }
97
101 const std::string& sslKeystorePassword() const {
102 return m_sslKeystorePassword;
103 }
104
108 const std::string& sslTrustStore() const { return m_sslTrustStore; }
109
114 const std::string& statisticsArchiveFile() const {
115 return m_statisticsArchiveFile;
116 }
117
122 const std::string& logFilename() const { return m_logFilename; }
123
127 LogLevel logLevel() const { return m_logLevel; }
128
132 void setLogLevel(LogLevel newLogLevel) { m_logLevel = newLogLevel; }
133
143 bool heapLRULimitEnabled() const { return (m_heapLRULimit > 0); }
144
152 size_t heapLRULimit() const { return m_heapLRULimit; }
153
159 int32_t heapLRUDelta() const { return m_heapLRUDelta; }
160
164 int32_t maxSocketBufferSize() const { return m_maxSocketBufferSize; }
165
169 const std::chrono::seconds& pingInterval() const { return m_pingInterval; }
170
174 const std::chrono::seconds& redundancyMonitorInterval() const {
175 return m_redundancyMonitorInterval;
176 }
177
181 const std::chrono::milliseconds& notifyAckInterval() const {
182 return m_notifyAckInterval;
183 }
184
189 const std::chrono::milliseconds& notifyDupCheckLife() const {
190 return m_notifyDupCheckLife;
191 }
192
196 const std::string& durableClientId() const { return m_durableClientId; }
197
201 const std::chrono::seconds& durableTimeout() const {
202 return m_durableTimeout;
203 }
204
208 const std::chrono::milliseconds& connectTimeout() const {
209 return m_connectTimeout;
210 }
211
216 const std::chrono::milliseconds& connectWaitTimeout() const {
217 return m_connectWaitTimeout;
218 }
219
224 const std::chrono::milliseconds& bucketWaitTimeout() const {
225 return m_bucketWaitTimeout;
226 }
227
231 const std::string& conflateEvents() const { return m_conflateEvents; }
232
233 const std::string& name() const { return m_name; }
234
235 const std::string& cacheXMLFile() const { return m_cacheXMLFile; }
236
240 uint32_t logFileSizeLimit() const { return m_logFileSizeLimit; }
241
245 uint32_t logDiskSpaceLimit() const { return m_logDiskSpaceLimit; }
246
250 uint32_t statsFileSizeLimit() const { return m_statsFileSizeLimit; }
251
255 uint32_t statsDiskSpaceLimit() const { return m_statsDiskSpaceLimit; }
256
257 uint32_t connectionPoolSize() const { return m_connectionPoolSize; }
258 void setjavaConnectionPoolSize(uint32_t size) { m_connectionPoolSize = size; }
259
263 bool enableChunkHandlerThread() const { return m_enableChunkHandlerThread; }
264
269 m_enableChunkHandlerThread = set;
270 }
271
277 return m_onClientDisconnectClearPdxTypeIds;
278 }
279
285 m_onClientDisconnectClearPdxTypeIds = set;
286 }
287
292 _GEODE_DEPRECATED_(
293 "Diffie-Hellman based credentials encryption is not supported.")
294 const std::string& securityClientDhAlgo() const {
295 return m_securityClientDhAlgo;
296 }
297
299 const std::string& securityClientKsPath() const {
300 return m_securityClientKsPath;
301 }
302
306 std::shared_ptr<Properties> getSecurityProperties() const {
307 return m_securityPropertiesPtr;
308 }
309
313 inline bool isEndpointShufflingDisabled() const {
314 return m_disableShufflingEndpoint;
315 }
316
321 _GEODE_DEPRECATED_(
322 "Diffie-Hellman based credentials encryption is not supported.")
323 bool isDhOn() const { return false; }
324
334 inline bool autoReadyForEvents() const { return m_autoReadyForEvents; }
335
339 const std::chrono::seconds suspendedTxTimeout() const {
340 return m_suspendedTxTimeout;
341 }
342
346 const std::chrono::milliseconds tombstoneTimeout() const {
347 return m_tombstoneTimeout;
348 }
349
350 private:
351 std::chrono::milliseconds m_statisticsSampleInterval;
352
354
355 std::string m_statisticsArchiveFile;
356
357 std::string m_logFilename;
358
359 LogLevel m_logLevel;
360
361 int m_sessions;
362
363 std::string m_name;
364
365 bool m_disableShufflingEndpoint;
366
367 std::string m_cacheXMLFile;
368
369 uint32_t m_logFileSizeLimit;
370 uint32_t m_logDiskSpaceLimit;
371
372 uint32_t m_statsFileSizeLimit;
373 uint32_t m_statsDiskSpaceLimit;
374
375 uint32_t m_connectionPoolSize;
376
377 int32_t m_heapLRULimit;
378 int32_t m_heapLRUDelta;
379 int32_t m_maxSocketBufferSize;
380 std::chrono::seconds m_pingInterval;
381 std::chrono::seconds m_redundancyMonitorInterval;
382
383 std::chrono::milliseconds m_notifyAckInterval;
384 std::chrono::milliseconds m_notifyDupCheckLife;
385
386 std::shared_ptr<Properties> m_securityPropertiesPtr;
387
388 std::string m_securityClientDhAlgo;
389 std::string m_securityClientKsPath;
390
391 std::string m_durableClientId;
392 std::chrono::seconds m_durableTimeout;
393
394 std::chrono::milliseconds m_connectTimeout;
395 std::chrono::milliseconds m_connectWaitTimeout;
396 std::chrono::milliseconds m_bucketWaitTimeout;
397
398 bool m_autoReadyForEvents;
399
400 bool m_sslEnabled;
401 bool m_timestatisticsEnabled;
402 std::string m_sslKeyStore;
403 std::string m_sslTrustStore;
404
405 std::string m_sslKeystorePassword;
406
407 std::string m_conflateEvents;
408
409 uint32_t m_threadPoolSize;
410 std::chrono::seconds m_suspendedTxTimeout;
411 std::chrono::milliseconds m_tombstoneTimeout;
412 bool m_enableChunkHandlerThread;
413 bool m_onClientDisconnectClearPdxTypeIds;
414
419 void processProperty(const std::string& property, const std::string& value);
420 static bool parseBooleanProperty(const std::string& property,
421 const std::string& value);
422 template <class _Rep, class _Period>
423 static void parseDurationProperty(
424 const std::string& property, const std::string& value,
425 std::chrono::duration<_Rep, _Period>& duration);
426
427 [[noreturn]] static void throwError(const std::string& msg);
428
429 public:
430 friend class DistributedSystemImpl;
431};
432} // namespace client
433} // namespace geode
434} // namespace apache
435
436#endif // GEODE_SYSTEMPROPERTIES_H_
The SystemProperties class.
Definition: SystemProperties.hpp:44
const std::string & logFilename() const
Returns the name of the filename into which logging would be done.
Definition: SystemProperties.hpp:122
_GEODE_DEPRECATED_("Diffie-Hellman based credentials encryption is not supported.") const std bool m_statisticsEnabled
Return the keystore (.pem file ) path.
Definition: SystemProperties.hpp:292
const std::chrono::milliseconds & notifyDupCheckLife() const
Returns the expiry time of an idle event id map entry for duplicate notification checking.
Definition: SystemProperties.hpp:189
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:152
const std::chrono::seconds & redundancyMonitorInterval() const
Returns the time between two consecutive checks for redundancy for HA.
Definition: SystemProperties.hpp:174
uint32_t logFileSizeLimit() const
Returns the log-file-size-limit.
Definition: SystemProperties.hpp:240
SystemProperties(const std::shared_ptr< Properties > &propertiesPtr, const std::string &configFile="")
Constructor.
bool onClientDisconnectClearPdxTypeIds() const
Returns true if app wants to clear pdx type ids when client disconnect.
Definition: SystemProperties.hpp:276
bool sslEnabled() const
Whether SSL is enabled for socket connections.
Definition: SystemProperties.hpp:86
bool heapLRULimitEnabled() const
Returns a boolean that specifies if heapLRULimit has been enabled for the process.
Definition: SystemProperties.hpp:143
const std::string & conflateEvents() const
Returns client Queueconflation option.
Definition: SystemProperties.hpp:231
const std::chrono::milliseconds statisticsSampleInterval() const
Returns the sampling interval of the sampling thread.
Definition: SystemProperties.hpp:74
const std::chrono::milliseconds & connectTimeout() const
Returns the connect timeout used for server and locator handshakes.
Definition: SystemProperties.hpp:208
uint32_t statsFileSizeLimit() const
Returns the stat-file-space-limit.
Definition: SystemProperties.hpp:250
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:216
void setLogLevel(LogLevel newLogLevel)
Changes the current log level to newLogLevel.
Definition: SystemProperties.hpp:132
const std::chrono::seconds & durableTimeout() const
Returns the durable timeout.
Definition: SystemProperties.hpp:201
const std::chrono::seconds & pingInterval() const
Returns the time between two consecutive pings to servers.
Definition: SystemProperties.hpp:169
const std::string & sslKeyStore() const
Returns the path of the private key file for SSL use.
Definition: SystemProperties.hpp:96
uint32_t logDiskSpaceLimit() const
Returns the log-disk-space-limit.
Definition: SystemProperties.hpp:245
bool statisticsEnabled() const
Tells whether statistics needs to be archived or not.
Definition: SystemProperties.hpp:81
const std::string & statisticsArchiveFile() const
Returns the name of the filename into which statistics would be archived.
Definition: SystemProperties.hpp:114
bool enableChunkHandlerThread() const
Returns true if chunk handler thread is enabled, false if not.
Definition: SystemProperties.hpp:263
int32_t heapLRUDelta() const
Returns the HeapLRUDelta value (a percent value).
Definition: SystemProperties.hpp:159
const std::chrono::milliseconds & notifyAckInterval() const
Returns the periodic notify ack interval.
Definition: SystemProperties.hpp:181
void processProperty(const std::string &property, const std::string &value)
Processes the given property/value pair, saving the results internally:
void setOnClientDisconnectClearPdxTypeIds(bool set)
Set to true if app wants to clear pdx type ids when client disconnect.
Definition: SystemProperties.hpp:284
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:224
const std::string & durableClientId() const
Returns the durable client ID.
Definition: SystemProperties.hpp:196
LogLevel logLevel() const
Returns the log level at which logging would be done.
Definition: SystemProperties.hpp:127
uint32_t statsDiskSpaceLimit() const
Returns the stat-disk-size-limit.
Definition: SystemProperties.hpp:255
bool getEnableTimeStatistics() const
Whether time stats are enabled for the statistics.
Definition: SystemProperties.hpp:91
const std::string & sslKeystorePassword() const
Returns the client keystore password.
Definition: SystemProperties.hpp:101
const std::string & sslTrustStore() const
Returns the path of the public key file for SSL use.
Definition: SystemProperties.hpp:108
void logSettings()
print all settings to the process log.
int32_t maxSocketBufferSize() const
Returns the maximum socket buffer size to use.
Definition: SystemProperties.hpp:164
void setEnableChunkHandlerThread(bool set)
Enables or disables the chunk handler thread.
Definition: SystemProperties.hpp:268

Apache Geode C++ Cache API Documentation