An application plug-in that can be installed on a region. Loaders facilitate loading of data into the cache. When an application does a lookup for a key in a region and it does not exist, the system checks to see if any loaders are available for the region in the system and invokes them to get the value for the key into the cache. Allows data to be loaded from a 3rd party data source and placed into the region When Region::get is called for a region entry that has a nullptr
value, the CacheLoader::load method of the region's cache loader is invoked. The load
method creates the value for the desired key by performing an operation such as a database query.
- See also
- RegionAttributesFactory::setCacheLoader
-
RegionAttributes::getCacheLoader
virtual void apache::geode::client::CacheLoader::close |
( |
Region & |
rp | ) |
|
|
virtual |
Called when the region containing this callback is destroyed, when the cache is closed.
Implementations should clean up any external resources, such as database connections. Any runtime exceptions this method throws will be logged.
It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.
- Parameters
-
- See also
- Cache::close
-
Region::destroyRegion