Apache Geode Native .NET Reference 1.15.0
|
Encapsulates a concrete region of cached data. More...
#include <IRegion.hpp>
Inherits System::Collections::Generic::IDictionary< TKey, TValue >.
Inherited by Apache::Geode::Client::LocalRegion< TKey, TValue >, and Apache::Geode::Client::Region< TKey, TValue >.
Public Member Functions | |
bool | ContainsValueForKey (TKey key) |
True if the region contains a value for the given key. More... | |
IRegion< TKey, TValue > ^ | CreateSubRegion (String^ subRegionName, RegionAttributes< TKey, TValue >^ attributes) |
Creates a subregion with the given name and attributes. More... | |
void | DestroyRegion () |
Destroys the whole distributed region and provides a user-defined parameter object to any ICacheWriter invoked in the process. More... | |
void | DestroyRegion (Object^ callbackArg) |
Destroys the whole distributed region and provides a user-defined parameter object to any ICacheWriter invoked in the process. More... | |
bool | ExistsValue (String^ predicate) |
Executes the query on the server based on the predicate and returns whether any result exists. More... | |
bool | ExistsValue (String^ predicate, TimeSpan timeout) |
Executes the query on the server based on the predicate and returns whether any result exists. More... | |
TValue | Get (TKey key) |
Returns the value for the given key, passing the callback argument to any cache loaders or that are invoked in the operation. More... | |
TValue | Get (TKey key, Object^ callbackArg) |
Returns the value for the given key, passing the callback argument to any cache loaders or that are invoked in the operation. More... | |
void | GetAll (System::Collections::Generic::ICollection< TKey >^ keys, System::Collections::Generic::IDictionary< TKey, TValue >^ values, System::Collections::Generic::IDictionary< TKey, System::Exception^>^ exceptions) |
Gets values for collection of keys from the local cache or server. More... | |
void | GetAll (System::Collections::Generic::ICollection< TKey >^ keys, System::Collections::Generic::IDictionary< TKey, TValue >^ values, System::Collections::Generic::IDictionary< TKey, System::Exception^>^ exceptions, bool addToLocalCache) |
Gets values for collection of keys from the local cache or server. More... | |
void | GetAll (System::Collections::Generic::ICollection< TKey >^ keys, System::Collections::Generic::IDictionary< TKey, TValue >^ values, System::Collections::Generic::IDictionary< TKey, System::Exception^>^ exceptions, bool addToLocalCache, Object^ callbackArg) |
Gets values for collection of keys from the local cache or server. More... | |
System::Collections::Generic::ICollection< Client::RegionEntry< TKey, TValue >^> ^ | GetEntries (bool recursive) |
Gets the entries in this region. More... | |
Client::RegionEntry< TKey, TValue > ^ | GetEntry (TKey key) |
Return the meta-object RegionEntry for the given key. More... | |
virtual System::Collections::Generic::IEnumerator< KeyValuePair< TKey, TValue > > ^ | GetEnumerator () |
Returns an enumerator that iterates through the collection of the region entries. More... | |
virtual System::Collections::IEnumerator ^ | GetEnumeratorOld () |
Returns an enumerator that iterates through the collection of the region entries. More... | |
IRegion< TKey, TValue > ^ | GetLocalView () |
Reteuns an instance of a Region<TKey, TValue> class that executes within a local scope of a process. More... | |
IRegion< TKey, TValue > ^ | GetSubRegion (String^ path) |
Returns the subregion identified by the path, null if no such subregion. More... | |
ISubscriptionService< TKey > ^ | GetSubscriptionService () |
Reteuns an instance of a Region<TKey, TValue> class that implements ISubscriptionService interface This method is applicable only on distributed region & not on local region. More... | |
void | Invalidate (TKey key) |
Invalidates the entry with the specified key, passing the callback argument to any cache listeners that are invoked in the operation. More... | |
void | Invalidate (TKey key, Object^ callbackArg) |
Invalidates the entry with the specified key, passing the callback argument to any cache listeners that are invoked in the operation. More... | |
void | InvalidateRegion () |
Invalidates this region. More... | |
void | InvalidateRegion (Object^ callbackArg) |
Invalidates this region. More... | |
void | Put (TKey key, TValue value) |
Puts a new value into an entry in this region with the specified key. More... | |
void | Put (TKey key, TValue value, Object^ callbackArg) |
Puts a new value into an entry in this region with the specified key, passing the callback argument to any cache writers and cache listeners that are invoked in the operation. More... | |
void | PutAll (IDictionary< TKey, TValue >^ map) |
Puts a (IDictionary) generic collection of key/value pairs in this region. More... | |
void | PutAll (IDictionary< TKey, TValue >^ map, TimeSpan timeout) |
Puts a (IDictionary) generic collection of key/value pairs in this region. More... | |
void | PutAll (IDictionary< TKey, TValue >^ map, TimeSpan timeout, Object^ callbackArg) |
Puts a (IDictionary) generic collection of key/value pairs in this region. More... | |
template<class TResult > | |
ISelectResults< TResult > ^ | Query (String^ predicate) |
Executes the query on the server based on the predicate. More... | |
template<class TResult > | |
ISelectResults< TResult > ^ | Query (String^ predicate, TimeSpan timeout) |
Executes the query on the server based on the predicate. More... | |
void | RemoveAll (System::Collections::Generic::ICollection< TKey >^ keys) |
Removes all of the entries for the specified keys from this region. More... | |
void | RemoveAll (System::Collections::Generic::ICollection< TKey >^ keys, Object^ callbackArg) |
Removes all of the entries for the specified keys from this region. More... | |
Object ^ | SelectValue (String^ predicate) |
Executes the query on the server based on the predicate and returns a single result value. More... | |
Object ^ | SelectValue (String^ predicate, TimeSpan timeout) |
Executes the query on the server based on the predicate and returns a single result value. More... | |
System::Collections::Generic::ICollection< IRegion< TKey, TValue >^> ^ | SubRegions (bool recursive) |
Returns the subregions of this region. More... | |
Properties | |
RegionAttributes< TKey, TValue >^ | Attributes [get] |
Returns the attributes for this region, which can be used to create a new region with Cache.CreateRegion. More... | |
AttributesMutator< TKey, TValue >^ | AttributesMutator [get] |
Return a mutator object for changing a subset of the region attributes. More... | |
virtual TValue | default [TKey] [get, set] |
Gets or sets the element with the specified key. More... | |
String^ | FullPath [get] |
Gets the region's full path, which can be used to get this region object with Cache.GetRegion. More... | |
bool | IsDestroyed [get] |
True if this region has been destroyed. More... | |
virtual bool | IsReadOnly [get] |
This property throws NotImplementedException when called by both local and distributed region instances. More... | |
virtual System::Collections::Generic::ICollection< TKey >^ | Keys [get] |
Gets an ICollection containing the keys of the IDictionary Returns all the keys for this region. More... | |
String^ | Name [get] |
Gets the region name. More... | |
IRegion< TKey, TValue >^ | ParentRegion [get] |
Gets the parent region. More... | |
Apache::Geode::Client::IRegionService^ | RegionService [get] |
Gets the RegionService for this region. More... | |
CacheStatistics^ | Statistics [get] |
Returns the statistics for this region. More... | |
virtual System::Collections::Generic::ICollection< TValue >^ | Values [get] |
Gets an ICollection containing the values in the IDictionary. More... | |
Encapsulates a concrete region of cached data.
Implements generic IDictionary<TKey, TValue> interface class.
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 IRegion 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 spaces and object grouping.
A region's name can be any string, except that it must 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 IRegion.GetSubRegion. You can get the relative path from the root region with IRegion.FullPath. The name separator is used to concatenate all the region names together from the root, starting with the root's subregions.
bool Apache::Geode::Client::IRegion< TKey, TValue >::ContainsValueForKey | ( | TKey | key | ) |
True if the region contains a value for the given key.
This only searches in the local cache.
<remark> For both local & distributed region instances this always searches only in local cache. </remark>
key | key to search for |
IRegion< TKey, TValue > ^ Apache::Geode::Client::IRegion< TKey, TValue >::CreateSubRegion | ( | String^ | subRegionName, |
RegionAttributes< TKey, TValue >^ | attributes | ||
) |
Creates a subregion with the given name and attributes.
subRegionName | new subregion name |
attributes | subregion attributes |
void Apache::Geode::Client::IRegion< TKey, TValue >::DestroyRegion | ( | ) |
Destroys the whole distributed region and provides a user-defined parameter object to any ICacheWriter
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
The region destroy not only destroys the local region but also destroys the server region. For local region instance - destroys the whole local region only For distributed region instance - destroys the whole local region and this operation is also propogated to the Geode cache server to which it is connected.
Does not update any CacheStatistics
.
CacheWriterException | if a CacheWriter aborts the operation; if this occurs some subregions may have already been successfully destroyed. |
CacheListenerException | if CacheListener throws an exception; if this occurs some subregions may have already been successfully invalidated |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
TimeoutException | if the operation timed out |
void Apache::Geode::Client::IRegion< TKey, TValue >::DestroyRegion | ( | Object^ | callbackArg | ) |
Destroys the whole distributed region and provides a user-defined parameter object to any ICacheWriter
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
The region destroy not only destroys the local region but also destroys the server region. For local region instance - destroys the whole local region only For distributed region instance - destroys the whole local region and this operation is also propogated to the Geode cache server to which it is connected.
Does not update any CacheStatistics
.
callbackArg | a user-defined parameter to pass to callback events triggered by this call |
CacheWriterException | if a CacheWriter aborts the operation; if this occurs some subregions may have already been successfully destroyed. |
CacheListenerException | if CacheListener throws an exception; if this occurs some subregions may have already been successfully invalidated |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
TimeoutException | if the operation timed out |
bool Apache::Geode::Client::IRegion< TKey, TValue >::ExistsValue | ( | String^ | predicate | ) |
Executes the query on the server based on the predicate and returns whether any result exists.
Valid only for a Native Client region. This method is applicable only on distributed region & not on local region.
predicate | The query predicate (just the WHERE clause) or the entire query to execute |
IllegalArgumentException | If the predicate is empty. |
IllegalStateException | If some error occurred. |
CacheServerException | If an exception is received from the Java cache server. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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. |
QueryException | If some query error occurred at the server. |
TimeoutException | if the operation timed out |
CacheClosedException | if the cache has been closed |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
bool Apache::Geode::Client::IRegion< TKey, TValue >::ExistsValue | ( | String^ | predicate, |
TimeSpan | timeout | ||
) |
Executes the query on the server based on the predicate and returns whether any result exists.
Valid only for a Native Client region. This method is applicable only on distributed region & not on local region.
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 |
IllegalArgumentException | If the predicate is empty. |
IllegalStateException | If some error occurred. |
CacheServerException | If an exception is received from the Java cache server. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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. |
QueryException | If some query error occurred at the server. |
TimeoutException | if the operation timed out |
CacheClosedException | if the cache has been closed |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
TValue Apache::Geode::Client::IRegion< TKey, TValue >::Get | ( | TKey | key | ) |
Returns the value for the given key, passing the callback argument to any cache loaders or that are invoked in the operation.
For local region instance - returns the value with the specified key from the local cache only. For distributed region instance - 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.LastAccessedTime CacheStatistics.HitCount, CacheStatistics.MissCount, and CacheStatistics.LastModifiedTime (if a new value is loaded) for this region and the entry.
key | key whose associated value is to be returned – the key object must implement the Equals and GetHashCode methods. |
IllegalArgumentException | if key is null |
CacheLoaderException | if CacheLoader throws an exception |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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 the operation timed out |
RegionDestroyedException | if this region has been destroyed |
TValue Apache::Geode::Client::IRegion< TKey, TValue >::Get | ( | TKey | key, |
Object^ | callbackArg | ||
) |
Returns the value for the given key, passing the callback argument to any cache loaders or that are invoked in the operation.
For local region instance - returns the value with the specified key from the local cache only. For distributed region instance - 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.LastAccessedTime CacheStatistics.HitCount, CacheStatistics.MissCount, and CacheStatistics.LastModifiedTime (if a new value is loaded) for this region and the entry.
key | key whose associated value is to be returned – the key object must implement the Equals and GetHashCode methods. |
callbackArg | An argument passed into the CacheLoader if loader is used. Has to be Serializable (i.e. implement ISerializable ); can be null. |
IllegalArgumentException | if key is null |
CacheLoaderException | if CacheLoader throws an exception |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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 the operation timed out |
RegionDestroyedException | if this region has been destroyed |
void Apache::Geode::Client::IRegion< TKey, TValue >::GetAll | ( | System::Collections::Generic::ICollection< TKey >^ | keys, |
System::Collections::Generic::IDictionary< TKey, TValue >^ | values, | ||
System::Collections::Generic::IDictionary< TKey, System::Exception^>^ | exceptions | ||
) |
Gets values for collection of keys from the local cache or server.
If value for a key is not present locally then it is requested from the java server. The value returned is not copied, so multi-threaded applications should not modify the value directly, but should use the update methods. For local region instance - this method is not applicable. Updates the CacheStatistics.LastAccessedTime and CacheStatistics.HitCount and CacheStatistics.MissCount for this region and the entry.
keys | the collection of keys |
values | output parameter that provides the map of keys to respective values; when this is NULL then an IllegalArgumentException is thrown. |
exceptions | output parameter that provides the map of keys to any exceptions while obtaining the key; ignored if this is NULL |
IllegalArgumentException | If the collection of keys is null or empty, or values argument is null. |
CacheServerException | If an exception is received from the Java cache server while processing the request. |
NotConnectedException | if region is not connected to the cache because the client cannot establish usable connections to any of the given servers For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
RegionDestroyedException | If region destroy is pending. |
TimeoutException | if operation timed out. |
UnknownException | For other exceptions. |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
void Apache::Geode::Client::IRegion< TKey, TValue >::GetAll | ( | System::Collections::Generic::ICollection< TKey >^ | keys, |
System::Collections::Generic::IDictionary< TKey, TValue >^ | values, | ||
System::Collections::Generic::IDictionary< TKey, System::Exception^>^ | exceptions, | ||
bool | addToLocalCache | ||
) |
Gets values for collection of keys from the local cache or server.
If value for a key is not present locally then it is requested from the java server. The value returned is not copied, so multi-threaded applications should not modify the value directly, but should use the update methods. For local region instance - this method is not applicable. Updates the CacheStatistics.LastAccessedTime and CacheStatistics.HitCount and CacheStatistics.MissCount for this region and the entry.
keys | the collection of keys |
values | output parameter that provides the map of keys to respective values; ignored if NULL; when this is NULL then at least the addToLocalCache parameter should be true and caching should be enabled for the region to get values into the region otherwise an IllegalArgumentException is thrown. |
exceptions | output parameter that provides the map of keys to any exceptions while obtaining the key; ignored if this is NULL |
addToLocalCache | true if the obtained values have also to be added to the local cache |
IllegalArgumentException | If the collection of keys is null or empty. Other invalid case is when the values parameter is NULL, and either addToLocalCache is false or caching is disabled for this region. |
CacheServerException | If an exception is received from the Java cache server while processing the request. |
NotConnectedException | if region is not connected to the cache because the client cannot establish usable connections to any of the given servers For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
RegionDestroyedException | If region destroy is pending. |
TimeoutException | if operation timed out. |
UnknownException | For other exceptions. |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
void Apache::Geode::Client::IRegion< TKey, TValue >::GetAll | ( | System::Collections::Generic::ICollection< TKey >^ | keys, |
System::Collections::Generic::IDictionary< TKey, TValue >^ | values, | ||
System::Collections::Generic::IDictionary< TKey, System::Exception^>^ | exceptions, | ||
bool | addToLocalCache, | ||
Object^ | callbackArg | ||
) |
Gets values for collection of keys from the local cache or server.
If value for a key is not present locally then it is requested from the java server. The value returned is not copied, so multi-threaded applications should not modify the value directly, but should use the update methods. For local region instance - this method is not applicable. Updates the CacheStatistics.LastAccessedTime and CacheStatistics.HitCount and CacheStatistics.MissCount for this region and the entry.
keys | the collection of keys |
values | output parameter that provides the map of keys to respective values; ignored if NULL; when this is NULL then at least the addToLocalCache parameter should be true and caching should be enabled for the region to get values into the region otherwise an IllegalArgumentException is thrown. |
exceptions | output parameter that provides the map of keys to any exceptions while obtaining the key; ignored if this is NULL |
addToLocalCache | true if the obtained values have also to be added to the local cache |
callbackArg | a user-defined parameter to pass to callback events triggered by this method |
IllegalArgumentException | If the collection of keys is null or empty. Other invalid case is when the values parameter is NULL, and either addToLocalCache is false or caching is disabled for this region. |
CacheServerException | If an exception is received from the Java cache server while processing the request. |
NotConnectedException | if region is not connected to the cache because the client cannot establish usable connections to any of the given servers For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
RegionDestroyedException | If region destroy is pending. |
TimeoutException | if operation timed out. |
UnknownException | For other exceptions. |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
System::Collections::Generic::ICollection< Client::RegionEntry< TKey, TValue >^> ^ Apache::Geode::Client::IRegion< TKey, TValue >::GetEntries | ( | bool | recursive | ) |
Gets the entries in this region.
For both local & distributed region instances, this operation happens in local cache only.
recursive | if true, also return all nested subregion entries |
Client::RegionEntry< TKey, TValue > ^ Apache::Geode::Client::IRegion< TKey, TValue >::GetEntry | ( | TKey | key | ) |
Return the meta-object RegionEntry for the given key.
For both local & distributed region instances, this operation happens in local cache only.
key | key to use |
IllegalArgumentException | key is null |
RegionDestroyedException | region has been destroyed |
|
virtual |
Returns an enumerator that iterates through the collection of the region entries.
This operation is performed entirely in local cache.
The foreach statement of the C# language (for each in C++)hides the complexity of the enumerators. Therefore, using foreach is recommended, instead of directly manipulating the enumerator. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. Therefore, you must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current. Current returns the same object until MoveNext is called. MoveNext sets Current to the next element. If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. Default implementations of collections in the System.Collections.Generic namespace are not synchronized. For both local & distributed region instances, this operation is restricted to local cache only.
InvalidOperationException | if enumerator is before or after the collection and Current method is called on it. |
|
inlinevirtual |
Returns an enumerator that iterates through the collection of the region entries.
This operation is performed entirely in local cache.
The foreach statement of the C# language (for each in C++)hides the complexity of the enumerators. Therefore, using foreach is recommended, instead of directly manipulating the enumerator. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. Therefore, you must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current. Current returns the same object until MoveNext is called. MoveNext sets Current to the next element. If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. For both local & distributed region instances, this operation is restricted to local cache only.
InvalidOperationException | if enumerator is before or after the collection and Current method is called on it. |
IRegion< TKey, TValue > ^ Apache::Geode::Client::IRegion< TKey, TValue >::GetLocalView | ( | ) |
Reteuns an instance of a Region<TKey, TValue> class that executes within a local scope of a process.
This method is applicable only on distributed region & not on local region.
NotSupportedException | if it is called by local region instance Region.GetLocalView |
IRegion< TKey, TValue > ^ Apache::Geode::Client::IRegion< TKey, TValue >::GetSubRegion | ( | String^ | path | ) |
Returns the subregion identified by the path, null if no such subregion.
path | path |
ISubscriptionService< TKey > ^ Apache::Geode::Client::IRegion< TKey, TValue >::GetSubscriptionService | ( | ) |
Reteuns an instance of a Region<TKey, TValue> class that implements ISubscriptionService interface This method is applicable only on distributed region & not on local region.
NotSupportedException | if it is called by local region instance Region.GetLocalView |
void Apache::Geode::Client::IRegion< TKey, TValue >::Invalidate | ( | TKey | key | ) |
Invalidates the entry with the specified key, passing the callback argument to any cache listeners that are invoked in the operation.
Invalidate only removes the value from the entry – the key is kept intact. To completely remove the entry, call Destroy.
For both local & distributed region instaces, invalidate is not propogated to the Geode cache server to which it is connected.
Does not update any CacheStatistics
.
key | key of the value to be invalidated |
IllegalArgumentException | if key is null |
EntryNotFoundException | if this entry does not exist in this region locally |
RegionDestroyedException | if the region is destroyed |
void Apache::Geode::Client::IRegion< TKey, TValue >::Invalidate | ( | TKey | key, |
Object^ | callbackArg | ||
) |
Invalidates the entry with the specified key, passing the callback argument to any cache listeners that are invoked in the operation.
Invalidate only removes the value from the entry – the key is kept intact. To completely remove the entry, call Destroy.
For both local & distributed region instaces, invalidate is not propogated to the Geode cache server to which it is connected.
Does not update any CacheStatistics
.
key | key of the value to be invalidated |
callbackArg | a user-defined parameter to pass to callback events triggered by this method |
IllegalArgumentException | if key is null |
EntryNotFoundException | if this entry does not exist in this region locally |
RegionDestroyedException | if the region is destroyed |
void Apache::Geode::Client::IRegion< TKey, TValue >::InvalidateRegion | ( | ) |
Invalidates this region.
The invalidation will cascade to all the subregions and cached entries. The region and the entries in it will still exist. For local region instance - invalidates this region without distributing to other caches. For distributed region instance - Invalidates this region and this operation is propogated to the Geode cache server to which it is connected.
To remove all the entries and the region, use DestroyRegion.
Does not update any CacheStatistics
.
CacheListenerException | if CacheListener throws an exception; if this occurs some subregions may have already been successfully invalidated |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
RegionDestroyedException | if this region has been destroyed |
void Apache::Geode::Client::IRegion< TKey, TValue >::InvalidateRegion | ( | Object^ | callbackArg | ) |
Invalidates this region.
The invalidation will cascade to all the subregions and cached entries. The region and the entries in it will still exist. For local region instance - invalidates this region without distributing to other caches. For distributed region instance - Invalidates this region and this operation is propogated to the Geode cache server to which it is connected.
To remove all the entries and the region, use DestroyRegion.
Does not update any CacheStatistics
.
callbackArg | user-defined parameter to pass to callback events triggered by this method |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
RegionDestroyedException | if this region has been destroyed |
CacheListenerException | if CacheListener throws an exception; if this occurs some subregions may have already been successfully invalidated |
void Apache::Geode::Client::IRegion< TKey, TValue >::Put | ( | TKey | key, |
TValue | value | ||
) |
Puts a new value into an entry in this region with the specified key.
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. Put is intended for very simple caching situations. In general it is better to create a ICacheLoader
object and allow the cache to manage the creation and loading of objects. For local region instance - Puts a new value into an entry in this region in the local cache only. For distributed region instance - Puts a new value into an entry in this region and this operation is propogated to the Geode cache server to which it is connected.
Updates the CacheStatistics.LastAccessedTime and CacheStatistics.LastModifiedTime for this region and the entry.
If remote server put fails throwing back a CacheServerException
or security exception, then local put is tried to rollback. However, if the entry has overflowed/evicted/expired then the rollback is aborted since it may be due to a more recent notification or update by another thread.
key | a key object associated with the value to be put into this region |
value | the value to be put into this region |
IllegalArgumentException | if key is null |
CacheWriterException | if CacheWriter aborts the operation |
CacheListenerException | if CacheListener throws an exception |
RegionDestroyedException | if region has been destroyed |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
TimeoutException | if the operation timed out |
OutOfMemoryException | if there is not enough memory for the value |
void Apache::Geode::Client::IRegion< TKey, TValue >::Put | ( | TKey | key, |
TValue | value, | ||
Object^ | callbackArg | ||
) |
Puts a new value into an entry in this region with the specified key, passing the callback argument to any cache writers and cache listeners that are invoked in the operation.
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. Put is intended for very simple caching situations. In general it is better to create a ICacheLoader
object and allow the cache to manage the creation and loading of objects. For local region instance - Puts a new value into an entry in this region in the local cache only. For distributed region instance - Puts a new value into an entry in this region and this operation is propogated to the Geode cache server to which it is connected.
Updates the CacheStatistics.LastAccessedTime and CacheStatistics.LastModifiedTime for this region and the entry.
If remote server put fails throwing back a CacheServerException
or security exception, then local put is tried to rollback. However, if the entry has overflowed/evicted/expired then the rollback is aborted since it may be due to a more recent notification or update by another thread.
key | a key object associated with the value to be put into this region. |
value | the value to be put into this region |
callbackArg | argument that is passed to the callback functions |
IllegalArgumentException | if key is null |
CacheWriterException | if CacheWriter aborts the operation |
CacheListenerException | if CacheListener throws an exception |
RegionDestroyedException | if region has been destroyed |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
TimeoutException | if the operation timed out |
OutOfMemoryException | if there is not enough memory for the value |
void Apache::Geode::Client::IRegion< TKey, TValue >::PutAll | ( | IDictionary< TKey, TValue >^ | map | ) |
Puts a (IDictionary) generic collection of key/value pairs in this region.
If there is already an entry associated with any key in the map in this region, the entry's previous value is overwritten. The new values are propogated to the java server to which it is connected. PutAll is intended for speed up large amount of put operation into the same region. For local region instance - this method is not applicable.
map | A map contains entries, i.e. (key, value) pairs. It is generic collection of key/value pairs. Value should not be null in any of the entries. |
NullPointerException | if any value in the map is null |
RegionDestroyedException | if region has been destroyed |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
TimeoutException | if the operation timed out |
OutOfMemoryException | if there is not enough memory for the value |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
void Apache::Geode::Client::IRegion< TKey, TValue >::PutAll | ( | IDictionary< TKey, TValue >^ | map, |
TimeSpan | timeout | ||
) |
Puts a (IDictionary) generic collection of key/value pairs in this region.
If there is already an entry associated with any key in the map in this region, the entry's previous value is overwritten. The new values are propogated to the java server to which it is connected. PutAll is intended for speed up large amount of put operation into the same region. For local region instance - this method is not applicable.
map | A map contains entries, i.e. (key, value) pairs. It is generic collection of key/value pairs. Value should not be null in any of the entries. |
timeout | The time (in seconds) to wait for the PutAll response. It should be less than or equal to 2^31/1000 i.e. 2147483. Optional. |
IllegalArgumentException | If timeout is more than 2^31/1000 i.e. 2147483. |
NullPointerException | if any value in the map is null |
RegionDestroyedException | if region has been destroyed |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
TimeoutException | if the operation timed out |
OutOfMemoryException | if there is not enough memory for the value |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
void Apache::Geode::Client::IRegion< TKey, TValue >::PutAll | ( | IDictionary< TKey, TValue >^ | map, |
TimeSpan | timeout, | ||
Object^ | callbackArg | ||
) |
Puts a (IDictionary) generic collection of key/value pairs in this region.
If there is already an entry associated with any key in the map in this region, the entry's previous value is overwritten. The new values are propogated to the java server to which it is connected. PutAll is intended for speed up large amount of put operation into the same region. For local region instance - this method is not applicable.
map | A map contains entries, i.e. (key, value) pairs. It is generic collection of key/value pairs. Value should not be null in any of the entries. |
timeout | The time (in seconds) to wait for the PutAll response. It should be less than or equal to 2^31/1000 i.e. 2147483. Optional. |
callbackArg | a user-defined parameter to pass to callback events triggered by this method |
IllegalArgumentException | If timeout is more than 2^31/1000 i.e. 2147483. |
NullPointerException | if any value in the map is null |
RegionDestroyedException | if region has been destroyed |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
TimeoutException | if the operation timed out |
OutOfMemoryException | if there is not enough memory for the value |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
ISelectResults< TResult > ^ Apache::Geode::Client::IRegion< TKey, TValue >::Query | ( | String^ | predicate | ) |
Executes the query on the server based on the predicate.
Valid only for a Native Client region. This method is applicable only on distributed region & not on local region.
predicate | The query predicate (just the WHERE clause) or the entire query to execute |
IllegalArgumentException | If the predicate is empty. |
IllegalStateException | If some error occurred. |
CacheServerException | If an exception is received from the Java cache server. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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. |
QueryException | If some query error occurred at the server. |
TimeoutException | if the operation timed out |
CacheClosedException | if the cache has been closed |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
ISelectResults< TResult > ^ Apache::Geode::Client::IRegion< TKey, TValue >::Query | ( | String^ | predicate, |
TimeSpan | timeout | ||
) |
Executes the query on the server based on the predicate.
Valid only for a Native Client region. This method is applicable only on distributed region & not on local region.
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 |
IllegalArgumentException | If the predicate is empty. |
IllegalStateException | If some error occurred. |
CacheServerException | If an exception is received from the Java cache server. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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. |
QueryException | If some query error occurred at the server. |
TimeoutException | if the operation timed out |
CacheClosedException | if the cache has been closed |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
void Apache::Geode::Client::IRegion< TKey, TValue >::RemoveAll | ( | System::Collections::Generic::ICollection< TKey >^ | keys | ) |
Removes all of the entries for the specified keys from this region.
The effect of this call is equivalent to that of calling destroy(Object)
on this region once for each key in the specified collection. If an entry does not exist that key is skipped; EntryNotFoundException is not thrown. For local region instance - this method is not applicable. Updates the CacheStatistics.LastAccessedTime and CacheStatistics.HitCount and CacheStatistics.MissCount for this region and the entry.
keys | the collection of keys |
IllegalArgumentException | If the collection of keys is null or empty. |
CacheServerException | If an exception is received from the Java cache server while processing the request. |
NotConnectedException | if region is not connected to the cache because the client cannot establish usable connections to any of the given servers For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
RegionDestroyedException | If region destroy is pending. |
TimeoutException | if operation timed out. |
UnknownException | For other exceptions. |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
void Apache::Geode::Client::IRegion< TKey, TValue >::RemoveAll | ( | System::Collections::Generic::ICollection< TKey >^ | keys, |
Object^ | callbackArg | ||
) |
Removes all of the entries for the specified keys from this region.
The effect of this call is equivalent to that of calling remove(Object)
on this region once for each key in the specified collection. If an entry does not exist that key is skipped; EntryNotFoundException is not thrown. For local region instance - this method is not applicable. Updates the CacheStatistics.LastAccessedTime and CacheStatistics.HitCount and CacheStatistics.MissCount for this region and the entry.
keys | the collection of keys |
callbackArg | an argument that is passed to the callback functions. Optional. |
IllegalArgumentException | If the collection of keys is null or empty. |
CacheServerException | If an exception is received from the Java cache server while processing the request. |
NotConnectedException | if region is not connected to the cache because the client cannot establish usable connections to any of the given servers For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
RegionDestroyedException | If region destroy is pending. |
TimeoutException | if operation timed out. |
UnknownException | For other exceptions. |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
Object ^ Apache::Geode::Client::IRegion< TKey, TValue >::SelectValue | ( | String^ | predicate | ) |
Executes the query on the server based on the predicate and returns a single result value.
Valid only for a Native Client region. This method is applicable only on distributed region & not on local region.
predicate | The query predicate (just the WHERE clause) or the entire query to execute |
IllegalArgumentException | If the predicate is empty. |
IllegalStateException | If some error occurred. |
CacheServerException | If an exception is received from the Java cache server. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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. |
QueryException | If some query error occurred at the server, or more than one result items are available. |
TimeoutException | if the operation timed out |
CacheClosedException | if the cache has been closed |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
Object ^ Apache::Geode::Client::IRegion< TKey, TValue >::SelectValue | ( | String^ | predicate, |
TimeSpan | timeout | ||
) |
Executes the query on the server based on the predicate and returns a single result value.
Valid only for a Native Client region. This method is applicable only on distributed region & not on local region.
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 |
IllegalArgumentException | If the predicate is empty. |
IllegalStateException | If some error occurred. |
CacheServerException | If an exception is received from the Java cache server. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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. |
QueryException | If some query error occurred at the server, or more than one result items are available. |
TimeoutException | if the operation timed out |
CacheClosedException | if the cache has been closed |
NotSupportedException | if it is called by local region instance Region.GetLocalView |
System::Collections::Generic::ICollection< IRegion< TKey, TValue >^> ^ Apache::Geode::Client::IRegion< TKey, TValue >::SubRegions | ( | bool | recursive | ) |
Returns the subregions of this region.
recursive | if true, also return all nested subregions |
RegionDestroyedException | this region has already been destroyed |
|
get |
Returns the attributes for this region, which can be used to create a new region with Cache.CreateRegion.
|
get |
Return a mutator object for changing a subset of the region attributes.
RegionDestroyedException | if the region has been destroyed |
|
getset |
Gets or sets the element with the specified key.
This property provides the ability to access a specific element in the collection by using the following syntax: myCollection[key]. You can also use the Item property to add new elements by setting the value of a key that does not exist in the dictionary; for example, myCollection["myNonexistentKey"] = myValue However, if the specified key already exists in the dictionary, setting the Item property overwrites the old value. In contrast, the Add method does not modify existing elements. This property is applicable to local as well as distributed region. For local region instance - Puts/Gets a new value into an entry in this region in the local cache only. For distributed region instance - Puts/Gets a new value into an entry in this region and this operation is propogated to the Geode cache server to which it is connected.
key | The key of the element to get or set. |
Property Value | The element with the specified key. |
IllegalArgumentException | if key is null |
KeyNotFoundException | If given key was not present in the region and if region is not in secure mode, or if Pool attached with Region is not in multiusersecure mode. |
EntryNotFoundException | if given key's value is null. |
CacheWriterException | if CacheWriter aborts the operation |
CacheListenerException | if CacheListener throws an exception |
RegionDestroyedException | if region has been destroyed |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
TimeoutException | if the operation timed out |
OutOfMemoryException | if there is not enough memory for the value |
CacheLoaderException | if CacheLoader throws an exception |
MessageException | 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. |
|
get |
Gets the region's full path, which can be used to get this region object with Cache.GetRegion.
|
get |
True if this region has been destroyed.
|
get |
This property throws NotImplementedException when called by both local and distributed region instances.
|
get |
Gets an ICollection containing the keys of the IDictionary Returns all the keys for this region.
This includes keys for which the entry is invalid. For local region instance - gets collection of keys from local cache only. For distributed region instance - gets collection of keys from the Geode cache server.
<remark> The order of the keys in the returned ICollection is unspecified, but it is guaranteed to be the same order as the corresponding values in the ICollection returned by the Values property. </remark>
UnsupportedOperationException | if the member type is not Client or region is not a Native Client region. |
CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
NotConnectedException | if not connected to the Geode system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException. |
MessageException | 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 |
|
get |
Gets the region name.
|
get |
Gets the parent region.
RegionDestroyedException | if the region has been destroyed |
|
get |
Gets the RegionService for this region.
|
get |
Returns the statistics for this region.
CacheStatistics
for this regionStatisticsDisabledException | if statistics have been disabled for this region |
|
get |
Gets an ICollection containing the values in the IDictionary.
Returns all values in the local process for this region. No value is included for entries that are invalidated. For both local & distributed region instances, this operation is always local only.
<remark> The order of the values in the returned ICollection is unspecified, but it is guaranteed to be the same order as the corresponding keys in the ICollection returned by the Keys property. </remark>