VMware Tanzu GemFire .NET Client API Reference
Encapsulates a concrete region of cached data. More...
Inherited by ProxyRegion< TKey, TValue >.
Public Member Functions | |
| bool | Remove (TKey key, object callbackArg) |
| Removes the entry with the specified key, passing the callback argument to any cache writers that are invoked in the operation. More... | |
| bool | Remove (TKey key) |
| Removes the entry with the specified key More... | |
| void | Clear (object callbackArg) |
| remove all entries in the region. More... | |
| void | Clear () |
| remove all entries in the region. More... | |
| bool | Remove (TKey key, TValue value, object callbackArg) |
| Removes the entry with the specified key and value, passing the callback argument to any cache writers that are invoked in the operation. 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 | Put (TKey key, TValue value) |
| Puts a new value into an entry in this region with the specified key. 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... | |
| 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... | |
| void | Invalidate (TKey key) |
| Invalidates the entry with the specified key. 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 | PutAll (IReadOnlyDictionary< TKey, TValue > map) |
| Puts a (IReadOnlyDictionary) generic collection of key/value pairs in this region. More... | |
| void | RemoveAll (IReadOnlyCollection< 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 remove(object) on this region once for each key in the specified collection. If an entry does not exist that key is skipped More... | |
| void | RemoveAll (IReadOnlyCollection< 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 More... | |
| void | GetAll (ICollection< TKey > keys, IDictionary< TKey, TValue > values, IDictionary< TKey, 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. More... | |
| void | GetAll (ICollection< TKey > keys, IDictionary< TKey, TValue > values, IDictionary< TKey, Exception > exceptions, 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. More... | |
| IReadOnlyCollection< TResult > | Query< TResult > (string predicate) |
| Executes the query on the server based on the predicate. This method is applicable only on distributed region and not on local region. More... | |
| IReadOnlyCollection< TResult > | Query< TResult > (string predicate, TimeSpan timeout) |
| Executes the query on the server based on the predicate. This method is applicable only on distributed region and not on local region. More... | |
| IRegionFunctionService< TKey, TValue > | GetRegionFunctionService () |
| Returns this regions an instance of IRegionFunctionService More... | |
Properties | |
| string | Name [get] |
| Gets the region name. More... | |
| string | FullPath [get] |
| Gets the region's full path, which can be used to get this region object with ICache.GetRegion. More... | |
| IRegion< TKey, TValue > | ParentRegion [get] |
| Gets the parent region. More... | |
| ISubscriptionService< TKey > | SubscriptionService [get] |
| Returns this regions instance of a ISubscriptionService More... | |
| IPool | Pool [get] |
| Returns this regions Pool More... | |
Detailed Description
Encapsulates a concrete region of cached data.
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.
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 @TODO GEM-16505IRegion<TKey, TValue>. You can get the relative path from the root region with IRegion<TKey, TValue>.FullPath. The region name separator is used to concatenate all the region names together from the root, starting with the root's subregions.
Member Function Documentation
◆ Clear() [1/2]
| void IRegion< TKey, TValue >.Clear | ( | ) |
remove all entries in the region.
◆ Clear() [2/2]
| void IRegion< TKey, TValue >.Clear | ( | object | callbackArg | ) |
remove all entries in the region.
- Parameters
-
callbackArg argument that is passed to the callback functions
◆ Get() [1/2]
| TValue 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.
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 metric RegionStats.Gets and for this region and the entry.
- Parameters
-
key key whose associated value is to be returned – the key object must implement the Equals and GetHashCode methods.
- Returns
- value, or null if the value is not found and can't be loaded
- Exceptions
-
GemFireIllegalArgumentException if key is null GemFireServerException If an exception is received from the Java cache server. DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. GemFireResponseException 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 GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
◆ Get() [2/2]
| TValue 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.
Updates the metric RegionStats.Gets and for this region and the entry.
- Parameters
-
key key whose associated value is to be returned – the key object must implement the Equals and GetHashCode methods. callbackArg argument that is passed to the callback functions
- Returns
- value, or null if the value is not found and can't be loaded
- Exceptions
-
KeyNotFoundException if key is null GemFireServerException If an exception is received from the Java cache server. DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. GemFireResponseException 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 GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
- See also
- IRegion<TKey, TValue>.Get(TKey)
◆ GetAll() [1/2]
| void IRegion< TKey, TValue >.GetAll | ( | ICollection< TKey > | keys, |
| IDictionary< TKey, TValue > | values, | ||
| IDictionary< TKey, 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.
- Parameters
-
keys the collection of keys values output parameter that provides the map of keys to respective values; when this is NULL then an GemFireIllegalArgumentExceptionis thrown.
Updates the metric RegionStats.GetAll and for this region and the entry.
- Parameters
-
exceptions output parameter that provides the map of keys to any exceptions while obtaining the key; ignored if this is NULL
- Exceptions
-
GemFireIllegalArgumentException If the collection of keys is null or empty, or valuesargument is null.GemFireServerException If an exception is received from the Java cache server while processing the request. DotNetty.Transport.Channels.ConnectException if region is not connected to the cache because the client cannot establish usable connections to any of the given servers GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException TimeoutException if operation timed out.
- See also
- IRegion<TKey, TValue>.Get(TKey)
◆ GetAll() [2/2]
| void IRegion< TKey, TValue >.GetAll | ( | ICollection< TKey > | keys, |
| IDictionary< TKey, TValue > | values, | ||
| IDictionary< TKey, Exception > | exceptions, | ||
| 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.
- Parameters
-
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 region otherwise an GemFireIllegalArgumentExceptionis thrown.
Updates the metric RegionStats.GetAll and for this region and the entry.
- Parameters
-
exceptions output parameter that provides the map of keys to any exceptions while obtaining the key; ignored if this is NULL callbackArg a user-defined parameter to pass to callback events triggered by this method
- Exceptions
-
GemFireIllegalArgumentException If the collection of keys is null or empty. GemFireServerException If an exception is received from the Java cache server while processing the request. DotNetty.Transport.Channels.ConnectException if region is not connected to the cache because the client cannot establish usable connections to any of the given servers GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException TimeoutException if operation timed out.
- See also
- IRegion<TKey, TValue>.Get(TKey)
◆ GetRegionFunctionService()
| IRegionFunctionService<TKey, TValue> IRegion< TKey, TValue >.GetRegionFunctionService | ( | ) |
Returns this regions an instance of IRegionFunctionService
◆ Invalidate() [1/2]
| void IRegion< TKey, TValue >.Invalidate | ( | TKey | key | ) |
Invalidates the entry with the specified key.
Invalidate only removes the value from the entry – the key is kept intact. To completely remove the entry, call IRegion<TKey, TValue>.Remove(TKey).
- Parameters
-
key key of the value to be invalidated
- Exceptions
-
GemFireIllegalArgumentException if key is null GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
◆ Invalidate() [2/2]
| void 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 IRegion<TKey, TValue>.Remove(TKey).
- Parameters
-
key key of the value to be invalidated callbackArg a user-defined parameter to pass to callback events triggered by this method
- Exceptions
-
GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
◆ Put() [1/2]
| void IRegion< TKey, TValue >.Put | ( | TKey | key, |
| TValue | value | ||
| ) |
Puts a new value into an entry in this region with the specified key.
Updates the metric RegionStats.Puts and for this region and the entry.
- Parameters
-
key a key object associated with the value to be put into this region value the value to be put into this region
- Exceptions
-
GemFireIllegalArgumentException if key is null GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException GemFireServerException If an exception is received from the Java cache server. DotNetty.Codecs.EncoderException type being put is unregistered and most likely will contain an inner exception of GemFireUnregisteredTypeException DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. TimeoutException if the operation timed out OutOfMemoryException if there is not enough memory for the value
◆ Put() [2/2]
| void 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.
Updates the metric RegionStats.Puts and for this region and the entry.
- Parameters
-
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
- Exceptions
-
GemFireIllegalArgumentException if key is null GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException GemFireServerException If an exception is received from the Java cache server. DotNetty.Codecs.EncoderException type being put is unregistered and most likely will contain an inner exception of GemFireUnregisteredTypeException DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. TimeoutException if the operation timed out OutOfMemoryException if there is not enough memory for the value
◆ PutAll()
| void IRegion< TKey, TValue >.PutAll | ( | IReadOnlyDictionary< TKey, TValue > | map | ) |
Puts a (IReadOnlyDictionary) 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.
Updates the metric RegionStats.PutAll and for this region and the entry.
- Parameters
-
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.
- Exceptions
-
GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException GemFireServerException If an exception is received from the Java cache server. DotNetty.Codecs.EncoderException type being put is unregistered and most likely will contain an inner exception of GemFireUnregisteredTypeException DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. TimeoutException if the operation timed out
◆ Query< TResult >() [1/2]
| IReadOnlyCollection<TResult> IRegion< TKey, TValue >.Query< TResult > | ( | string | predicate | ) |
Executes the query on the server based on the predicate. This method is applicable only on distributed region and not on local region.
- Parameters
-
predicate The query predicate (just the WHERE clause) or the entire query to execute
- Exceptions
-
GemFireQueryException If the predicate is empty or null. GemFireServerException If an exception is received from the Java cache server. DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. GemFireResponseException 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 CacheClosedException if the cache has been closed
- Returns
- The SelectResults which can either be a ResultSet or a StructSet.
◆ Query< TResult >() [2/2]
| IReadOnlyCollection<TResult> IRegion< TKey, TValue >.Query< TResult > | ( | string | predicate, |
| TimeSpan | timeout | ||
| ) |
Executes the query on the server based on the predicate. This method is applicable only on distributed region and not on local 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
- Exceptions
-
GemFireQueryException If the predicate is empty or null. GemFireServerException If an exception is received from the Java cache server. DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. GemFireResponseException 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 CacheClosedException if the cache has been closed
- Returns
- The SelectResults which can either be a ResultSet or a StructSet.
◆ Remove() [1/3]
| bool IRegion< TKey, TValue >.Remove | ( | TKey | key | ) |
Removes the entry with the specified key
Removes not only the value, but also the key and entry from this region.
- Parameters
-
key the key of the entry to destroy
Updates the metric RegionStats.Destroys and for this region and the entry.
- Exceptions
-
GemFireInvalidOperationException if region does not exist GemFireIllegalArgumentException if key is null GemFireServerException If an exception is received from the Java cache server. DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. TimeoutException if the operation timed out GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
- Returns
- true if the element is successfully removed; otherwise, false.
◆ Remove() [2/3]
| bool IRegion< TKey, TValue >.Remove | ( | TKey | key, |
| object | callbackArg | ||
| ) |
Removes the entry with the specified key, passing the callback argument to any cache writers that are invoked in the operation.
Removes not only the value, but also the key and entry from this region.
- Parameters
-
key the key of the entry to destroy callbackArg a user-defined parameter to pass to cache writers triggered by this method
- Exceptions
-
GemFireInvalidOperationException if region does not exist GemFireIllegalArgumentException if key is null GemFireServerException If an exception is received from the Java cache server. DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. TimeoutException if the operation timed out GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
- Returns
- true if the element is successfully removed; otherwise, false.
◆ Remove() [3/3]
| bool IRegion< TKey, TValue >.Remove | ( | TKey | key, |
| TValue | value, | ||
| object | callbackArg | ||
| ) |
Removes the entry with the specified key and value, passing the callback argument to any cache writers that are invoked in the operation.
Remove removes not only the value, but also the key and entry from this region.
- Parameters
-
key the key of the entry to Remove value the value of the entry to Remove callbackArg the callback for user to pass in, It can also be null
.
Updates the metric RegionStats.Destroys and for this region and the entry.
- Exceptions
-
GemFireIllegalArgumentException if key is null GemFireServerException If an exception is received from the Java cache server. DotNetty.Transport.Channels.ConnectException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. TimeoutException if the operation timed out GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
- Returns
- true if entry with key and its value are removed otherwise false.
◆ RemoveAll() [1/2]
| void IRegion< TKey, TValue >.RemoveAll | ( | IReadOnlyCollection< 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 remove(object) on this region once for each key in the specified collection. If an entry does not exist that key is skipped
- Parameters
-
keys the collection of keys
Updates the metric RegionStats.RemoveAll and for this region and the entry.
- Exceptions
-
GemFireIllegalArgumentException If the collection of keys is null or empty. GemFireServerException If an exception is received from the Java cache server while processing the request. DotNetty.Transport.Channels.ConnectException if region is not connected to the cache because the client cannot establish usable connections to any of the given servers GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException TimeoutException if operation timed out.
◆ RemoveAll() [2/2]
| void IRegion< TKey, TValue >.RemoveAll | ( | IReadOnlyCollection< 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
- Parameters
-
keys the collection of keys callbackArg an argument that is passed to the callback functions. Optional.
Updates the metric RegionStats.RemoveAll and for this region and the entry.
- Exceptions
-
GemFireIllegalArgumentException If the collection of keys is null or empty. GemFireServerException If an exception is received from the Java cache server while processing the request. DotNetty.Transport.Channels.ConnectException if region is not connected to the cache because the client cannot establish usable connections to any of the given servers GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException TimeoutException if operation timed out.
Property Documentation
◆ FullPath
|
get |
Gets the region's full path, which can be used to get this region object with ICache.GetRegion.
- Returns
- region's pathname
◆ Name
|
get |
Gets the region name.
- Returns
- region's name
◆ ParentRegion
Gets the parent region.
- Returns
- region's parent, if any, or null if this is a root region
- Exceptions
-
GemFireInvalidOperationException If region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
◆ Pool
◆ SubscriptionService
|
get |
Returns this regions instance of a ISubscriptionService
The documentation for this interface was generated from the following file:
- gemfire.client/Interfaces/IRegion.cs

