casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
casacore::ROStandardStManAccessor Class Reference

Give access to some StandardStMan functions. More...

#include <StandardStManAccessor.h>

Inheritance diagram for casacore::ROStandardStManAccessor:
casacore::RODataManAccessor

Public Member Functions

 ROStandardStManAccessor (const Table &table, const String &name, Bool byColumn=False)
 Construct the object for a data manager in the table given the name of the data manager or the column. More...
 
virtual ~ROStandardStManAccessor ()
 
 ROStandardStManAccessor (const ROStandardStManAccessor &that)
 Copy constructor (reference semantics). More...
 
ROStandardStManAccessoroperator= (const ROStandardStManAccessor &that)
 Assignment (reference semantics). More...
 
void setCacheSize (uInt aSize, Bool canExceedNrBuckets=True)
 Set the cache size (in buckets) to be used by the storage manager. More...
 
uInt getCacheSize () const
 Get the cache size (in buckets). More...
 
void clearCache ()
 Clear the cache used by this storage manager. More...
 
void showBaseStatistics (ostream &anOs) const
 Show the statistics for the base class. More...
 
void showIndexStatistics (ostream &anOs) const
 Show the statistics for each index used by this storage manager. More...
 
- Public Member Functions inherited from casacore::RODataManAccessor
 RODataManAccessor ()
 Construct an empty object. More...
 
 RODataManAccessor (const Table &table, const String &name, Bool byColumn)
 Construct the accessor object for a data manager in the table. More...
 
virtual ~RODataManAccessor ()
 
void setProperties (const Record &) const
 Set data manager properties using the fields in the record. More...
 
Record getProperties () const
 Get data manager properties as a record. More...
 
String dataManagerType () const
 Get the data manager type. More...
 
String dataManagerName () const
 Get the data manager name. More...
 
uInt dataManagerSeqNr () const
 Get the data manager sequence nr. More...
 
void showCacheStatistics (ostream &os) const
 Show IO statistics. More...
 

Private Attributes

SSMBaseitsSSMPtr
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::RODataManAccessor
DataManagerbaseDataManager () const
 Get the data manager for the given data manager or column name. More...
 

Detailed Description

Give access to some StandardStMan functions.

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tStandardStMan

Prerequisite

Synopsis

The Table system has one or more storage managers underneath. One of these possible storage managers is the StandardStMan. This storage manager uses a cache of buckets. The default cache size is defined when the StandardStMan 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 ROStandardStManAccessor makes it possible to change the cache size in a temporary way.
It is also possible to get the cache size.

Furthermore it is possible to show some statistics (about the cache and the internals of SSM classes).

Motivation

In principle a pointer to StandardStMan 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 standard storage manager with the name "SSMExample". 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 standard storage manager SSMExample
// to 5 buckets.
ROStandardStManAccessor accessor(table, "SSMExample");
accessor.setCacheSize (5);

Definition at line 103 of file StandardStManAccessor.h.

Constructor & Destructor Documentation

casacore::ROStandardStManAccessor::ROStandardStManAccessor ( const Table table,
const String name,
Bool  byColumn = False 
)

Construct the object for a data manager in the table given the name of the data manager or the column.

An exception is thrown if the data manager type is not the incremental storage manager.

virtual casacore::ROStandardStManAccessor::~ROStandardStManAccessor ( )
virtual
casacore::ROStandardStManAccessor::ROStandardStManAccessor ( const ROStandardStManAccessor that)

Copy constructor (reference semantics).

Member Function Documentation

void casacore::ROStandardStManAccessor::clearCache ( )

Clear the cache used by this storage manager.

It will flush the cache as needed and remove all buckets from it resulting in a drop in memory used.

uInt casacore::ROStandardStManAccessor::getCacheSize ( ) const

Get the cache size (in buckets).

ROStandardStManAccessor& casacore::ROStandardStManAccessor::operator= ( const ROStandardStManAccessor that)

Assignment (reference semantics).

void casacore::ROStandardStManAccessor::setCacheSize ( uInt  aSize,
Bool  canExceedNrBuckets = True 
)

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 Standard storage managers, is persistent. If canExceedNrBuckets=True, the given cache size can be larger than the nr of buckets in the file. In this way the cache can be made large enough for a future file extension. Otherwise, it is limited to the actual number of buckets. This is useful if one wants the entire file to be cached.

void casacore::ROStandardStManAccessor::showBaseStatistics ( ostream &  anOs) const

Show the statistics for the base class.

void casacore::ROStandardStManAccessor::showIndexStatistics ( ostream &  anOs) const

Show the statistics for each index used by this storage manager.

Member Data Documentation

SSMBase* casacore::ROStandardStManAccessor::itsSSMPtr
private

Definition at line 152 of file StandardStManAccessor.h.


The documentation for this class was generated from the following file: