The actions that can be performed deal with the caches used in a tiled storage manager. Per hypercube a cache is used to keep as many tiles in memory as needed for efficient access to the data. The cache size needed is calculated automatically. However, it may be possible that a cache uses too much memory. Therefore a maximum cache size can be specified, which can be done in 2 ways:
for (uInt i3=0; i3<42; i3++) for (uInt i2=0; i2<30; i2++) for (uInt i1=0; i1<20; i1++) for (uInt i0=0; i0<12; i0++) do something with data[i0,i1,i2,i3]it is clear that it is best to have a cache which can contain at least 3*4*5 tiles. In that way each tile is read only once resulting in 360 reads.
Apart from setting the maximum cache size, one can also clear the caches. This can be useful to free memory when an iteration through the data in the tiled storage manager has been done completely. Clearing the caches also clears their statistics (see below).
Showing the statistics of the caches used by a tiled storage manager is possible. Per cache it shows the number of tiles accessed and the number of tiles actually read, written, or initialized. The hit ratio gives a good idea of the cache behaviour.
Note that the maximum cache size is not an absolute maximum. When the optimal number of tiles do not fit, it is tried if they fit when using an overdrawn of maximum 10%. If so, it uses that overdrawn. If not, it uses the maximum cache size.
A few functions exist to get information about a hypercube. The 'get' functions get the information for the given hypercube, while similar functions without the 'get' prefix do the same for the given row.
// Open a table. Table table("someName.data"); // Set the maximum cache size of its tiled hypercube storage // manager TSMExample to 0.5 Mb. ROTiledStManAccessor accessor(table, "TSMExample"); accessor.setMaximumCacheSize (512*1024);
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 TiledDataStManAccessor object.
Copy constructor (reference semantics).
Assignment (reference semantics).
Set the maximum cache size (in bytes) to be used by a hypercube in the storage manager. Note that each hypercube has its own cache. 0 means unlimited. The initial maximum cache size is 1 Mb. The maximum cache size given in this way is not persistent. Only the maximum cache size given to the constructors of the tiled storage managers, is persistent.
Get the maximum cache size (in bytes).
Get the current cache size (in buckets) for the hypercube in the given row.
Get the hypercube shape of the data in the given row.
Get the tile shape of the data in the given row.
Get the bucket size (in bytes) of the hypercube in the given row.
Get coordinate and id values of the hypercube in the given row.
Return the number of hypercubes.
Get the current cache size (in buckets) for the given hypercube.
Get the shape of the given hypercube.
Get the tile shape of the given hypercube.
Get the bucket size (in bytes) of the given hypercube.
Get coordinate and id values of the given hypercube.
Calculate the cache size (in buckets) for accessing the hypercube
containing the given row. It takes the maximum cache size into
account (allowing an overdraft of 10%).
It uses the given axisPath (i.e. traversal order) to determine
the optimum size. A window can be specified to indicate that only
the given subset of the hypercube will be accessed. The window
defaults to the entire hypercube.
The length of the slice and window arguments and axisPath
must be less or equal to the dimensionality of the hypercube.
The non-specified windowStart parts default to 0.
The non-specified windowLength parts default to
the hypercube shape.
The non-specified sliceShape parts default to 1.
Axispath = [2,0,1] indicates that the z-axis changes most rapidly,
thereafter x and y. An axis can occur only once in the axisPath.
The non-specified axisPath parts get the natural order.
E.g. in the previous example axisPath=[2] defines the same path.
When forceSmaller is False, the cache is not resized when the
new size is smaller.
Set the cache size using the corresponding calcCacheSize function mentioned above.
Set the cache size for accessing the hypercube containing the given row.
When the give cache size exceeds the maximum cache size with more
than 10%, the maximum cache size is used instead.
When forceSmaller is False, the cache is not resized when the
new size is smaller.
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.