gemfire::Region Class Reference

Inherits gemfire::SharedBase.


Detailed Description

This class manages subregions and cached data.

Each region can contain multiple subregions and entries for data. Regions provide a hierachical name space within the cache. Also, a region can be used to group cached objects for management purposes.

Entries managed by the region are key-value pairs. A set of region attributes is associated with the region when it is created.

The Region interface basically contains two set of APIs: Region management APIs and (potentially) distributed operations on entries. Non-distributed operations on entries are provided by RegionEntry.

Each Cache defines regions called the root regions. User applications can use the root regions to create subregions for isolated name space and object grouping.

A region's name can be any String, except that it should not contain the region name separator, a forward slash (/).

Regions can be referenced by a relative path name from any region higher in the hierarchy in Region::getSubregion. You can get the relative path from the root region with Region::getFullPath. The name separator is used to concatenate all the region names together from the root, starting with the root's subregions.

See also:
RegionAttributes

Public Member Functions

template<class KEYTYPE>
bool containsKey (const KEYTYPE &key) const
 Convenience method allowing key to be a const char* This operations checks for the key in the local cache .
virtual bool containsKey (const CacheableKeyPtr &keyPtr) const =0
 Only the client's cache is searched for the key.
template<class KEYTYPE>
bool containsValueForKey (const KEYTYPE &key) const
 Convenience method allowing key to be a const char* This operations checks for the value in the local cache .
virtual bool containsValueForKey (const CacheableKeyPtr &keyPtr) const =0
 This operations checks for the value in the local cache .
template<class VALUETYPE>
void create (const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=NULL)
 Convenience method allowing value to be a const char*.
template<class KEYTYPE>
void create (const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=NULL)
 Convenience method allowing key to be a const char*.
template<class KEYTYPE, class VALUETYPE>
void create (const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=NULL)
 Convenience method allowing both key and value to be a const char*.
virtual void create (const CacheableKeyPtr &key, const CacheablePtr &value, const UserDataPtr &aCacheWriterParam=NULL)=0
 Creates a new entry in this region with the specified key and value, providing a user-defined parameter object to any CacheWriter invoked in the process.
virtual void createServerSubregion (const char *regionname, const RegionAttributesPtr &attrs)=0
 This functionality is unsupported in the Native Client Product.
virtual RegionPtr createSubregion (const char *subregionName, RegionAttributesPtr &aRegionAttributes)=0
 Creates a subregion with the specified attributes.
template<class KEYTYPE>
void destroy (const KEYTYPE &key, const UserDataPtr &arg=NULL)
 Convenience method allowing key to be a const char*.
virtual void destroy (const CacheableKeyPtr &key, const UserDataPtr &aCacheWriterParam=NULL)=0
 Destroys the entry with the specified key, and provides a user-defined parameter object to any CacheWriter invoked in the process.
virtual void destroyRegion (const UserDataPtr &aCallbackArgument=NULL)=0
 Destroys the whole region and provides a user-defined parameter object to any CacheWriter invoked in the process.
virtual void destroyServerSubregion (const char *regionname)=0
 This functionality is unsupported in the Native Client Product.
virtual bool existsValue (const char *predicate, uint32_t timeout=15)=0
 Executes the query on the server based on the predicate and returns whether any result exists.
template<class KEYTYPE>
CacheablePtr get (const KEYTYPE &key)
 Convenience method allowing key to be a const char*.
template<class KEYTYPE>
CacheablePtr get (const KEYTYPE &key, UserDataPtr &callbackArg)
 Convenience method allowing key to be a const char*.
virtual CacheablePtr get (const CacheableKeyPtr &key)=0
 Returns the value associated with the specified key.
virtual CacheablePtr get (const CacheableKeyPtr &key, UserDataPtr &aCallbackArgument)=0
 Returns the value associated with the specified key, passing the callback argument to any cache loaders or cache writers that are invoked in the operation.
virtual
RegionAttributesPtr 
getAttributes ()=0
 Return the RegionAttributes for this region.
virtual
AttributesMutatorPtr 
getAttributesMutator ()=0
 Return the a mutator object for changing a subset of the region attributes.
template<class KEYTYPE>
RegionEntryPtr getEntry (const KEYTYPE &key)
 Convenience method allowing key to be a const char*.
