Pivotal GemFire Native Client Cache Reference  9.0.6
gemfire::PersistenceManager Class Referenceabstract

PersistenceManager API for persistence and overflow. More...

Inherits gemfire::SharedBase.

Public Member Functions

virtual void close ()=0
 Closes the persistence manager instance. More...
 
virtual void destroy (const CacheableKeyPtr &key, void *&PersistenceInfo)=0
 destroys the entry specified by the key in the argument. More...
 
virtual void init (const RegionPtr &region, PropertiesPtr &diskProperties)=0
 This method gets called after an implementation object is created. More...
 
void preserveSB () const
 Atomically increment reference count. More...
 
virtual CacheablePtr read (const CacheableKeyPtr &key, void *&PersistenceInfo)=0
 Reads the value for the key from the disk. More...
 
virtual bool readAll ()=0
 Reads all the values from the region. More...
 
int32_t refCount ()
 
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. More...
 
virtual void write (const CacheableKeyPtr &key, const CacheablePtr &value, void *&PersistenceInfo)=0
 Writes a key, value pair of region to the disk. More...
 
virtual bool writeAll ()=0
 Writes all the entries for a region. More...
 
virtual ~PersistenceManager ()=0
 destructor More...
 

Static Public Member Functions

static PersistenceManagerPtr getPersistenceManager ()
 public methods More...
 

Protected Attributes

const RegionPtr m_regionPtr
 Region for this persistence manager. More...
 

Detailed Description

PersistenceManager API for persistence and overflow.

This class abstracts the disk-related operations in case of persistence or overflow to disk. A specific disk storage implementation will implement all the methods described here.

Constructor & Destructor Documentation

virtual gemfire::PersistenceManager::~PersistenceManager ( )
pure virtual

destructor

Member Function Documentation

virtual void gemfire::PersistenceManager::close ( )
pure virtual

Closes the persistence manager instance.

Exceptions
ShutdownFailedExceptionif close is not successful.
virtual void gemfire::PersistenceManager::destroy ( const CacheableKeyPtr key,
void *&  PersistenceInfo 
)
pure virtual

destroys the entry specified by the key in the argument.

Parameters
keyis the key of the entry which is being destroyed.
PersistenceInforelated persistence information.
Exceptions
RegionDestroyedExceptionis the region is already destroyed.
EntryNotFoundExceptionif the entry is not found on the disk.
static PersistenceManagerPtr gemfire::PersistenceManager::getPersistenceManager ( )
static

public methods

Returns the current persistence manager.

Returns
persistence manager
virtual void gemfire::PersistenceManager::init ( const RegionPtr region,
PropertiesPtr diskProperties 
)
pure virtual

This method gets called after an implementation object is created.

Initializes all the implementation specific environments needed.

Exceptions
InitfailedExceptionif the persistence manager cannot be initialized.
void gemfire::SharedBase::preserveSB ( ) const
inherited

Atomically increment reference count.

virtual CacheablePtr gemfire::PersistenceManager::read ( const CacheableKeyPtr key,
void *&  PersistenceInfo 
)
pure virtual

Reads the value for the key from the disk.

Parameters
keyis the key for which the value has to be read.
PersistenceInforelated persistence information.
Returns
value of type CacheablePtr.
Exceptions
DiskCorruptExceptionif the data to be read is corrupt.
virtual bool gemfire::PersistenceManager::readAll ( )
pure virtual

Reads all the values from the region.

Returns
true
int32_t gemfire::SharedBase::refCount ( )
inlineinherited
Returns
the reference count
void gemfire::SharedBase::releaseSB ( ) const
inherited

Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.

virtual void gemfire::PersistenceManager::write ( const CacheableKeyPtr key,
const CacheablePtr value,
void *&  PersistenceInfo 
)
pure virtual

Writes a key, value pair of region to the disk.

The actual file or database related write operations should be implemented in this method by the class implementing this method.

Parameters
keythe key to write.
valuethe value to write
PersistenceInforelated persistence information.
Exceptions
RegionDestroyedExceptionis the region is already destroyed.
OutofMemoryExceptionif the disk is full
DiskFailureExceptionif the write fails due to disk fail.
virtual bool gemfire::PersistenceManager::writeAll ( )
pure virtual

Writes all the entries for a region.

Refer persistance requirement doc for the use case.

Exceptions
DiskFailureExceptionif the write fails due to disk fail.

Field Documentation

const RegionPtr gemfire::PersistenceManager::m_regionPtr
protected

Region for this persistence manager.


GemFire C++ Cache API Documentation