Regions
You create cache regions either programmatically or through declarative statements in the cache.xml
file. Generally, a cache is organized and populated through a combination of the two approaches.
The region is the core building block of the GemFire distributed system. All cached data is organized into data regions and you do all of your data puts, gets, and querying activities against them.
A distributed region can be either non-partitioned or a partitioned region. See Data Regions for detailed descriptions of both non-partitioned and partitioned regions. Region creation is subject to attribute consistency checks. The requirements for consistency between attributes are detailed both in the API documentation and throughout the discussion of Region Attributes.
-
Declarative region creation involves placing the region’s XML declaration, with the appropriate attribute settings, in the
cache.xml
file that is loaded at cache creation. -
You create regions programmatically with the
regionFactory
class. Invalidating and Destroying Regions
Invalidation marks all entries contained in the region as invalid (with null values). Destruction removes the region and all of its contents from the cache.
-
You can use
Cache::getRegion
to retrieve a reference to a specified region. -
The
Region
API provides asize
method (Size
property for .NET) that gets the size of a region.