virtual RegionEntryPtr getEntry (const CacheableKeyPtr &key)=0
 Return the meta-object RegionEntry for key.
virtual const char * getFullPath () const =0
 return the full path of the region as can be used to lookup the region from Cache::getRegion.
template<class KEYTYPE>
void getInterestList (const KEYTYPE &key, VectorOfMemberId &v)
 This functionality is unsupported in the Native Client Product.
virtual void getInterestList (const CacheableKeyPtr &key, VectorOfMemberId &v)=0
 This functionality is unsupported in the Native Client Product.
virtual const char * getName () const =0
virtual RegionPtr getParentRegion ()=0
 Returns the parent region, or null if a root region.
virtual uint32_t getPeerCount () const =0
 This functionality is unsupported in the Native Client Product.
virtual RegionPtr getSubregion (const char *path)=0
 Returns the subregion identified by the path, null if no such subregion.
template<class KEYTYPE>
void invalidate (const KEYTYPE &key, const UserDataPtr &arg=NULL)
 Convenience method allowing key to be a const char*.
virtual void invalidate (const CacheableKeyPtr &key, const UserDataPtr &aCallbackArgument=NULL)=0
 Invalidates the entry with the specified key, and provides a user-defined argument to the CacheListener.
virtual void invalidateRegion (const UserDataPtr &aCallbackArgument=NULL)=0
 Invalidates this region.
virtual void keys (VectorOfCacheableKey &v)=0
 Return all the keys in the local process for this region.
template<class KEYTYPE>
void localDestroy (const KEYTYPE &key, const UserDataPtr &arg=NULL)
 Convenience method allowing key to be a const char*.
virtual void localDestroy (const CacheableKeyPtr &key, const UserDataPtr &aCallbackArgument=NULL)=0
 Destroys the value with the specified key in the local cache only, and provides a user-defined parameter object to the CacheListener, if any.
virtual void localDestroyRegion (const UserDataPtr &aCallbackArgument=NULL)=0
 Destroys the whole region and provides a user-defined parameter object to any CacheWriter invoked in the process.
template<class KEYTYPE>
void localInvalidate (const KEYTYPE &key, const UserDataPtr &arg=NULL)
 Convenience method allowing key to be a const char*.
virtual void localInvalidateRegion (const UserDataPtr &aCallbackArgument=NULL)=0
 Invalidates this region.
void preserveSB () const
 Atomically increment reference count.
template<class VALUETYPE>
void put (const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=NULL)
 Convenience method allowing value to be a const char*.
template<class KEYTYPE>
void put (const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=NULL)
 Convenience method allowing key to be a const char*.
template<class KEYTYPE, class VALUETYPE>
void put (const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=NULL)
 Convenience method allowing both key and value to be a const char*.
virtual void put (const CacheableKeyPtr &key, const CacheablePtr &value, const UserDataPtr &aCallbackArgument=NULL)=0
 Places a new value into an entry in this region with the specified key, providing a user-defined parameter object to any CacheWriter invoked in the process.
virtual SelectResultsPtr query (const char *predicate, uint32_t timeout=15)=0
 Executes the query on the server based on the predicate.
int32_t refCount ()
 
Returns:
the reference count

virtual void registerAllKeys (bool isDurable=false)=0
 Registers to get updates for all keys from the server.
virtual void registerKeys (const VectorOfCacheableKey &keys, const UserDataPtr &aCallbackArgument, bool isDurable=false)=0
 Registers an array of keys for getting updates from the server.
virtual void registerRegex (const char *regex, bool isDurable=false)=0
 Registers a regular expression to match with keys to get updates from the server.
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.
virtual SerializablePtr selectValue (const char *predicate, uint32_t timeout=15)=0
 Executes the query on the server based on the predicate and returns a single result value.
virtual void serverKeys (VectorOfCacheableKey &v)=0
 Return the set of keys defined in the server process associated to this client and region.
virtual void subregions (const bool recursive, VectorOfRegion &sr)=0
 Populates the passed in VectorOfRegion with subregions of the current region.
virtual void unregisterAllKeys ()=0
 Registers to get updates for all keys from the server.
virtual void unregisterKeys (const VectorOfCacheableKey &keys, const UserDataPtr &aCallbackArgument)=0
 Unregisters an array of keys to stop getting updates for them.
