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

Class with static functions to manipulate a datamanager record. More...

#include <DataManInfo.h>

Static Public Member Functions

static void removeHypercolumns (TableDesc &tabDesc)
 Remove hypercolumn definitions from the table description. More...
 
static void adjustTSM (TableDesc &tabDesc, Record &dminfo)
 Replace TiledDataStMan by TiledShapeStMan in the DataManagerInfo record. More...
 
static Record adjustStMan (const Record &dminfo, const String &dmType, Bool replaceMSM=True)
 Replace non-writable storage managers by the given storage manager (usually StandardStMan or IncrementalStMan). More...
 
static void makeUniqueNames (Record &dminfo)
 Ensure all data manager names in dminfo are unique by adding a unique suffix as needed (using function uniqueName). More...
 
static String uniqueName (const Record &dminfo, const String &name, Int excludeDM=-1)
 Return a unique data manager name by testing if the name already exist in of the the dm-s in the dminfo record. More...
 
static void mergeInfo (Record &, const Record &)
 Merge the second DataManagerInfo record into the first one. More...
 
static Record finalizeMerge (const TableDesc &, const Record &dminfo)
 Finalize the merge by merging the dminfo record with the table description to create the final dminfo record. More...
 
static void adaptNames (Record &dminfo, const Table &)
 Adapt data manager names in dminfo if already used in the table. More...
 
static void setTiledStMan (Record &dminfo, const Vector< String > &columns, const String &dmType, const String &dmName, const IPosition &defaultTileShape)
 Set the data managers of the given column(s) to the given tiled storage manager (normally TiledShapeStMan or TiledColumnStMan). More...
 
static Vector< StringremoveDminfoColumns (Record &dminfo, const Vector< String > &columns, const String &keepType=String())
 Remove the given columns from the dminfo record and return a vector containing the names of the columns actually removed. More...
 
static void adjustDesc (TableDesc &tabDesc, const Record &dminfo)
 Adjust the data manager types and groups and the hypercolumn definitions to the actual data manager info. More...
 
static void showDataManStats (const Table &, ostream &)
 Show the Table IO statistics. More...
 

Static Private Member Functions

static void mergeColumns (Record &dminfo, uInt dmindex, Record &newdm)
 Merge the column info of data manager definitions. More...
 

Detailed Description

Class with static functions to manipulate a datamanager record.

Intended use:

Public interface

Review Status

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

Prerequisite

Synopsis

DataManInfo is a class to manipulate a datamanager info record and/or table description. A datamanager info record tells how the columns are stored. It is a Record containing the following fields. If omitted, a default is used.

Often an existing table description and datamanager info record are used to construct a new table, but it might be necessary to change it somewhat.

Definition at line 85 of file DataManInfo.h.

Member Function Documentation

static void casacore::DataManInfo::adaptNames ( Record dminfo,
const Table  
)
static

Adapt data manager names in dminfo if already used in the table.

static void casacore::DataManInfo::adjustDesc ( TableDesc tabDesc,
const Record dminfo 
)
static

Adjust the data manager types and groups and the hypercolumn definitions to the actual data manager info.

static Record casacore::DataManInfo::adjustStMan ( const Record dminfo,
const String dmType,
Bool  replaceMSM = True 
)
static

Replace non-writable storage managers by the given storage manager (usually StandardStMan or IncrementalStMan).

It is possible to specify the new data manager type to use. This is needed for special storage managers like LofarStMan. If replaceMSM is set, MemoryStMan is also replaced.

static void casacore::DataManInfo::adjustTSM ( TableDesc tabDesc,
Record dminfo 
)
static

Replace TiledDataStMan by TiledShapeStMan in the DataManagerInfo record.

Since TiledShapeStMan does not support ID columns, they are adjusted as well in tabDesc and dminfo.

static Record casacore::DataManInfo::finalizeMerge ( const TableDesc ,
const Record dminfo 
)
static

Finalize the merge by merging the dminfo record with the table description to create the final dminfo record.

The final dminfo record gets all columns in the TableDesc object. The given dminfo object is leading in determining a column's data manager. If not present, the data manager type given in the TableDesc is used. If empty, StandardStMan is used.

static void casacore::DataManInfo::makeUniqueNames ( Record dminfo)
static

Ensure all data manager names in dminfo are unique by adding a unique suffix as needed (using function uniqueName).

Empty names are set to the name of the first column (DM if no columns).

static void casacore::DataManInfo::mergeColumns ( Record dminfo,
uInt  dmindex,
Record newdm 
)
staticprivate

Merge the column info of data manager definitions.

It is used by mergeInfo to merge the new dm definitions into the existing one defined in dminfo. It is called for each new dm, whose name/type already exists as the dmindex-th record in dminfo. It does two things:

  • Columns mentioned in newdm are removed from dm definitions in dminfo.
  • Columns in the dmindex-th dminfo record are merged into newdm, so mergeInfo can redefine that dm in the overall dminfo.
static void casacore::DataManInfo::mergeInfo ( Record ,
const Record  
)
static

Merge the second DataManagerInfo record into the first one.

If the same column occurs in both records, the second one is used. Columns having the same data manager name are combined in one data manager. If the second one has no name, it is considered to be equal to the first data manager of that type.

static Vector<String> casacore::DataManInfo::removeDminfoColumns ( Record dminfo,
const Vector< String > &  columns,
const String keepType = String() 
)
static

Remove the given columns from the dminfo record and return a vector containing the names of the columns actually removed.

The columns having a data manager matching keepType are not removed. Matching means that the beginning of the data manager name has to match, so "Tiled" matches all tiled storagemanagers.

static void casacore::DataManInfo::removeHypercolumns ( TableDesc tabDesc)
static

Remove hypercolumn definitions from the table description.

static void casacore::DataManInfo::setTiledStMan ( Record dminfo,
const Vector< String > &  columns,
const String dmType,
const String dmName,
const IPosition defaultTileShape 
)
static

Set the data managers of the given column(s) to the given tiled storage manager (normally TiledShapeStMan or TiledColumnStMan).

The columns are combined in a single storage manager, so the function has to be called multiple times if, say, one per column is needed. The columns already having a tiled storage manager are not changed.

static void casacore::DataManInfo::showDataManStats ( const Table ,
ostream &   
)
static

Show the Table IO statistics.

static String casacore::DataManInfo::uniqueName ( const Record dminfo,
const String name,
Int  excludeDM = -1 
)
static

Return a unique data manager name by testing if the name already exist in of the the dm-s in the dminfo record.

If so, a suffix _i is added where i makes the name unique. The excludeDM-th dm is excluded, so comparing to itself can be avoided.


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