casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::AsdmStMan Class Reference

The Storage Manager for the main table of a raw ASDM casacore::MS. More...

#include <AsdmStMan.h>

Inheritance diagram for casa::AsdmStMan:
casacore::DataManager

Public Member Functions

 AsdmStMan (const casacore::String &dataManagerName="AsdmStMan")
 Create a Asdm storage manager with the given name. More...
 
 AsdmStMan (const casacore::String &dataManagerName, const casacore::Record &spec)
 Create a Asdm storage manager with the given name. More...
 
 ~AsdmStMan ()
 
virtual casacore::DataManagerclone () const
 Clone this object. More...
 
virtual casacore::String dataManagerType () const
 Get the type name of the data manager (i.e. More...
 
virtual casacore::String dataManagerName () const
 Get the name given to the storage manager (in the constructor). More...
 
virtual casacore::Record dataManagerSpec () const
 casacore::Record a record containing data manager specifications. More...
 
virtual casacore::Bool isRegular () const
 Is this a regular storage manager? It is regular if it allows addition of rows and writing dara in them. More...
 
virtual casacore::Bool canAddRow () const
 The storage manager can add rows, but does nothing. More...
 
virtual casacore::Bool canRemoveRow () const
 The storage manager cannot delete rows. More...
 
virtual casacore::Bool canAddColumn () const
 The storage manager can add columns, which does not really do something. More...
 
virtual casacore::Bool canRemoveColumn () const
 Columns can be removed, but it does not do anything at all. More...
 
casacore::IPosition getShape (casacore::uInt rownr)
 Get the data shape. More...
 
void getData (casacore::uInt rownr, casacore::Complex *buf)
 Get data. More...
 
void getData (casacore::uInt rownr, casacore::Float *buf)
 Get float data. More...
 
casacore::uInt getAsdmStManVersion () const
 
void getBDFNames (casacore::Block< casacore::String > &bDFNames)
 access the references to the ASDM BDFs More...
 
casacore::Bool setBDFNames (casacore::Block< casacore::String > &bDFNames)
 overwrite the BDFNames (casacore::Block needs to have same size as original, returns false otherwise) More...
 
void writeIndex ()
 overwrite the index with the information presently stored in the data manager More...
 
- Public Member Functions inherited from casacore::DataManager
 DataManager ()
 Default constructor. More...
 
virtual ~DataManager ()
 
void dataManagerInfo (Record &info) const
 Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info. More...
 
virtual Record getProperties () const
 Get data manager properties that can be modified. More...
 
virtual void setProperties (const Record &spec)
 Modify data manager properties given in record fields. More...
 
virtual Bool isStorageManager () const
 Is the data manager a storage manager? The default is yes. More...
 
virtual Bool canReallocateColumns () const
 Tell if the data manager wants to reallocate the data manager column objects. More...
 
virtual DataManagerColumnreallocateColumn (DataManagerColumn *column)
 Reallocate the column object if it is part of this data manager. More...
 
uInt sequenceNr () const
 Get the (unique) sequence nr of this data manager. More...
 
uInt ncolumn () const
 Get the nr of columns in this data manager (can be zero). More...
 
Bool asBigEndian () const
 Have the data to be stored in big or little endian canonical format? More...
 
const TSMOptiontsmOption () const
 Get the TSM option. More...
 
MultiFileBasemultiFile ()
 Get the MultiFile pointer (can be 0). More...
 
String keywordName (const String &keyword) const
 Compose a keyword name from the given keyword appended with the sequence number (e.g. More...
 
String fileName () const
 Compose a unique filename from the table name and sequence number. More...
 
ByteIO::OpenOption fileOption () const
 Get the AipsIO option of the underlying file. More...
 
Tabletable () const
 Get the table this object is associated with. More...
 
virtual Bool canRenameColumn () const
 Does the data manager allow to rename columns? (default yes) More...
 
virtual void setMaximumCacheSize (uInt nbytes)
 Set the maximum cache size (in bytes) to be used by a storage manager. More...
 
virtual void showCacheStatistics (std::ostream &) const
 Show the data manager's IO statistics. More...
 
DataManagerColumncreateScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a column in the data manager on behalf of a table column. More...
 
DataManagerColumncreateDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a direct array column. More...
 
DataManagerColumncreateIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create an indirect array column. More...
 
DataManagergetClone () const
 Has the object already been cloned? More...
 
void setClone (DataManager *clone) const
 Set the pointer to the clone. More...
 

Static Public Member Functions

static casacore::DataManagermakeObject (const casacore::String &aDataManType, const casacore::Record &spec)
 Make the object from the type name string. More...
 
static void registerClass ()
 Register the class name and the static makeObject "constructor". More...
 
- Static Public Member Functions inherited from casacore::DataManager
static void registerCtor (const String &type, DataManagerCtor func)
 Register a mapping of a data manager type to its static construction function. More...
 
static DataManagerCtor getCtor (const String &dataManagerType)
 Get the "constructor" of a data manager (thread-safe). More...
 
static Bool isRegistered (const String &dataManagerType)
 Test if a data manager is registered (thread-safe). More...
 
static DataManagerunknownDataManager (const String &dataManagerType, const Record &spec)
 Serve as default function for theirRegisterMap, which catches all unknown data manager types. More...
 

Private Member Functions

 AsdmStMan (const AsdmStMan &that)
 Copy constructor cannot be used. More...
 
AsdmStManoperator= (const AsdmStMan &that)
 Assignment cannot be used. More...
 
virtual casacore::Bool flush (casacore::AipsIO &, casacore::Bool doFsync)
 Flush and optionally fsync the data. More...
 
virtual void create (casacore::uInt nrrow)
 Let the storage manager create files as needed for a new table. More...
 
virtual void open (casacore::uInt nrrow, casacore::AipsIO &)
 Open the storage manager file for an existing table. More...
 
virtual void prepare ()
 Prepare the columns (needed for UvwColumn). More...
 
virtual void resync (casacore::uInt nrrow)
 Resync the storage manager with the new file contents. More...
 
virtual void reopenRW ()
 Reopen the storage manager files for read/write. More...
 
virtual void deleteManager ()
 The data manager will be deleted (because all its columns are requested to be deleted). More...
 
virtual void addRow (casacore::uInt nrrow)
 Add rows to the storage manager. More...
 
virtual void removeRow (casacore::uInt rowNr)
 Delete a row from all columns. More...
 
virtual void addColumn (casacore::DataManagerColumn *)
 Do the final addition of a column. More...
 
virtual void removeColumn (casacore::DataManagerColumn *)
 Remove a column from the data file. More...
 
virtual
casacore::DataManagerColumn
makeScalarColumn (const casacore::String &aName, int aDataType, const casacore::String &aDataTypeID)
 Create a column in the storage manager on behalf of a table column. More...
 
virtual
casacore::DataManagerColumn
makeDirArrColumn (const casacore::String &aName, int aDataType, const casacore::String &aDataTypeID)
 Create a direct array column. More...
 
virtual
casacore::DataManagerColumn
makeIndArrColumn (const casacore::String &aName, int aDataType, const casacore::String &aDataTypeID)
 Create an indirect array column. More...
 
void init ()
 Initialize by reading the index file and opening the BDFs. More...
 
void closeBDF ()
 Close the currently open BDF file. More...
 
casacore::uInt searchIndex (casacore::Int64 rownr)
 Return the entry number in the index containing the row. More...
 
const AsdmIndexfindIndex (casacore::Int64 rownr)
 Return the index block containing the row. More...
 
void getShort (const AsdmIndex &, casacore::Complex *buf, casacore::uInt bl, casacore::uInt spw)
 Get data from the buffer. More...
 
void getInt (const AsdmIndex &, casacore::Complex *buf, casacore::uInt bl, casacore::uInt spw)
 
void getFloat (const AsdmIndex &, casacore::Complex *buf, casacore::uInt bl, casacore::uInt spw)
 
void getAuto (const AsdmIndex &, casacore::Complex *buf, casacore::uInt bl)
 
void getAuto (const AsdmIndex &, casacore::Float *buf, casacore::uInt bl)
 
void setTransposeBLNum (casacore::uInt nBl)
 set transposeBLNum_v More...
 

Private Attributes

casacore::String itsDataManName
 Name of data manager. More...
 
std::vector< AsdmColumn * > itsColumns
 The column objects. More...
 
casacore::Block< casacore::StringitsBDFNames
 
casacore::FiledesIOitsBDF
 
int itsFD
 
int itsOpenBDF
 
casacore::Int64 itsFileOffset
 
casacore::Bool itsDoSwap
 
casacore::Record itsSpec
 
casacore::uInt itsVersion
 
casacore::Int64 itsStartRow
 
casacore::Int64 itsEndRow
 
casacore::uInt itsIndexEntry
 
std::vector< char > itsData
 
std::vector< AsdmIndexitsIndex
 
std::vector< casacore::Int64itsIndexRows
 
casacore::uInt itsNBl
 
std::vector< casacore::uIntitsTransposeBLNum_v
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::DataManager
void decrementNcolumn ()
 Decrement number of columns (in case a column is deleted). More...
 
void setEndian (Bool bigEndian)
 Tell the data manager if big or little endian format is needed. More...
 
void setTsmOption (const TSMOption &tsmOption)
 Tell the data manager which TSM option to use. More...
 
void setMultiFile (MultiFileBase *mfile)
 Tell the data manager that MultiFile can be used. More...
 
virtual Bool hasMultiFileSupport () const
 Does the data manager support use of MultiFile? A derived class has to return True if it can use the MultiFile. More...
 
void throwDataTypeOther (const String &columnName, int dataType) const
 Throw an exception in case data type is TpOther, because the storage managers (and maybe other data managers) do not support such columns. More...
 

Detailed Description

The Storage Manager for the main table of a raw ASDM casacore::MS.

Intended use:

Public interface

Review Status

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

Prerequisite

Etymology

AsdmStMan is the data manager which stores the data for a ASDM MS.

Synopsis

AsdmStMan is a specific storage manager for the main table of a ASDM MS. For performance purposes the raw data from the correlator is directly written to a disk file. However, to be able to use the data directly as a casacore::MeasurementSet, this specific storage manager is created offering access to all mandatory columns in the main table of the MS.

Similar to other storage managers, the AsdmStMan files need to be part of the table directory. There are two files:

The first versions of the data file can only handle regularly shaped data with equal integration times. A future version might be able to deal with varying integration times (depending on baseline length).

Most of the casacore::MS columns (like DATA_DESC_ID) are not stored in the data file; usually they map to the value 0. This is also true for the UVW column, so the UVW coordinates need to be added to the table in a separate step because the online system does not have the resources to do it.

All columns are readonly with the exception of DATA.

Motivation

The common casacore::Table storage managers are too slow for the possibly high output rate of the ASDM correlator.

Example

The following example shows how to create a table and how to attach the storage manager to some columns.

casacore::SetupNewTable newtab("name.data", tableDesc, casacore::Table::New);
AsdmStMan stman; // define storage manager
newtab.bindColumn ("DATA", stman); // bind column to st.man.
newtab.bindColumn ("FLAG", stman); // bind column to st.man.
casacore::Table tab(newtab); // actually create table

Definition at line 122 of file AsdmStMan.h.

Constructor & Destructor Documentation

casa::AsdmStMan::AsdmStMan ( const casacore::String dataManagerName = "AsdmStMan")
explicit

Create a Asdm storage manager with the given name.

If no name is used, it is set to "AsdmStMan"

casa::AsdmStMan::AsdmStMan ( const casacore::String dataManagerName,
const casacore::Record spec 
)

Create a Asdm storage manager with the given name.

The specifications are part of the record (as created by dataManagerSpec).

casa::AsdmStMan::~AsdmStMan ( )
casa::AsdmStMan::AsdmStMan ( const AsdmStMan that)
private

Copy constructor cannot be used.

Member Function Documentation

virtual void casa::AsdmStMan::addColumn ( casacore::DataManagerColumn )
privatevirtual

Do the final addition of a column.

It won't do anything.

Reimplemented from casacore::DataManager.

virtual void casa::AsdmStMan::addRow ( casacore::uInt  nrrow)
privatevirtual

Add rows to the storage manager.

It cannot do it, so it does nothing. This function will be called, because this storage manager is not the only one used in an ASDM MS.

Reimplemented from casacore::DataManager.

virtual casacore::Bool casa::AsdmStMan::canAddColumn ( ) const
virtual

The storage manager can add columns, which does not really do something.

Reimplemented from casacore::DataManager.

virtual casacore::Bool casa::AsdmStMan::canAddRow ( ) const
virtual

The storage manager can add rows, but does nothing.

Reimplemented from casacore::DataManager.

virtual casacore::Bool casa::AsdmStMan::canRemoveColumn ( ) const
virtual

Columns can be removed, but it does not do anything at all.

Reimplemented from casacore::DataManager.

virtual casacore::Bool casa::AsdmStMan::canRemoveRow ( ) const
virtual

The storage manager cannot delete rows.

Reimplemented from casacore::DataManager.

virtual casacore::DataManager* casa::AsdmStMan::clone ( ) const
virtual

Clone this object.

Implements casacore::DataManager.

void casa::AsdmStMan::closeBDF ( )
private

Close the currently open BDF file.

virtual void casa::AsdmStMan::create ( casacore::uInt  nrrow)
privatevirtual

Let the storage manager create files as needed for a new table.

This allows a column with an indirect array to create its file.

Implements casacore::DataManager.

virtual casacore::String casa::AsdmStMan::dataManagerName ( ) const
virtual

Get the name given to the storage manager (in the constructor).

Reimplemented from casacore::DataManager.

virtual casacore::Record casa::AsdmStMan::dataManagerSpec ( ) const
virtual

casacore::Record a record containing data manager specifications.

Reimplemented from casacore::DataManager.

virtual casacore::String casa::AsdmStMan::dataManagerType ( ) const
virtual

Get the type name of the data manager (i.e.

AsdmStMan).

Implements casacore::DataManager.

virtual void casa::AsdmStMan::deleteManager ( )
privatevirtual

The data manager will be deleted (because all its columns are requested to be deleted).

So clean up the things needed (e.g. delete files).

Implements casacore::DataManager.

const AsdmIndex& casa::AsdmStMan::findIndex ( casacore::Int64  rownr)
private

Return the index block containing the row.

It sets itsIndexEntry to that block.

virtual casacore::Bool casa::AsdmStMan::flush ( casacore::AipsIO ,
casacore::Bool  doFsync 
)
privatevirtual

Flush and optionally fsync the data.

It does nothing, and returns false.

Implements casacore::DataManager.

casacore::uInt casa::AsdmStMan::getAsdmStManVersion ( ) const
inline

Definition at line 200 of file AsdmStMan.h.

void casa::AsdmStMan::getAuto ( const AsdmIndex ,
casacore::Complex *  buf,
casacore::uInt  bl 
)
private
void casa::AsdmStMan::getAuto ( const AsdmIndex ,
casacore::Float buf,
casacore::uInt  bl 
)
private
void casa::AsdmStMan::getBDFNames ( casacore::Block< casacore::String > &  bDFNames)

access the references to the ASDM BDFs

void casa::AsdmStMan::getData ( casacore::uInt  rownr,
casacore::Complex *  buf 
)

Get data.

void casa::AsdmStMan::getData ( casacore::uInt  rownr,
casacore::Float buf 
)

Get float data.

void casa::AsdmStMan::getFloat ( const AsdmIndex ,
casacore::Complex *  buf,
casacore::uInt  bl,
casacore::uInt  spw 
)
private
void casa::AsdmStMan::getInt ( const AsdmIndex ,
casacore::Complex *  buf,
casacore::uInt  bl,
casacore::uInt  spw 
)
private
casacore::IPosition casa::AsdmStMan::getShape ( casacore::uInt  rownr)

Get the data shape.

void casa::AsdmStMan::getShort ( const AsdmIndex ,
casacore::Complex *  buf,
casacore::uInt  bl,
casacore::uInt  spw 
)
private

Get data from the buffer.

void casa::AsdmStMan::init ( )
private

Initialize by reading the index file and opening the BDFs.

virtual casacore::Bool casa::AsdmStMan::isRegular ( ) const
virtual

Is this a regular storage manager? It is regular if it allows addition of rows and writing dara in them.


We need to return false here.

Reimplemented from casacore::DataManager.

virtual casacore::DataManagerColumn* casa::AsdmStMan::makeDirArrColumn ( const casacore::String aName,
int  aDataType,
const casacore::String aDataTypeID 
)
privatevirtual

Create a direct array column.

Implements casacore::DataManager.

virtual casacore::DataManagerColumn* casa::AsdmStMan::makeIndArrColumn ( const casacore::String aName,
int  aDataType,
const casacore::String aDataTypeID 
)
privatevirtual

Create an indirect array column.

Implements casacore::DataManager.

static casacore::DataManager* casa::AsdmStMan::makeObject ( const casacore::String aDataManType,
const casacore::Record spec 
)
static

Make the object from the type name string.

This function gets registered in the casacore::DataManager "constructor" map. The caller has to delete the object.

virtual casacore::DataManagerColumn* casa::AsdmStMan::makeScalarColumn ( const casacore::String aName,
int  aDataType,
const casacore::String aDataTypeID 
)
privatevirtual

Create a column in the storage manager on behalf of a table column.

The caller has to delete the newly created object.

Create a scalar column.

Implements casacore::DataManager.

virtual void casa::AsdmStMan::open ( casacore::uInt  nrrow,
casacore::AipsIO  
)
privatevirtual

Open the storage manager file for an existing table.

Implements casacore::DataManager.

AsdmStMan& casa::AsdmStMan::operator= ( const AsdmStMan that)
private

Assignment cannot be used.

virtual void casa::AsdmStMan::prepare ( )
privatevirtual

Prepare the columns (needed for UvwColumn).

Reimplemented from casacore::DataManager.

static void casa::AsdmStMan::registerClass ( )
static

Register the class name and the static makeObject "constructor".

This will make the engine known to the table system.

virtual void casa::AsdmStMan::removeColumn ( casacore::DataManagerColumn )
privatevirtual

Remove a column from the data file.

It won't do anything.

Reimplemented from casacore::DataManager.

virtual void casa::AsdmStMan::removeRow ( casacore::uInt  rowNr)
privatevirtual

Delete a row from all columns.

It cannot do it, so throws an exception.

Reimplemented from casacore::DataManager.

virtual void casa::AsdmStMan::reopenRW ( )
privatevirtual

Reopen the storage manager files for read/write.

It does nothing.

Reimplemented from casacore::DataManager.

virtual void casa::AsdmStMan::resync ( casacore::uInt  nrrow)
privatevirtual

Resync the storage manager with the new file contents.

It does nothing.

Implements casacore::DataManager.

casacore::uInt casa::AsdmStMan::searchIndex ( casacore::Int64  rownr)
private

Return the entry number in the index containing the row.

casacore::Bool casa::AsdmStMan::setBDFNames ( casacore::Block< casacore::String > &  bDFNames)

overwrite the BDFNames (casacore::Block needs to have same size as original, returns false otherwise)

void casa::AsdmStMan::setTransposeBLNum ( casacore::uInt  nBl)
private

set transposeBLNum_v

void casa::AsdmStMan::writeIndex ( )

overwrite the index with the information presently stored in the data manager

Member Data Documentation

casacore::FiledesIO* casa::AsdmStMan::itsBDF
private

Definition at line 342 of file AsdmStMan.h.

casacore::Block<casacore::String> casa::AsdmStMan::itsBDFNames
private

Definition at line 341 of file AsdmStMan.h.

std::vector<AsdmColumn*> casa::AsdmStMan::itsColumns
private

The column objects.

Definition at line 340 of file AsdmStMan.h.

std::vector<char> casa::AsdmStMan::itsData
private

Definition at line 353 of file AsdmStMan.h.

casacore::String casa::AsdmStMan::itsDataManName
private

Name of data manager.

Definition at line 337 of file AsdmStMan.h.

casacore::Bool casa::AsdmStMan::itsDoSwap
private

Definition at line 346 of file AsdmStMan.h.

casacore::Int64 casa::AsdmStMan::itsEndRow
private

Definition at line 351 of file AsdmStMan.h.

int casa::AsdmStMan::itsFD
private

Definition at line 343 of file AsdmStMan.h.

casacore::Int64 casa::AsdmStMan::itsFileOffset
private

Definition at line 345 of file AsdmStMan.h.

std::vector<AsdmIndex> casa::AsdmStMan::itsIndex
private

Definition at line 354 of file AsdmStMan.h.

casacore::uInt casa::AsdmStMan::itsIndexEntry
private

Definition at line 352 of file AsdmStMan.h.

std::vector<casacore::Int64> casa::AsdmStMan::itsIndexRows
private

Definition at line 355 of file AsdmStMan.h.

casacore::uInt casa::AsdmStMan::itsNBl
private

Definition at line 357 of file AsdmStMan.h.

int casa::AsdmStMan::itsOpenBDF
private

Definition at line 344 of file AsdmStMan.h.

casacore::Record casa::AsdmStMan::itsSpec
private

Definition at line 347 of file AsdmStMan.h.

casacore::Int64 casa::AsdmStMan::itsStartRow
private

Definition at line 350 of file AsdmStMan.h.

std::vector<casacore::uInt> casa::AsdmStMan::itsTransposeBLNum_v
private

Definition at line 358 of file AsdmStMan.h.

casacore::uInt casa::AsdmStMan::itsVersion
private

Definition at line 348 of file AsdmStMan.h.


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