virtual void unregisterRegex (const char *regex)=0
 Unregisters a regular expression to stop getting updates for keys from the server.
virtual void values (VectorOfCacheable &vc)=0
 Return all values in the local process for this region.

Member Function Documentation

template<class KEYTYPE>
bool gemfire::Region::containsKey ( const KEYTYPE &  key  )  const [inline]

Convenience method allowing key to be a const char* This operations checks for the key in the local cache .

It is not propagated to the Gemfire cache server to which it is connected.

virtual bool gemfire::Region::containsKey ( const CacheableKeyPtr keyPtr  )  const [pure virtual]

Only the client's cache is searched for the key.

It does not go to the java server to which it is connected with.

template<class KEYTYPE>
bool gemfire::Region::containsValueForKey ( const KEYTYPE &  key  )  const [inline]

Convenience method allowing key to be a const char* This operations checks for the value in the local cache .

It is not propagated to the Gemfire cache server to which it is connected.

virtual bool gemfire::Region::containsValueForKey ( const CacheableKeyPtr keyPtr  )  const [pure virtual]

This operations checks for the value in the local cache .

It is not propagated to the Gemfire cache server to which it is connected.

template<class VALUETYPE>
void gemfire::Region::create ( const CacheableKeyPtr key,
const VALUETYPE &  value,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing value to be a const char*.

template<class KEYTYPE>
void gemfire::Region::create ( const KEYTYPE &  key,
const CacheablePtr value,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing key to be a const char*.

template<class KEYTYPE, class VALUETYPE>
void gemfire::Region::create ( const KEYTYPE &  key,
const VALUETYPE &  value,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing both key and value to be a const char*.

virtual void gemfire::Region::create ( const CacheableKeyPtr key,
const CacheablePtr value,
const UserDataPtr aCacheWriterParam = NULL 
) [pure virtual]

Creates a new entry in this region with the specified key and value, providing a user-defined parameter object to any CacheWriter invoked in the process.

The new entry is propogated to the java server also to which it is connected with.

Updates the CacheStatistics::getLastAccessedTime and CacheStatistics::getLastModifiedTime for this region and the entry.

Parameters:
key the key smart pointer for which to create the entry in this region. The object is created before the call, and the caller should not deallocate the object
value the value for the new entry, which may be null meaning the new entry starts as if it had been locally invalidated.
aCacheWriterParam a user-defined parameter to pass to the CacheWriter. Should be serializable if will be passed to a remote CacheWriter. Can be null.
Exceptions:
IllegalArgumentException if key is null or if the key, value, or aCacheWriterParam do not meet serializability requirements
NotConnectedException if not connected to gemfire system because the client cannot establish usable connections to any of the servers given to it
RegionDestroyedException if region is no longer valid
CacheServerException If an exception is received from the Java cache server. Only for Native Client regions.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
TimeoutException if the operation timed out
OutOfMemoryException if no memory for new entry
EntryExistsException if an entry with this key already exists

virtual void gemfire::Region::createServerSubregion ( const char *  regionname,
const RegionAttributesPtr attrs 
) [pure virtual]

This functionality is unsupported in the Native Client Product.

virtual RegionPtr gemfire::Region::createSubregion ( const char *  subregionName,
RegionAttributesPtr aRegionAttributes 
) [pure virtual]

Creates a subregion with the specified attributes.

template<class KEYTYPE>
void gemfire::Region::destroy ( const KEYTYPE &  key,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing key to be a const char*.

virtual void gemfire::Region::destroy ( const CacheableKeyPtr key,
const UserDataPtr aCacheWriterParam = NULL 
) [pure virtual]

Destroys the entry with the specified key, and provides a user-defined parameter object to any CacheWriter invoked in the process.

Destroy removes not only the value, but also the key and entry from this region.

The destroy is propogated to the Gemfire cache server to which it is connected with.

Does not update any CacheStatistics.

Parameters:
key the key of the entry to destroy
aCacheWriterParam object to be passed to the CacheWriter. Should be serializable if it will be passed to a remote CacheWriter.
Exceptions:
IllegalArgumentException if key is null
CacheServerException If an exception is received from the Gemfire cache server. Only for Native Client regions.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
TimeoutException if the operation timed out
EntryNotFoundException if the entry does not exist in this region locally.
RegionDestroyedException if the region is destroyed.
See also:
invalidate

CacheListener::afterDestroy

CacheWriter::beforeDestroy

virtual void gemfire::Region::destroyRegion ( const UserDataPtr aCallbackArgument = NULL  )  [pure virtual]

Destroys the whole region and provides a user-defined parameter object to any CacheWriter invoked in the process.

Destroy cascades to all entries and subregions. After the destroy, this region object can not be used any more. Any attempt to use this region object will get a RegionDestroyedException exception.

The region destroy not only destroys the local region but also destroys the server region.

Does not update any CacheStatistics.

Parameters:
aCallbackArgument a user-defined parameter to pass to callback events triggered by this call. Can be null. If it is sent on the wire, it has to be Serializable.
Exceptions:
CacheWriterException if a CacheWriter aborts the operation; if this occurs some subregions may have already been successfully destroyed.
CacheServerException If an exception is received from the Java cache server. Only for Native Client regions.
NotConnectedException if not connected to the gemfire system because the client cannot establish usable connections to any of the servers given to it
TimeoutException if operation timed out
See also:
invalidateRegion

virtual void gemfire::Region::destroyServerSubregion ( const char *  regionname  )  [pure virtual]

This functionality is unsupported in the Native Client Product.

virtual bool gemfire::Region::existsValue ( const char *  predicate,
uint32_t  timeout = 15 
) [pure virtual]

Executes the query on the server based on the predicate and returns whether any result exists.

Valid only for a Native Client region.

Parameters:
predicate The query predicate (just the WHERE clause) or the entire query to execute.
timeout The time (in seconds) to wait for the response, optional. This should be less than or equal to 2^31/1000 i.e. 2147483.
Exceptions:
IllegalArgumentException If predicate is empty or timeout parameter is greater than 2^31/1000.
QueryException if some query error occurred at the server.
NotConnectedException if a server connection error occurs.
MessageExcepton If the message received from server could not be handled. This will be the case when the reply is not well formed. More information can be found in the log.
TimeoutException if operation timed out
CacheClosedException if the cache has been closed
Returns:
true if the result size is non-zero, false otherwise.

template<class KEYTYPE>
CacheablePtr gemfire::Region::get ( const KEYTYPE &  key  )  [inline]

Convenience method allowing key to be a const char*.

template<class KEYTYPE>
CacheablePtr gemfire::Region::get ( const KEYTYPE &  key,
UserDataPtr callbackArg 
) [inline]

Convenience method allowing key to be a const char*.

virtual CacheablePtr gemfire::Region::get ( const CacheableKeyPtr key  )  [pure virtual]

Returns the value associated with the specified key.

If the value is not present locally for this entry, then it is requested from the java server. If even that is unsuccessful then a local CacheLoader will be invoked if there is one.

If any of these methods successfully retrieves a value, then the value is immediately returned.CacheablePtr get(const CacheableKeyPtr& key); For a more complete description of this method, refer to Region::get

virtual CacheablePtr gemfire::Region::get ( const CacheableKeyPtr key,
UserDataPtr aCallbackArgument 
) [pure virtual]

Returns the value associated with the specified key, passing the callback argument to any cache loaders or cache writers that are invoked in the operation.

If the value is not present locally then it is requested from the java server. If even that is unsuccessful then a local CacheLoader will be invoked if there is one.

The value returned by get is not copied, so multi-threaded applications should not modify the value directly, but should use the update methods.

Updates the CacheStatistics::getLastAccessedTime, CacheStatistics::getHitCount, CacheStatistics::getMissCount, and CacheStatistics::getLastModifiedTime (if a new value is loaded) for this region and the entry.

If a CacheWriter throws a CacheWriterException when a new value is retrieved from a loader, then the value will not be put into the cache (a new entry will not be created) but the get will return the value and not propagate the exception.

Parameters:
key whose associated value is to be returned. The key Object must implement the equals and hashCode methods.
aCallbackArgument an argument passed into the CacheLoader if loader is used. This same argument will also be subsequently passed to a CacheWriter if the loader returns a non-null value to be placed in the cache. Modifications to this argument made in the CacheLoader will be visible to the CacheWriter even if the loader and the writer are installed in different cache processes. If it is sent on the wire, it has to be Serializable.
Exceptions:
IllegalArgumentException if key is null or aLoaderParameter is not serializable and a remote CacheLoader needs to be invoked
CacheServerException If an exception is received from the Java cache server. Only for Native Client regions.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
MessageExcepton If the message received from server could not be handled. This will be the case when an unregistered typeId is received in the reply or reply is not well formed. More information can be found in the log.
TimeoutException if operation timed out
RegionDestroyedException if the method is called on a destroyed region

virtual RegionAttributesPtr gemfire::Region::getAttributes (  )  [pure virtual]

Return the RegionAttributes for this region.

virtual AttributesMutatorPtr gemfire::Region::getAttributesMutator (  )  [pure virtual]

Return the a mutator object for changing a subset of the region attributes.

Exceptions:
RegionDestroyedException. 

template<class KEYTYPE>
RegionEntryPtr gemfire::Region::getEntry ( const KEYTYPE &  key  )  [inline]

Convenience method allowing key to be a const char*.

virtual RegionEntryPtr gemfire::Region::getEntry ( const CacheableKeyPtr key  )  [pure virtual]

Return the meta-object RegionEntry for key.

Exceptions:
IllegalArgumentException,RegionDestroyedException. 

virtual const char* gemfire::Region::getFullPath (  )  const [pure virtual]

return the full path of the region as can be used to lookup the region from Cache::getRegion.

The storage is backed by the region.

template<class KEYTYPE>
void gemfire::Region::getInterestList ( const KEYTYPE &  key,
VectorOfMemberId v 
) [inline]

This functionality is unsupported in the Native Client Product.

virtual void gemfire::Region::getInterestList ( const CacheableKeyPtr key,
VectorOfMemberId v 
) [pure virtual]

This functionality is unsupported in the Native Client Product.

virtual const char* gemfire::Region::getName (  )  const [pure virtual]

Public Methods return single name of region. The storage is backed by the region.

virtual RegionPtr gemfire::Region::getParentRegion (  )  [pure virtual]

Returns the parent region, or null if a root region.

Exceptions:
RegionDestroyedException 

virtual uint32_t gemfire::Region::getPeerCount (  )  const [pure virtual]

This functionality is unsupported in the Native Client Product.

virtual RegionPtr gemfire::Region::getSubregion ( const char *  path  )  [pure virtual]

Returns the subregion identified by the path, null if no such subregion.

template<class KEYTYPE>
void gemfire::Region::invalidate ( const KEYTYPE &  key,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing key to be a const char*.

virtual void gemfire::Region::invalidate ( const CacheableKeyPtr key,
const UserDataPtr aCallbackArgument = NULL 
) [pure virtual]

Invalidates the entry with the specified key, and provides a user-defined argument to the CacheListener.

Invalidate only removes the value from the entry, the key is kept intact. To completely remove the entry, destroy should be used.

The invalidate is not propogated to the Gemfire cache server to which it is connected with.

Does not update any CacheStatistics.

Parameters:
key the key of the value to be invalidated
aCallbackArgument a user-defined parameter to pass to callback events triggered by this method. Can be null. Should be serializable if passed to remote callback events
Exceptions:
IllegalArgumentException if key is null
EntryNotFoundException if this entry does not exist in this region locally
RegionDestroyedException if the region is destroyed
See also:
destroy

CacheListener::afterInvalidate

virtual void gemfire::Region::invalidateRegion ( const UserDataPtr aCallbackArgument = NULL  )  [pure virtual]

Invalidates this region.

The invalidation will cascade to all the subregions and cached entries. After the invalidateRegion , the region and the entries in it still exist. In order to remove all the entries and the region, destroyRegion should be used.

Does not update any CacheStatistics .

Parameters:
aCallbackArgument a user-defined parameter to pass to callback events triggered by this method. Can be null. If it is sent on the wire, it has to be Serializable.
Exceptions:
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
RegionDestroyedException if the region is no longer valid
See also:
destroyRegion

CacheListener::afterRegionInvalidate

This operation is not distributed for native clients

virtual void gemfire::Region::keys ( VectorOfCacheableKey v  )  [pure virtual]

Return all the keys in the local process for this region.

This includes keys for which the entry is invalid.

template<class KEYTYPE>
void gemfire::Region::localDestroy ( const KEYTYPE &  key,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing key to be a const char*.

virtual void gemfire::Region::localDestroy ( const CacheableKeyPtr key,
const UserDataPtr aCallbackArgument = NULL 
) [pure virtual]

Destroys the value with the specified key in the local cache only, and provides a user-defined parameter object to the CacheListener, if any.

No CacheWriter is invoked. Destroy removes not only the value but also the key and entry from this region.

Does not update any CacheStatistics.

Parameters:
key the key of the entry to destroy.
aCallbackArgument the callback for user to pass in, default is NULL.
Exceptions:
IllegalArgumentException if key is null
IllegalStateException if this region is not MirrorType::NONE.
EntryNotFoundException if the entry does not exist in this region locally
See also:
invalidate

CacheListener::afterDestroy

CacheWriter::beforeDestroy

virtual void gemfire::Region::localDestroyRegion ( const UserDataPtr aCallbackArgument = NULL  )  [pure virtual]

Destroys the whole region and provides a user-defined parameter object to any CacheWriter invoked in the process.

Destroy cascades to all entries and subregions. After the destroy, this region object can not be used any more. Any attempt to use this region object will get a RegionDestroyedException exception. The region destroy is not distributed to other caches.

Does not update any CacheStatistics.

Parameters:
aCallbackArgument a user-defined parameter to pass to callback events triggered by this call. Can be null. If it is sent on the wire, it has to be Serializable.
Exceptions:
CacheWriterException if a CacheWriter aborts the operation; if this occurs some subregions may have already been successfully destroyed.
See also:
localInvalidateRegion

template<class KEYTYPE>
void gemfire::Region::localInvalidate ( const KEYTYPE &  key,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing key to be a const char*.

virtual void gemfire::Region::localInvalidateRegion ( const UserDataPtr aCallbackArgument = NULL  )  [pure virtual]

Invalidates this region.

The invalidation will cascade to all the subregions and cached entries. After the invalidateRegion , the region and the entries in it still exist. In order to remove all the entries and the region, destroyRegion should be used. The region invalidate will not be distributed to other caches

Does not update any CacheStatistics .

Parameters:
aCallbackArgument a user-defined parameter to pass to callback events triggered by this method. Can be null. If it is sent on the wire, it has to be Serializable.
Exceptions:
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
RegionDestroyedException if the region is no longer valid
See also:
destroyRegion

CacheListener::afterRegionInvalidate

void gemfire::SharedBase::preserveSB (  )  const [inherited]

Atomically increment reference count.

template<class VALUETYPE>
void gemfire::Region::put ( const CacheableKeyPtr key,
const VALUETYPE &  value,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing value to be a const char*.

template<class KEYTYPE>
void gemfire::Region::put ( const KEYTYPE &  key,
const CacheablePtr value,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing key to be a const char*.

template<class KEYTYPE, class VALUETYPE>
void gemfire::Region::put ( const KEYTYPE &  key,
const VALUETYPE &  value,
const UserDataPtr arg = NULL 
) [inline]

Convenience method allowing both key and value to be a const char*.

virtual void gemfire::Region::put ( const CacheableKeyPtr key,
const CacheablePtr value,
const UserDataPtr aCallbackArgument = NULL 
) [pure virtual]

Places a new value into an entry in this region with the specified key, providing a user-defined parameter object to any CacheWriter invoked in the process.

If there is already an entry associated with the specified key in this region, the entry's previous value is overwritten.

The new put value is propogated to the java server to which it is connected with.

Updates the CacheStatistics::getLastAccessedTime and CacheStatistics::getLastModifiedTime for this region and the entry.

Parameters:
key a key smart pointer associated with the value to be put into this region. Object is allocated before the call, and caller should not deallocate the object
value the value to be put into the cache
aCallbackArgument an argument that is passed to the callback function
Exceptions:
IllegalArgumentException if key is null or if key, value, or aCallbackArgument do not meet serializability requirements
IllegalArgumentException if key is null or aLoaderParameter is not serializable and a remote CacheLoader needs to be invoked
RegionDestroyedException if region no longer valid
CacheServerException If an exception is received from the Java cache server.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
TimeoutException if operation timed out
OutOfMemoryException if not enoough memory for the value

virtual SelectResultsPtr gemfire::Region::query ( const char *  predicate,
uint32_t  timeout = 15 
) [pure virtual]

Executes the query on the server based on the predicate.

Valid only for a Native Client region.

Parameters:
predicate The query predicate (just the WHERE clause) or the entire query to execute.
timeout The time (in seconds) to wait for the query response, optional. This should be less than or equal to 2^31/1000 i.e. 2147483.
Exceptions:
IllegalArgumentException If predicate is empty or timeout parameter is greater than 2^31/1000.
QueryException if some query error occurred at the server.
CacheServerException If an exception is received from the Java cache server.
NotConnectedException if a server connection error occurs.
MessageExcepton If the message received from server could not be handled. This will be the case when an unregistered typeId is received in the reply or reply is not well formed. More information can be found in the log.
TimeoutException if operation timed out
CacheClosedException if the cache has been closed
Returns:
A smart pointer to the SelectResults which can either be a ResultSet or a StructSet.

int32_t gemfire::SharedBase::refCount (  )  [inline, inherited]

Returns:
the reference count

virtual void gemfire::Region::registerAllKeys ( bool  isDurable = false  )  [pure virtual]

Registers to get updates for all keys from the server.

Valid only for a Native Client region when client notification ( AttributesFactory::setClientNotification ) is true.

Parameters:
isDurable flag to indicate whether this is a durable registration
Exceptions:
RedundancyException if the redundancy level specified using CacheAttributesFactory::setRedundancyLevel is not satisfied. Application can catch this exception and proceed if working with insufficient secondaries is acceptable; the registration is performed on the available secondaries before exception is thrown.
UnsupportedOperationException If the region is not a Native Client region or AttributesFactory::setClientNotification is false.
CacheServerException If an exception is received from the Java cache server.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
RegionDestroyedException If region destroy is pending.
UnknownException For other exceptions.
TimeoutException if operation timed out

virtual void gemfire::Region::registerKeys ( const VectorOfCacheableKey keys,
const UserDataPtr aCallbackArgument,
bool  isDurable = false 
) [pure virtual]

Registers an array of keys for getting updates from the server.

Valid only for a Native Client region when client notification ( AttributesFactory::setClientNotification ) is true.

Parameters:
keys the array of keys
aCallbackArgument user-defined parameter to pass to callback events triggered by this method
isDurable flag to indicate whether this is a durable registration
Exceptions:
IllegalArgumentException If the array of keys is empty.
IllegalStateException If already registered interest for all keys.
RedundancyException if the redundancy level specified using CacheAttributesFactory::setRedundancyLevel is not satisfied. Application can catch this exception and proceed if working with insufficient secondaries is acceptable; the registration is performed on the available secondaries before exception is thrown.
UnsupportedOperationException If the region is not a Native Client region or AttributesFactory::setClientNotification is false.
CacheServerException If an exception is received from the Java cache server.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
RegionDestroyedException If region destroy is pending.
UnknownException For other exceptions.
TimeoutException if operation timed out

virtual void gemfire::Region::registerRegex ( const char *  regex,
bool  isDurable = false 
) [pure virtual]

Registers a regular expression to match with keys to get updates from the server.

Valid only for a Native Client region when client notification ( AttributesFactory::setClientNotification ) is true.

Parameters:
regex The regular expression string.
isDurable flag to indicate whether this is a durable registration
Exceptions:
IllegalArgumentException If regex is empty.
IllegalStateException If already registered interest for all keys.
RedundancyException if the redundancy level specified using CacheAttributesFactory::setRedundancyLevel is not satisfied. Application can catch this exception and proceed if working with insufficient secondaries is acceptable; the registration is performed on the available secondaries before exception is thrown.
UnsupportedOperationException If the region is not a Native Client region or AttributesFactory::setClientNotification is false.
CacheServerException If an exception is received from the Java cache server.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
MessageExcepton If the message received from server could not be handled. This will be the case when an unregistered typeId is received in the reply or reply is not well formed. More information can be found in the log.
RegionDestroyedException If region destroy is pending.
UnknownException For other exceptions.
TimeoutException if operation timed out

void gemfire::SharedBase::releaseSB (  )  const [inherited]

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

virtual SerializablePtr gemfire::Region::selectValue ( const char *  predicate,
uint32_t  timeout = 15 
) [pure virtual]

Executes the query on the server based on the predicate and returns a single result value.

Valid only for a Native Client region.

Parameters:
predicate The query predicate (just the WHERE clause) or the entire query to execute.
timeout The time (in seconds) to wait for the response, optional. This should be less than or equal to 2^31/1000 i.e. 2147483.
Exceptions:
IllegalArgumentException If predicate is empty or timeout parameter is greater than 2^31/1000.
QueryException if some query error occurred at the server, or more than one result items are available.
NotConnectedException if a server connection error occurs.
MessageExcepton If the message received from server could not be handled. This will be the case when an unregistered typeId is received in the reply or reply is not well formed. More information can be found in the log.
TimeoutException if operation timed out
CacheClosedException if the cache has been closed
Returns:
A smart pointer to the single ResultSet or StructSet item, or NULL of no results are available.

virtual void gemfire::Region::serverKeys ( VectorOfCacheableKey v  )  [pure virtual]

Return the set of keys defined in the server process associated to this client and region.

If a server has the region defined as a mirror, then this will be the entire keyset for the region across all PEER in the distributed system. The vector v will contain only the server keys. Any prior contents in the vector will be removed.

Exceptions:
CacheServerException If an exception is received from the Gemfire cache server. Only for Native Client regions.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
MessageExcepton If the message received from server could not be handled. This will be the case when an unregistered typeId is received in the reply or reply is not well formed. More information can be found in the log.
TimeoutException if there is a timeout getting the keys
UnsupportedOperationException if the member type is not CLIENT or region is not a native client one.

virtual void gemfire::Region::subregions ( const bool  recursive,
VectorOfRegion sr 
) [pure virtual]

Populates the passed in VectorOfRegion with subregions of the current region.

Parameters:
recursive determines whether the method recursively fills in subregions
[out] sr subregions
Exceptions:
RegionDestroyedException 

virtual void gemfire::Region::unregisterAllKeys (  )  [pure virtual]

Registers to get updates for all keys from the server.

Valid only for a Native Client region when client notification ( AttributesFactory::setClientNotification ) is true.

Exceptions:
IllegalStateException If not previously registered all keys.
RedundancyException if the redundancy level specified using CacheAttributesFactory::setRedundancyLevel is not satisfied.
UnsupportedOperationException If the region is not a Native Client region or AttributesFactory::setClientNotification is false.
CacheServerException If an exception is received from the Java cache server.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
RegionDestroyedException If region destroy is pending.
UnknownException For other exceptions.
TimeoutException if operation timed out

virtual void gemfire::Region::unregisterKeys ( const VectorOfCacheableKey keys,
const UserDataPtr aCallbackArgument 
) [pure virtual]

Unregisters an array of keys to stop getting updates for them.

Valid only for a Native Client region when client notification ( AttributesFactory::setClientNotification ) is true.

Parameters:
keys the array of keys
aCallbackArgument user-defined parameter to pass to callback events triggered by this method
Exceptions:
IllegalArgumentException If the array of keys is empty.
IllegalStateException If no keys were previously registered.
RedundancyException if the redundancy level specified using CacheAttributesFactory::setRedundancyLevel is not satisfied.
UnsupportedOperationException If the region is not a Native Client region or AttributesFactory::setClientNotification is false.
CacheServerException If an exception is received from the Java cache server.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
RegionDestroyedException If region destroy is pending.
UnknownException For other exceptions.
TimeoutException if operation timed out

virtual void gemfire::Region::unregisterRegex ( const char *  regex  )  [pure virtual]

Unregisters a regular expression to stop getting updates for keys from the server.

Valid only for a Native Client region when client notification ( AttributesFactory::setClientNotification ) is true.

Parameters:
regex The regular expression string.
Exceptions:
IllegalArgumentException If regex is empty.
IllegalStateException If not previously registered this regular expression string.
RedundancyException if the redundancy level specified using CacheAttributesFactory::setRedundancyLevel is not satisfied.
UnsupportedOperationException If the region is not a Native Client region or AttributesFactory::setClientNotification is false.
CacheServerException If an exception is received from the Java cache server.
NotConnectedException if it is not connected to the cache because the client cannot establish usable connections to any of the servers given to it
RegionDestroyedException If region destroy is pending.
UnknownException For other exceptions.
TimeoutException if operation timed out

virtual void gemfire::Region::values ( VectorOfCacheable vc  )  [pure virtual]

Return all values in the local process for this region.

No value is included for entries that are invalidated.


GemFire C++ Cache API Documentation