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"
46 class RegionAttributesFactory;
47 class AttributesMutator;
50 class PersistenceManager;
77 :
public internal::DataSerializableInternal {
212 const std::
string& getCacheLoaderLibrary() const;
218 const std::
string& getCacheLoaderFactory() const;
224 const std::
string& getCacheListenerLibrary() const;
230 const std::
string& getCacheListenerFactory() const;
236 const std::
string& getCacheWriterLibrary() const;
242 const std::
string& getCacheWriterFactory() const;
248 const std::
string& getPartitionResolverLibrary() const;
254 const std::
string& getPartitionResolverFactory() const;
267 void validateSerializableAttributes();
272 const std::
string& getEndpoints() const;
277 bool getClientNotificationEnabled() const;
283 const std::
string& getPersistenceLibrary() const;
289 const std::
string& getPersistenceFactory() const;
294 std::shared_ptr<
Properties> getPersistenceProperties() const;
304 bool getCloningEnabled()
const {
return m_isClonable; }
312 return m_isConcurrencyChecksEnabled;
317 void setCacheListener(
const std::string& libpath,
318 const std::string& factoryFuncName);
319 void setCacheLoader(
const std::string& libpath,
320 const std::string& factoryFuncName);
321 void setCacheWriter(
const std::string& libpath,
322 const std::string& factoryFuncName);
323 void setPartitionResolver(
const std::string& libpath,
324 const std::string& factoryFuncName);
325 void setPersistenceManager(
const std::string& lib,
const std::string& func,
326 const std::shared_ptr<Properties>& config);
327 void setEndpoints(
const std::string& endpoints);
328 void setPoolName(
const std::string& poolName);
329 void setCloningEnabled(
bool isClonable);
330 void setCachingEnabled(
bool enable);
331 void setLruEntriesLimit(
int limit);
333 void setConcurrencyChecksEnabled(
bool enable);
335 inline bool getEntryExpiryEnabled()
const {
336 return (m_entryTimeToLive > std::chrono::seconds::zero() ||
337 m_entryIdleTimeout > std::chrono::seconds::zero());
340 inline bool getRegionExpiryEnabled()
const {
341 return (m_regionTimeToLive > std::chrono::seconds::zero() ||
342 m_regionIdleTimeout > std::chrono::seconds::zero());
350 mutable std::shared_ptr<CacheWriter> m_cacheWriter;
351 mutable std::shared_ptr<CacheLoader> m_cacheLoader;
352 mutable std::shared_ptr<CacheListener> m_cacheListener;
353 mutable std::shared_ptr<PartitionResolver> m_partitionResolver;
354 uint32_t m_lruEntriesLimit;
356 uint32_t m_maxValueDistLimit;
357 std::chrono::seconds m_entryIdleTimeout;
358 std::chrono::seconds m_entryTimeToLive;
359 std::chrono::seconds m_regionIdleTimeout;
360 std::chrono::seconds m_regionTimeToLive;
361 uint32_t m_initialCapacity;
363 uint8_t m_concurrencyLevel;
364 std::string m_cacheLoaderLibrary;
365 std::string m_cacheWriterLibrary;
366 std::string m_cacheListenerLibrary;
367 std::string m_partitionResolverLibrary;
368 std::string m_cacheLoaderFactory;
369 std::string m_cacheWriterFactory;
370 std::string m_cacheListenerFactory;
371 std::string m_partitionResolverFactory;
373 std::string m_endpoints;
374 bool m_clientNotificationEnabled;
375 std::string m_persistenceLibrary;
376 std::string m_persistenceFactory;
377 std::shared_ptr<Properties> m_persistenceProperties;
378 mutable std::shared_ptr<PersistenceManager> m_persistenceManager;
379 std::string m_poolName;
381 bool m_isConcurrencyChecksEnabled;
382 friend class RegionAttributesFactory;
383 friend class AttributesMutator;
385 friend class CacheImpl;
387 friend class RegionInternal;
388 friend class RegionXmlCreation;
397 #endif // GEODE_REGIONATTRIBUTES_H_