20#ifndef GEODE_REGIONATTRIBUTES_H_
21#define GEODE_REGIONATTRIBUTES_H_
31#include "CacheWriter.hpp"
34#include "PartitionResolver.hpp"
36#include "Serializable.hpp"
37#include "internal/DataSerializableInternal.hpp"
38#include "internal/chrono/duration.hpp"
39#include "internal/geode_globals.hpp"
46class RegionAttributesFactory;
47class AttributesMutator;
50class PersistenceManager;
77 :
public internal::DataSerializableInternal {
211 const std::
string& getCacheLoaderLibrary() const;
217 const std::
string& getCacheLoaderFactory() const;
223 const std::
string& getCacheListenerLibrary() const;
229 const std::
string& getCacheListenerFactory() const;
235 const std::
string& getCacheWriterLibrary() const;
241 const std::
string& getCacheWriterFactory() const;
247 const std::
string& getPartitionResolverLibrary() const;
253 const std::
string& getPartitionResolverFactory() const;
266 void validateSerializableAttributes();
271 const std::
string& getEndpoints() const;
276 bool getClientNotificationEnabled() const;
282 const std::
string& getPersistenceLibrary() const;
288 const std::
string& getPersistenceFactory() const;
293 std::shared_ptr<
Properties> getPersistenceProperties() const;
303 bool getCloningEnabled()
const {
return m_isClonable; }
311 return m_isConcurrencyChecksEnabled;
316 void setCacheListener(
const std::string& libpath,
317 const std::string& factoryFuncName);
318 void setCacheLoader(
const std::string& libpath,
319 const std::string& factoryFuncName);
320 void setCacheWriter(
const std::string& libpath,
321 const std::string& factoryFuncName);
322 void setPartitionResolver(
const std::string& libpath,
323 const std::string& factoryFuncName);
324 void setPersistenceManager(
const std::string& lib,
const std::string& func,
325 const std::shared_ptr<Properties>& config);
326 void setEndpoints(
const std::string& endpoints);
327 void setPoolName(
const std::string& poolName);
328 void setCloningEnabled(
bool isClonable);
329 void setCachingEnabled(
bool enable);
330 void setLruEntriesLimit(
int limit);
332 void setConcurrencyChecksEnabled(
bool enable);
334 inline bool getEntryExpiryEnabled()
const {
335 return (m_entryTimeToLive > std::chrono::seconds::zero() ||
336 m_entryIdleTimeout > std::chrono::seconds::zero());
339 inline bool getRegionExpiryEnabled()
const {
340 return (m_regionTimeToLive > std::chrono::seconds::zero() ||
341 m_regionIdleTimeout > std::chrono::seconds::zero());
344 ExpirationAction m_regionTimeToLiveExpirationAction;
345 ExpirationAction m_regionIdleTimeoutExpirationAction;
346 ExpirationAction m_entryTimeToLiveExpirationAction;
347 ExpirationAction m_entryIdleTimeoutExpirationAction;
348 ExpirationAction m_lruEvictionAction;
349 mutable std::shared_ptr<CacheWriter> m_cacheWriter;
350 mutable std::shared_ptr<CacheLoader> m_cacheLoader;
351 mutable std::shared_ptr<CacheListener> m_cacheListener;
352 mutable std::shared_ptr<PartitionResolver> m_partitionResolver;
353 uint32_t m_lruEntriesLimit;
355 uint32_t m_maxValueDistLimit;
356 std::chrono::seconds m_entryIdleTimeout;
357 std::chrono::seconds m_entryTimeToLive;
358 std::chrono::seconds m_regionIdleTimeout;
359 std::chrono::seconds m_regionTimeToLive;
360 uint32_t m_initialCapacity;
362 uint8_t m_concurrencyLevel;
363 std::string m_cacheLoaderLibrary;
364 std::string m_cacheWriterLibrary;
365 std::string m_cacheListenerLibrary;
366 std::string m_partitionResolverLibrary;
367 std::string m_cacheLoaderFactory;
368 std::string m_cacheWriterFactory;
369 std::string m_cacheListenerFactory;
370 std::string m_partitionResolverFactory;
371 DiskPolicyType m_diskPolicy;
372 std::string m_endpoints;
373 bool m_clientNotificationEnabled;
374 std::string m_persistenceLibrary;
375 std::string m_persistenceFactory;
376 std::shared_ptr<Properties> m_persistenceProperties;
377 mutable std::shared_ptr<PersistenceManager> m_persistenceManager;
378 std::string m_poolName;
380 bool m_isConcurrencyChecksEnabled;
381 friend class RegionAttributesFactory;
382 friend class AttributesMutator;
384 friend class CacheImpl;
386 friend class RegionInternal;
387 friend class RegionXmlCreation;
DiskPolicyType
DiskPolicyType.hpp Enumerated type for disk policy.
Definition DiskPolicyType.hpp:42
ExpirationAction
ExpirationAction.hpp Enumerated type for expiration actions.
Definition ExpirationAction.hpp:42
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition DataInput.hpp:59
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition DataOutput.hpp:48
PersistenceManager API for persistence and overflow.
Definition PersistenceManager.hpp:52
Contains a set of (key, value) pair properties with key being the name of the property; value,...
Definition Properties.hpp:52
Defines attributes for configuring a region.
Definition RegionAttributes.hpp:77
int getInitialCapacity() const
Returns the initial capacity of the entry's local cache.
std::shared_ptr< CacheWriter > getCacheWriter() const
Gets the cache writer for the region.
std::chrono::seconds getRegionTimeToLive() const
Gets the timeToLive expiration attributes for the region as a whole.
std::chrono::seconds getRegionIdleTimeout() const
Gets the idleTimeout expiration attributes for the region as a whole.
std::shared_ptr< CacheListener > getCacheListener() const
Gets the cache listener for the region.
uint8_t getConcurrencyLevel() const
Returns the concurrencyLevel of the entry's local cache.
const std::string & getPoolName() const
Returns the name of the pool attached to the region.
Definition RegionAttributes.hpp:189
bool getCachingEnabled() const
If true, this region will store data in the current process.
Definition RegionAttributes.hpp:147
std::shared_ptr< CacheLoader > getCacheLoader() const
public static methods
std::shared_ptr< PartitionResolver > getPartitionResolver() const
Gets the partition resolver for the partition region.
uint32_t getLruEntriesLimit() const
Returns the maximum number of entries this cache will hold before using LRU eviction.
std::chrono::seconds getEntryTimeToLive() const
Gets the timeToLive expiration attributes for entries in this region.
DiskPolicyType getDiskPolicy() const
Returns the disk policy type of the region.
bool getConcurrencyChecksEnabled() const
Returns true if concurrent update checks are turned on for this region.
Definition RegionAttributes.hpp:310
std::chrono::seconds getEntryIdleTimeout() const
Gets the idleTimeout expiration attributes for entries in this region.
float getLoadFactor() const
Returns the load factor of the entry's local cache.
ExpirationAction getLruEvictionAction() const
Returns the ExpirationAction used for LRU Eviction, default is LOCAL_DESTROY.
This base class is the superclass of all user objects in the cache that can be serialized.
Definition Serializable.hpp:53