IncrStManAccessor.h
Classes
- ROIncrementalStManAccessor -- Give access to some IncrementalStMan functions (full description)
Interface
- Public Members
- ROIncrementalStManAccessor (const Table& table, const String& dataManagerName)
- ~ROIncrementalStManAccessor()
- ROIncrementalStManAccessor (const ROIncrementalStManAccessor& that)
- ROIncrementalStManAccessor& operator= (const ROIncrementalStManAccessor& that)
- void setCacheSize (uInt nbuckets)
- uInt cacheSize() const
- void clearCache()
- void showCacheStatistics (ostream& os) const
Prerequisite
Synopsis
The Table system has one or more storage managers underneath.
One of these possible storage managers is the
IncrementalStMan.
This storage manager uses a cache of buckets. The default
cache size is defined when the IncrementalStMan object was
constructed at the time the table was created.
Sometimes it can be useful to change the cache size. E.g. when
the table is accessed in a random way, the hit rate may drop
when the cache is too small. The class ROIncrStManAccessor makes
it possible to change the cache size in a temporary way.
Furthermore this class makes it possible to show the cache size
and to show the cache statistics.
Motivation
In principle a pointer to IncrementalStMan could be used.
However, that would give access to all public functions.
Furthermore it could not distinguish between read/write and readonly
tables.
Example
This example shows how to set the cache size for
the incremental storage manager with the name "ISMExample". The cache
size is not persistent, i.e. when the same table is reopened
at a later time, this cache size is not remembered.
// Open a table.
Table table("someName.data");
// Set the cache size of its incremental storage manager ISMExample
// to 5 buckets.
ROIncrementalStManAccessor accessor(table, "ISMExample");
accessor.setCacheSize (5);
Member Description
Construct the object for the data manager in the table.
An exception is thrown if the data manager type does not
match the type of this ROIncrementalStManAccessor object.
Copy constructor (reference semantics).
ROIncrementalStManAccessor& operator= (const ROIncrementalStManAccessor& that)
Assignment (reference semantics).
Set the cache size (in buckets) to be used by the
storage manager.
The cache size given in this way is not persistent.
Only the cache size given to the constructors of the incremental
storage managers, is persistent.
Get the cache size (in buckets).
Clear the caches used by the hypercubes in this storage manager.
It will flush the caches as needed and remove all buckets from them
resulting in a possibly large drop in memory used.
Show the statistics for each cache used by this storage manager.