VMware Tanzu GemFire .NET Client API Reference

VMware Tanzu GemFire .NET Client: IRegion< TKey, TValue > Interface Template Reference
VMware Tanzu GemFire .NET Client
IRegion< TKey, TValue > Interface Template 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
callbackArgargument 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
keykey 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
GemFireIllegalArgumentExceptionif key is null
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
GemFireResponseExceptionIf 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.
TimeoutExceptionif the operation timed out
GemFireInvalidOperationExceptionIf 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
keykey whose associated value is to be returned – the key object must implement the Equals and GetHashCode methods.
callbackArgargument that is passed to the callback functions
Returns
value, or null if the value is not found and can't be loaded
Exceptions
KeyNotFoundExceptionif key is null
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
GemFireResponseExceptionIf 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.
TimeoutExceptionif the operation timed out
GemFireInvalidOperationExceptionIf 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
keysthe collection of keys
valuesoutput parameter that provides the map of keys to respective values; when this is NULL then an GemFireIllegalArgumentException is thrown.

Updates the metric RegionStats.GetAll and for this region and the entry.

Parameters
exceptionsoutput parameter that provides the map of keys to any exceptions while obtaining the key; ignored if this is NULL
Exceptions
GemFireIllegalArgumentExceptionIf the collection of keys is null or empty, or values argument is null.
GemFireServerExceptionIf an exception is received from the Java cache server while processing the request.
DotNetty.Transport.Channels.ConnectExceptionif region is not connected to the cache because the client cannot establish usable connections to any of the given servers
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
TimeoutExceptionif 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
keysthe collection of keys
valuesoutput parameter that provides the map of keys to respective values; ignored if NULL; when this is NULL then at least the region otherwise an GemFireIllegalArgumentException is thrown.

Updates the metric RegionStats.GetAll and for this region and the entry.

Parameters
exceptionsoutput parameter that provides the map of keys to any exceptions while obtaining the key; ignored if this is NULL
callbackArga user-defined parameter to pass to callback events triggered by this method
Exceptions
GemFireIllegalArgumentExceptionIf the collection of keys is null or empty.
GemFireServerExceptionIf an exception is received from the Java cache server while processing the request.
DotNetty.Transport.Channels.ConnectExceptionif region is not connected to the cache because the client cannot establish usable connections to any of the given servers
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
TimeoutExceptionif 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
keykey of the value to be invalidated
Exceptions
GemFireIllegalArgumentExceptionif key is null
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
See also
ICacheListener<TKey, TValue>.AfterInvalidate(IEntryEvent<TKey, TValue>)

◆ 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
keykey of the value to be invalidated
callbackArga user-defined parameter to pass to callback events triggered by this method
Exceptions
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
See also
ICacheListener<TKey, TValue>.AfterInvalidate(IEntryEvent<TKey, TValue>)

◆ 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
keya key object associated with the value to be put into this region
valuethe value to be put into this region
Exceptions
GemFireIllegalArgumentExceptionif key is null
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Codecs.EncoderExceptiontype being put is unregistered and most likely will contain an inner exception of GemFireUnregisteredTypeException
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
TimeoutExceptionif the operation timed out
OutOfMemoryExceptionif 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
keya key object associated with the value to be put into this region.
valuethe value to be put into this region
callbackArgargument that is passed to the callback functions
Exceptions
GemFireIllegalArgumentExceptionif key is null
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Codecs.EncoderExceptiontype being put is unregistered and most likely will contain an inner exception of GemFireUnregisteredTypeException
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
TimeoutExceptionif the operation timed out
OutOfMemoryExceptionif 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
mapA 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
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Codecs.EncoderExceptiontype being put is unregistered and most likely will contain an inner exception of GemFireUnregisteredTypeException
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
TimeoutExceptionif the operation timed out
See also
IRegion<TKey, TValue>.Put(TKey, TValue)

◆ 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
predicateThe query predicate (just the WHERE clause) or the entire query to execute
Exceptions
GemFireQueryExceptionIf the predicate is empty or null.
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
GemFireResponseExceptionIf 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.
TimeoutExceptionif the operation timed out
CacheClosedExceptionif 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
predicateThe query predicate (just the WHERE clause) or the entire query to execute
timeoutThe time (in seconds) to wait for the query response, optional
Exceptions
GemFireQueryExceptionIf the predicate is empty or null.
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
GemFireResponseExceptionIf 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.
TimeoutExceptionif the operation timed out
CacheClosedExceptionif 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
keythe key of the entry to destroy

Updates the metric RegionStats.Destroys and for this region and the entry.

Exceptions
GemFireInvalidOperationExceptionif region does not exist
GemFireIllegalArgumentExceptionif key is null
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
TimeoutExceptionif the operation timed out
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
See also
ICacheListener<TKey, TValue>.AfterDestroy
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
keythe key of the entry to destroy
callbackArga user-defined parameter to pass to cache writers triggered by this method
Exceptions
GemFireInvalidOperationExceptionif region does not exist
GemFireIllegalArgumentExceptionif key is null
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
TimeoutExceptionif the operation timed out
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
See also
ICacheListener<TKey, TValue>.AfterDestroy
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
keythe key of the entry to Remove
valuethe value of the entry to Remove
callbackArgthe callback for user to pass in, It can also be null

.

Updates the metric RegionStats.Destroys and for this region and the entry.

Exceptions
GemFireIllegalArgumentExceptionif key is null
GemFireServerExceptionIf an exception is received from the Java cache server.
DotNetty.Transport.Channels.ConnectExceptionif not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it.
TimeoutExceptionif the operation timed out
GemFireInvalidOperationExceptionIf 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.
See also
ICacheListener<TKey, TValue>.AfterDestroy

◆ 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
keysthe collection of keys

Updates the metric RegionStats.RemoveAll and for this region and the entry.

Exceptions
GemFireIllegalArgumentExceptionIf the collection of keys is null or empty.
GemFireServerExceptionIf an exception is received from the Java cache server while processing the request.
DotNetty.Transport.Channels.ConnectExceptionif region is not connected to the cache because the client cannot establish usable connections to any of the given servers
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
TimeoutExceptionif operation timed out.
See also
IRegion<TKey, TValue>.Remove(TKey)

◆ 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
keysthe collection of keys
callbackArgan argument that is passed to the callback functions. Optional.

Updates the metric RegionStats.RemoveAll and for this region and the entry.

Exceptions
GemFireIllegalArgumentExceptionIf the collection of keys is null or empty.
GemFireServerExceptionIf an exception is received from the Java cache server while processing the request.
DotNetty.Transport.Channels.ConnectExceptionif region is not connected to the cache because the client cannot establish usable connections to any of the given servers
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException
TimeoutExceptionif operation timed out.
See also
IRegion<TKey, TValue>.Remove(TKey)

Property Documentation

◆ FullPath

string IRegion< TKey, TValue >.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

string IRegion< TKey, TValue >.Name
get

Gets the region name.

Returns
region's name

◆ ParentRegion

IRegion<TKey, TValue> IRegion< TKey, TValue >.ParentRegion
get

Gets the parent region.

Returns
region's parent, if any, or null if this is a root region
Exceptions
GemFireInvalidOperationExceptionIf region destroy is pending. This is maps to org.apache.geode.cache.RegionDestroyedException

◆ Pool

IPool IRegion< TKey, TValue >.Pool
get

Returns this regions Pool

◆ SubscriptionService

ISubscriptionService<TKey> IRegion< TKey, TValue >.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