Loading...
Searching...
No Matches
casacore::TiledStMan Class Referenceabstract
tables package (libcasa_tables) » DataMan_module

More...

`#include <TiledStMan.h>`

## Public Member Functions

| TiledStMan ()
| Create a TiledStMan.
| TiledStMan (const String &hypercolumnName, uInt maximumCacheSizeMiB)
| Create a TiledStMan storage manager.
virtual | ~TiledStMan ()
| TiledStMan (const TiledStMan &)=delete
| Forbid copy constructor.
TiledStMan & | operator= (const TiledStMan &)=delete
| Forbid assignment.
virtual String | dataManagerName () const
| Get the name given to the storage manager.
void | setDataManagerName (const String &newHypercolumnName)
virtual Record | dataManagerSpec () const
| Return a record containing data manager specifications.
virtual Record | getProperties () const
| Get data manager properties that can be modified.
virtual void | setProperties (const Record &spec)
| Modify data manager properties.
void | setDataChanged ()
| Set the flag to "data has changed since last flush".
virtual void | setMaximumCacheSize (uInt nMiB)
| Set the maximum cache size (in MiB) in a non-persistent way.
uInt | maximumCacheSize () const
| Get the current maximum cache size (in MiB (MibiByte)).
uInt | cacheSize (rownr_t rownr) const
| Get the current cache size (in buckets) for the hypercube in the given row.
const IPosition & | hypercubeShape (rownr_t rownr) const
| Get the hypercube shape of the data in the given row.
const IPosition & | tileShape (rownr_t rownr) const
| Get the tile shape of the data in the given row.
uInt64 | bucketSize (rownr_t rownr) const
| Get the bucket size (in bytes) of the hypercube in the given row.
virtual Bool | canChangeShape () const
| Can the tiled storage manager handle changing array shapes?
virtual Bool | canAccessColumn () const
| Can the tiled storage manager access an entire column.
virtual Bool | hasMultiFileSupport () const
| The data manager supports use of MultiFile.
uInt | calcCacheSize (rownr_t rownr, const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath) const
| Calculate the cache size (in buckets) for accessing the hypercube containing the given row.
void | setCacheSize (rownr_t rownr, const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath, Bool forceSmaller)
| Set the cache size using the calcCacheSize function mentioned above.
void | setCacheSize (rownr_t rownr, uInt nbuckets, Bool forceSmaller)
| Set the cache size for accessing the hypercube containing the given row.
void | setHypercubeCacheSize (uInt hypercube, uInt nbuckets, Bool forceSmaller)
| Sets the cache size using the hypercube instead of the row number.
Bool | userSetCache (rownr_t rownr) const
| Determine if the user set the cache size (using setCacheSize).
void | emptyCaches ()
| Empty the caches used by the hypercubes in this storage manager.
void | showCacheStatistics (ostream &os) const
| Show the statistics of all caches used.
uInt64 | getLengthOffset (uInt64 nrPixels, Block< uInt > &dataOffset, Block< uInt > &localOffset, uInt &localTileLength) const
| Get the length of the data for the given number of pixels.
uInt | nrCoordVector () const
| Get the number of coordinate vectors.
rownr_t | nrow () const
| Get the nr of rows in this storage manager.
Bool | canAddRow () const
| Does the storage manager allow to add rows?
virtual IPosition | defaultTileShape () const
| Get the default tile shape.
uInt | nhypercubes () const
| Return the number of hypercubes.
virtual TSMCube * | singleHypercube ()
| Test if only one hypercube is used by this storage manager.
const TSMCube * | getTSMCube (uInt hypercube) const
| Get the given hypercube.
TSMCube * | getTSMCube (uInt hypercube)
const TSMCube * | getHypercube (rownr_t rownr) const
| Get the hypercube in which the given row is stored.
virtual TSMCube * | getHypercube (rownr_t rownr)=0
virtual TSMCube * | getHypercube (rownr_t rownr, IPosition &position)=0
| Get the hypercube in which the given row is stored.
TSMCube * | makeTSMCube (TSMFile *file, const IPosition &cubeShape, const IPosition &tileShape, const Record &values, Int64 fileOffset=-1)
| Make the correct TSMCube type (depending on tsmOption()).
void | readTile (char *local, const Block< uInt > &localOffset, const char *external, const Block< uInt > &externalOffset, uInt nrpixels)
| Read a tile and convert the data to local format.
void | writeTile (char *external, const Block< uInt > &externalOffset, const char *local, const Block< uInt > &localOffset, uInt nrpixels)
| Write a tile after converting the data to external format.
TSMFile * | getFile (uInt sequenceNumber)
| Get the TSMFile object with the given sequence number.
virtual rownr_t | open64 (rownr_t nrrow, AipsIO &)
| Open the storage manager for an existing table.
virtual rownr_t | resync64 (rownr_t nrrow)
| Resync the storage manager with the new file contents.
virtual void | reopenRW ()
| Reopen all files used in this storage manager for read/write access.
virtual void | deleteManager ()
| The data manager will be deleted (because all its columns are requested to be deleted).
DataManagerColumn * | makeScalarColumn (const String &name, int dataType, const String &dataTypeID)
| Create a column in the storage manager on behalf of a table column.
DataManagerColumn * | makeDirArrColumn (const String &name, int dataType, const String &dataTypeID)
| Create a direct array column.
DataManagerColumn * | makeIndArrColumn (const String &name, int dataType, const String &dataTypeID)
| Create an indirect array column.
Bool | canReallocateColumns () const
| The TiledStMan wants to do reallocateColumn.
DataManagerColumn * | reallocateColumn (DataManagerColumn *column)
| Reallocate the column object if it is part of this data manager.
virtual void | setShape (rownr_t rownr, TSMCube *hypercube, const IPosition &shape, const IPosition &tileShape)
| Set the shape and tile shape of a hypercube.
void | checkCubeShape (const TSMCube *hypercube, const IPosition &cubeShape) const
| Check the shape to be set for a hypercube.
int | coordinateDataType (const String &columnName) const
| Get the data type of the coordinate column with the given name.
void | initCoordinates (TSMCube *hypercube)
| Initialize the new coordinates for the given cube.
const TSMDataColumn * | getDataColumn (uInt colnr) const
| Get pointer to data column object.
Public Member Functions inherited from casacore::DataManager
| DataManager ()
| Default constructor.
virtual | ~DataManager ()
| DataManager (const DataManager &)=delete
| The copy constructor cannot be used for this base class.
DataManager & | operator= (const DataManager &)=delete
| Assignment cannot be used for this base class.
virtual DataManager * | clone () const =0
| Make a clone of the derived object.
virtual String | dataManagerType () const =0
| Return the type name of the data manager (in fact its class name).
void | dataManagerInfo (Record &info) const
| Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
virtual Bool | isStorageManager () const
| Is the data manager a storage manager?
uInt | sequenceNr () const
| Get the (unique) sequence nr of this data manager.
uInt | ncolumn () const
| Get the nr of columns in this data manager (can be zero).
Bool | asBigEndian () const
| Have the data to be stored in big or little endian canonical format?
const TSMOption & | tsmOption () const
| Get the TSM option.
std::shared_ptr< MultiFileBase > | multiFile ()
| Get the MultiFile pointer (can be 0).
String | keywordName (const String &keyword) const
| Compose a keyword name from the given keyword appended with the sequence number (e.g.
String | fileName () const
| Compose a unique filename from the table name and sequence number.
ByteIO::OpenOption | fileOption () const
| Get the AipsIO option of the underlying file.
virtual Bool | isRegular () const
| Is this a regular storage manager?
Table & | table () const
| Get the table this object is associated with.
virtual Bool | canRemoveRow () const
| Does the data manager allow to delete rows?
virtual Bool | canAddColumn () const
| Does the data manager allow to add columns?
virtual Bool | canRemoveColumn () const
| Does the data manager allow to delete columns?
virtual Bool | canRenameColumn () const
| Does the data manager allow to rename columns?
virtual void | showCacheStatistics (std::ostream &) const
| Show the data manager's IO statistics.
DataManagerColumn * | createScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create a column in the data manager on behalf of a table column.
DataManagerColumn * | createDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create a direct array column.
DataManagerColumn * | createIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create an indirect array column.
DataManager * | getClone () const
| Has the object already been cloned?
void | setClone (DataManager *clone) const
| Set the pointer to the clone.

## Static Public Member Functions

static IPosition | makeTileShape (const IPosition &hypercubeShape, Double tolerance=0.5, uInt64 maxNrPixelsPerTile=4 *1024 *1024)
| Derive the tile shape from the hypercube shape for the given number of pixels per tile.
static IPosition | makeTileShape (const IPosition &hypercubeShape, const Vector< double > &weight, const Vector< double > &tolerance, uInt64 maxNrPixelsPerTile=4 *1024 *1024)
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.
static DataManagerCtor | getCtor (const String &dataManagerType)
| Get the "constructor" of a data manager (thread-safe).
static Bool | isRegistered (const String &dataManagerType)
| Test if a data manager is registered (thread-safe).
static DataManager * | unknownDataManager (const String &dataManagerType, const Record &spec)
| Serve as default function for theirRegisterMap, which catches all unknown data manager types.

## Protected Member Functions

void | setPersMaxCacheSize (uInt nMiB)
| Set the persistent maximum cache size (in MiB).
uInt | getBindings (const Vector< String > &columnNames, PtrBlock< TSMColumn * > &colSet, Bool mustExist) const
| Get the bindings of the columns with the given names.
virtual void | setupCheck (const TableDesc &tableDesc, const Vector< String > &dataNames) const
| Function setup calls this function to allow the derived class to check specific information.
virtual const TableDesc & | getDesc () const
| Get the table description needed for the hypercolumn description.
void | checkValues (const PtrBlock< TSMColumn * > &colSet, const Record &values) const
| Check if values are given in the record for all columns in the block.
void | checkCoordinates (const PtrBlock< TSMColumn * > &coordColSet, const IPosition &cubeShape, const Record &values) const
| Check if the coordinate values are correct.
void | checkShapeColumn (const IPosition &shape) const
| Check if the shapes of FixedShape data and coordinate columns match.
void | checkCoordinatesShapes (const TSMCube *hypercube, const IPosition &cubeShape) const
| Check if the cube shape matches that of defined coordinates.
void | checkAddHypercube (const IPosition &cubeShape, const Record &values) const
| Check if the hypercube to be added is correctly defined.
TSMCube * | makeHypercube (const IPosition &cubeShape, const IPosition &tileShape, const Record &values)
| Make a new TSMCube object.
Int | getCubeIndex (const Record &idValues) const
| Get the index of the hypercube with the given id-values.
rownr_t | addedNrrow (const IPosition &shape, uInt incrInLastDim) const
| Determine how many rows need to be added for an extension (in the last dimension) of a hypercube with the given shape.
Bool | flushCaches (Bool fsync)
| Flush the caches of all hypercubes.
virtual void | readHeader (rownr_t nrrow, Bool firstTime)=0
| Let a derived class read the header info.
AipsIO * | headerFileCreate ()
| Create the TSM header file.
AipsIO * | headerFileOpen ()
| Open the TSM header file.
void | headerFilePut (AipsIO &headerFile, uInt64 nrCube)
| Write the data into the header file.
uInt | headerFileGet (AipsIO &headerFile, rownr_t tabNrrow, Bool firstTime, Int extraNdim)
| Read the data from the header file.
void | headerFileClose (AipsIO *headerFile)
| Close the header file.
void | setup (Int extraNdim=-1)
| Set up the TiledStMan variables from the table description.
void | createFile (uInt index)
| Create a TSMFile object and store its pointer at the given index in the block.
int | arrayDataType (int dataType) const
| Convert the scalar data type to an array data type.
Protected Member Functions inherited from casacore::DataManager
void | decrementNcolumn ()
| Decrement number of columns (in case a column is deleted).
void | setEndian (Bool bigEndian)
| Tell the data manager if big or little endian format is needed.
void | setTsmOption (const TSMOption &tsmOption)
| Tell the data manager which TSM option to use.
void | setMultiFile (const std::shared_ptr< MultiFileBase > &mfile)
| Tell the data manager that MultiFile can be used.
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.

## Protected Attributes

String | hypercolumnName_p
| The name of the hypercolumn.
rownr_t | nrrow_p
| The number of rows in the columns.
PtrBlock< TSMColumn * > | colSet_p
| The assembly of all columns.
PtrBlock< TSMDataColumn * > | dataCols_p
| The assembly of all data columns.
PtrBlock< TSMColumn * > | dataColSet_p
PtrBlock< TSMColumn * > | idColSet_p
| The assembly of all id columns.
PtrBlock< TSMColumn * > | coordColSet_p
| The assembly of all coordinate columns.
PtrBlock< TSMFile * > | fileSet_p
| The assembly of all TSMFile objects.
PtrBlock< TSMCube * > | cubeSet_p
| The assembly of all TSMCube objects.
uInt | persMaxCacheSize_p
| The persistent maximum cache size (in MiB) for a hypercube.
uInt | maxCacheSize_p
| The actual maximum cache size for a hypercube (in MiB).
uInt | nrdim_p
| The dimensionality of the hypercolumn.
uInt | nrCoordVector_p
| The number of vector coordinates.
IPosition | fixedCellShape_p
| The fixed cell shape.
Bool | dataChanged_p
| Has any data changed since the last flush?

## Additional Inherited Members

Static Public Attributes inherited from casacore::DataManager
static rownr_t | MAXROWNR32
| Define the highest row number that can be represented as signed 32-bit.

## Detailed Description

Base class for Tiled Storage Manager classes

### Intended use:

Public interface

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25

### Prerequisite

- Description of Tiled Storage Manager in module file Tables.h
- DataManager
- TSMColumn
- ROTiledStManAccessor for a discussion of the maximum cache size

### Synopsis

TiledStMan is the base class for Tiled Storage Managers. A tiled storage manager is capable of storing a hypercolumn (as defined by TableDesc::defineHypercolumn) in one or more hypercubes.
It is not necessary to define a hypercolumn. If not defined, it is assumed that all columns bound to this storage manager are data columns. At least one of the columns must have a fixed dimensionality and is used to determine the hypercube dimnensionality.
The general concept of these storage managers is explained in the Tables module description.

TiledStMan contains all common functions for the different tiled storage managers. In particular, it contains functions to check if the definitions of the shapes of hypercubes, coordinates, and data cells are consistent. It also contains various data members and functions to make them persistent by writing them into an AipsIO stream.

### Motivation

This base class contains the common functionality of all tiled storage managers. The base class is still abstract. Only concrete tiled storage managers derived from it can be instantiated.

Tiled storage managers make access to array data possible with more or less the same efficiency for access along different axes.

Definition at line 104 of file TiledStMan.h.

## Constructor & Destructor Documentation

## TiledStMan() [1/3]

casacore::TiledStMan::TiledStMan | ( |  | ) |

Create a TiledStMan.

Referenced by getHypercube(), getTSMCube(), operator=(), and TiledStMan().

## TiledStMan() [2/3]

casacore::TiledStMan::TiledStMan | ( | const String & | hypercolumnName,
|  | uInt | maximumCacheSizeMiB )

Create a TiledStMan storage manager.

The given maximum cache size (in MibiByte) is persistent, thus will be reused when the table is read back. Note that the class ROTiledStManAccessor allows one to overwrite the maximum cache size temporarily. Its description contains a discussion about the effects of setting a maximum cache.

## ~TiledStMan()

virtual casacore::TiledStMan::~TiledStMan | ( |  | ) |

virtual

## TiledStMan() [3/3]

casacore::TiledStMan::TiledStMan | ( | const TiledStMan & |  | ) |

delete

Forbid copy constructor.

References TiledStMan().

## Member Function Documentation

## addedNrrow()

rownr_t casacore::TiledStMan::addedNrrow | ( | const IPosition & | shape,
|  | uInt | incrInLastDim ) const

protected

Determine how many rows need to be added for an extension (in the last dimension) of a hypercube with the given shape.

References casacore::shape().

## arrayDataType()

int casacore::TiledStMan::arrayDataType | ( | int | dataType | ) | const

protected

Convert the scalar data type to an array data type.

This function is temporary and can disappear when the ColumnDesc classes use type TpArray*.

References casacore::dataType().

## bucketSize()

uInt64 casacore::TiledStMan::bucketSize | ( | rownr_t | rownr | ) | const

Get the bucket size (in bytes) of the hypercube in the given row.

## cacheSize()

uInt casacore::TiledStMan::cacheSize | ( | rownr_t | rownr | ) | const

Get the current cache size (in buckets) for the hypercube in the given row.

## calcCacheSize()

uInt casacore::TiledStMan::calcCacheSize | ( | rownr_t | rownr,
|  | const IPosition & | sliceShape,
|  | const IPosition & | windowStart,
|  | const IPosition & | windowLength,
|  | const IPosition & | axisPath ) const

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 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.
A flag is set indicating that the TSMDataColumn access functions do not need to size the cache.

## canAccessColumn()

virtual Bool casacore::TiledStMan::canAccessColumn | ( |  | ) | const

virtual

Can the tiled storage manager access an entire column.

TiledColumnStMan can always do that. The others might be able to do it (for this time). The default implementation returns True if there is only 1 hypercube.

Reimplemented in casacore::TiledColumnStMan, and casacore::TiledShapeStMan.

## canAddRow()

Bool casacore::TiledStMan::canAddRow | ( |  | ) | const

virtual

Does the storage manager allow to add rows?

(yes)

Reimplemented from casacore::DataManager.

## canChangeShape()

virtual Bool casacore::TiledStMan::canChangeShape | ( |  | ) | const

virtual

Can the tiled storage manager handle changing array shapes?

The default is no (but TiledCellStMan can).

Reimplemented in casacore::TiledCellStMan.

## canReallocateColumns()

Bool casacore::TiledStMan::canReallocateColumns | ( |  | ) | const

virtual

The TiledStMan wants to do reallocateColumn.

Reimplemented from casacore::DataManager.

## checkAddHypercube()

void casacore::TiledStMan::checkAddHypercube | ( | const IPosition & | cubeShape,
|  | const Record & | values ) const

protected

Check if the hypercube to be added is correctly defined.

References casacore::Record().

## checkCoordinates()

void casacore::TiledStMan::checkCoordinates | ( | const PtrBlock< TSMColumn * > & | coordColSet,
|  | const IPosition & | cubeShape,
|  | const Record & | values ) const

protected

Check if the coordinate values are correct.

This calls checkValues and checks if their shapes match the hypercube shape. An exception is thrown if invalid.

References casacore::Record().

## checkCoordinatesShapes()

void casacore::TiledStMan::checkCoordinatesShapes | ( | const TSMCube * | hypercube,
|  | const IPosition & | cubeShape ) const

protected

Check if the cube shape matches that of defined coordinates.

## checkCubeShape()

void casacore::TiledStMan::checkCubeShape | ( | const TSMCube * | hypercube,
|  | const IPosition & | cubeShape ) const

Check the shape to be set for a hypercube.

It checks if it matches predefined (fixed shape) columns and the shape of already defined coordinate columns.

## checkShapeColumn()

void casacore::TiledStMan::checkShapeColumn | ( | const IPosition & | shape | ) | const

protected

Check if the shapes of FixedShape data and coordinate columns match.

An exception is thrown if not.

References casacore::shape().

## checkValues()

void casacore::TiledStMan::checkValues | ( | const PtrBlock< TSMColumn * > & | colSet,
|  | const Record & | values ) const

protected

Check if values are given in the record for all columns in the block.

Also check if the data types are correct. An exception is thrown if something is incorrect.

References casacore::Record().

## coordinateDataType()

int casacore::TiledStMan::coordinateDataType | ( | const String & | columnName | ) | const

Get the data type of the coordinate column with the given name.

An exception is thrown when the column is unknown.

## createFile()

void casacore::TiledStMan::createFile | ( | uInt | index | ) |

protected

Create a TSMFile object and store its pointer at the given index in the block.

## dataManagerName()

virtual String casacore::TiledStMan::dataManagerName | ( |  | ) | const

virtual

Get the name given to the storage manager.

This is the name of the hypercolumn.

Reimplemented from casacore::DataManager.

## dataManagerSpec()

virtual Record casacore::TiledStMan::dataManagerSpec | ( |  | ) | const

virtual

Return a record containing data manager specifications.

Reimplemented from casacore::DataManager.

Reimplemented in casacore::TiledShapeStMan.

References casacore::Record().

## defaultTileShape()

virtual IPosition casacore::TiledStMan::defaultTileShape | ( |  | ) | const

virtual

Get the default tile shape.

By default it returns a zero-length IPosition.

Reimplemented in casacore::TiledCellStMan, casacore::TiledColumnStMan, and casacore::TiledShapeStMan.

## deleteManager()

virtual void casacore::TiledStMan::deleteManager | ( |  | ) |

virtual

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.

## emptyCaches()

void casacore::TiledStMan::emptyCaches | ( |  | ) |

Empty 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. It also clears the userSetCache flag.

## flushCaches()

Bool casacore::TiledStMan::flushCaches | ( | Bool | fsync | ) |

protected

Flush the caches of all hypercubes.

If data have put and fsync is set, fsync all files.

## getBindings()

uInt casacore::TiledStMan::getBindings | ( | const Vector< String > & | columnNames,
|  | PtrBlock< TSMColumn * > & | colSet,
|  | Bool | mustExist ) const

protected

Get the bindings of the columns with the given names.

If bound, the pointer to the TSMColumn object is stored in the block. If mustExist is True, an exception is thrown if the column is not bound. It returns the number of bound columns.

## getCubeIndex()

Int casacore::TiledStMan::getCubeIndex | ( | const Record & | idValues | ) | const

protected

Get the index of the hypercube with the given id-values.

If not found, -1 is returned.

References casacore::Record().

## getDataColumn()

const TSMDataColumn * casacore::TiledStMan::getDataColumn | ( | uInt | colnr | ) | const

inline

Get pointer to data column object.

Definition at line 381 of file TiledStMan.h.

References dataCols_p.

## getDesc()

virtual const TableDesc & casacore::TiledStMan::getDesc | ( |  | ) | const

protected virtual

Get the table description needed for the hypercolumn description.

Reimplemented in casacore::TiledFileHelper.

## getFile()

TSMFile * casacore::TiledStMan::getFile | ( | uInt | sequenceNumber | ) |

Get the TSMFile object with the given sequence number.

## getHypercube() [1/3]

const TSMCube * casacore::TiledStMan::getHypercube | ( | rownr_t | rownr | ) | const

inline

Get the hypercube in which the given row is stored.

Definition at line 547 of file TiledStMan.h.

References getHypercube(), and TiledStMan().

Referenced by getHypercube().

## getHypercube() [2/3]

virtual TSMCube * casacore::TiledStMan::getHypercube | ( | rownr_t | rownr | ) |

pure virtual

Implemented in casacore::TiledCellStMan, casacore::TiledColumnStMan, casacore::TiledDataStMan, casacore::TiledFileHelper, and casacore::TiledShapeStMan.

## getHypercube() [3/3]

virtual TSMCube * casacore::TiledStMan::getHypercube | ( | rownr_t | rownr,
|  | IPosition & | position )

pure virtual

Get the hypercube in which the given row is stored.

It also returns the position of the row in that hypercube.

Implemented in casacore::TiledCellStMan, casacore::TiledColumnStMan, casacore::TiledDataStMan, casacore::TiledFileHelper, and casacore::TiledShapeStMan.

## getLengthOffset()

uInt64 casacore::TiledStMan::getLengthOffset | ( | uInt64 | nrPixels,
|  | Block< uInt > & | dataOffset,
|  | Block< uInt > & | localOffset,
|  | uInt & | localTileLength ) const

Get the length of the data for the given number of pixels.

This can be used to calculate the length of a tile.

## getProperties()

virtual Record casacore::TiledStMan::getProperties | ( |  | ) | const

virtual

Get data manager properties that can be modified.

It is only MaxCacheSize (the maximum cache size in MibiByte). It is a subset of the data manager specification.

Reimplemented from casacore::DataManager.

References casacore::Record().

## getTSMCube() [1/2]

TSMCube * casacore::TiledStMan::getTSMCube | ( | uInt | hypercube | ) |

## getTSMCube() [2/2]

const TSMCube * casacore::TiledStMan::getTSMCube | ( | uInt | hypercube | ) | const

inline

Get the given hypercube.

Definition at line 544 of file TiledStMan.h.

References getTSMCube(), and TiledStMan().

Referenced by getTSMCube().

## hasMultiFileSupport()

virtual Bool casacore::TiledStMan::hasMultiFileSupport | ( |  | ) | const

virtual

The data manager supports use of MultiFile.

Reimplemented from casacore::DataManager.

## headerFileClose()

void casacore::TiledStMan::headerFileClose | ( | AipsIO * | headerFile | ) |

protected

Close the header file.

It deletes the AipsIO object.

## headerFileCreate()

AipsIO * casacore::TiledStMan::headerFileCreate | ( |  | ) |

protected

Create the TSM header file.

It creates an AipsIO object for it.

## headerFileGet()

uInt casacore::TiledStMan::headerFileGet | ( | AipsIO & | headerFile,
|  | rownr_t | tabNrrow,
|  | Bool | firstTime,
|  | Int | extraNdim )

protected

Read the data from the header file.

When done for the first time, setup() is called to initialize the various variables (using the extraNdim variable). It returns the version of the AipsIO object in the header.

## headerFileOpen()

AipsIO * casacore::TiledStMan::headerFileOpen | ( |  | ) |

protected

Open the TSM header file.

It creates an AipsIO object for it.

## headerFilePut()

void casacore::TiledStMan::headerFilePut | ( | AipsIO & | headerFile,
|  | uInt64 | nrCube )

protected

Write the data into the header file.

The given number of TSMCube objects have to be written.

## hypercubeShape()

const IPosition & casacore::TiledStMan::hypercubeShape | ( | rownr_t | rownr | ) | const

Get the hypercube shape of the data in the given row.

Referenced by makeTileShape(), and makeTileShape().

## initCoordinates()

void casacore::TiledStMan::initCoordinates | ( | TSMCube * | hypercube | ) |

Initialize the new coordinates for the given cube.

## makeDirArrColumn()

DataManagerColumn * casacore::TiledStMan::makeDirArrColumn | ( | const String & | name,
|  | int | dataType,
|  | const String & | dataTypeID )

virtual

Create a direct array column.

Implements casacore::DataManager.

References casacore::dataType(), and casacore::name().

## makeHypercube()

TSMCube * casacore::TiledStMan::makeHypercube | ( | const IPosition & | cubeShape,
|  | const IPosition & | tileShape,
|  | const Record & | values )

protected

Make a new TSMCube object.

References casacore::Record(), and tileShape().

## makeIndArrColumn()

DataManagerColumn * casacore::TiledStMan::makeIndArrColumn | ( | const String & | name,
|  | int | dataType,
|  | const String & | dataTypeID )

virtual

Create an indirect array column.

Implements casacore::DataManager.

References casacore::dataType(), and casacore::name().

## makeScalarColumn()

DataManagerColumn * casacore::TiledStMan::makeScalarColumn | ( | const String & | name,
|  | int | dataType,
|  | const String & | dataTypeID )

virtual

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

Create a scalar column.

Implements casacore::DataManager.

References casacore::dataType(), and casacore::name().

## makeTileShape() [1/2]

IPosition casacore::TiledStMan::makeTileShape | ( | const IPosition & | hypercubeShape,
|  | const Vector< double > & | weight,
|  | const Vector< double > & | tolerance,
|  | uInt64 | maxNrPixelsPerTile = 4 *1024 *1024 )

static

References hypercubeShape().

## makeTileShape() [2/2]

IPosition casacore::TiledStMan::makeTileShape | ( | const IPosition & | hypercubeShape,
|  | Double | tolerance = 0.5,
|  | uInt64 | maxNrPixelsPerTile = 4 *1024 *1024 )

static

Derive the tile shape from the hypercube shape for the given number of pixels per tile.

It is tried to get the same number of tiles for each dimension. When a weight vector is given, the number of tiles for a dimension is proportional to the weight.
After the initial guess it tries to optimize it by trying to waste as little space as possible, while trying to keep as close to the initial guess. The given tolerance (possibly per axis) gives the minimum and maximum possible length of a tile axis (minimum = initial_guess*tolerance; maximum = initial_guess/tolerance). The heuristic is such that a tile axis length dividing the cube length exactly is always favoured. The test program tTiledStMan can be used to see how the algorithm works out for a given tile size and cube shape.

References hypercubeShape().

## makeTSMCube()

TSMCube * casacore::TiledStMan::makeTSMCube | ( | TSMFile * | file,
|  | const IPosition & | cubeShape,
|  | const IPosition & | tileShape,
|  | const Record & | values,
|  | Int64 | fileOffset = -1 )

Make the correct TSMCube type (depending on tsmOption()).

References casacore::Record(), and tileShape().

## maximumCacheSize()

uInt casacore::TiledStMan::maximumCacheSize | ( |  | ) | const

inline

Get the current maximum cache size (in MiB (MibiByte)).

Definition at line 529 of file TiledStMan.h.

References maxCacheSize_p.

Referenced by casacore::TiledCellStMan::TiledCellStMan(), casacore::TiledColumnStMan::TiledColumnStMan(), casacore::TiledDataStMan::TiledDataStMan(), and casacore::TiledShapeStMan::TiledShapeStMan().

## nhypercubes()

uInt casacore::TiledStMan::nhypercubes | ( |  | ) | const

inline

Return the number of hypercubes.

Definition at line 538 of file TiledStMan.h.

References cubeSet_p.

## nrCoordVector()

uInt casacore::TiledStMan::nrCoordVector | ( |  | ) | const

inline

Get the number of coordinate vectors.

Definition at line 532 of file TiledStMan.h.

References nrCoordVector_p.

## nrow()

rownr_t casacore::TiledStMan::nrow | ( |  | ) | const

inline

Get the nr of rows in this storage manager.

Definition at line 535 of file TiledStMan.h.

References nrrow_p.

Referenced by casacore::TiledShapeStMan::extendRowMap().

## open64()

virtual rownr_t casacore::TiledStMan::open64 | ( | rownr_t | nrrow,
|  | AipsIO & | )

virtual

Open the storage manager for an existing table.

Reimplemented from casacore::DataManager.

## operator=()

TiledStMan & casacore::TiledStMan::operator= | ( | const TiledStMan & |  | ) |

delete

Forbid assignment.

References TiledStMan().

## readHeader()

virtual void casacore::TiledStMan::readHeader | ( | rownr_t | nrrow,
|  | Bool | firstTime )

protected pure virtual

Let a derived class read the header info.

This is used by the open and resync function.

Implemented in casacore::TiledCellStMan, casacore::TiledColumnStMan, casacore::TiledDataStMan, casacore::TiledFileHelper, and casacore::TiledShapeStMan.

## readTile()

void casacore::TiledStMan::readTile | ( | char * | local,
|  | const Block< uInt > & | localOffset,
|  | const char * | external,
|  | const Block< uInt > & | externalOffset,
|  | uInt | nrpixels )

Read a tile and convert the data to local format.

## reallocateColumn()

DataManagerColumn * casacore::TiledStMan::reallocateColumn | ( | DataManagerColumn * | column | ) |

virtual

Reallocate the column object if it is part of this data manager.

It returns a pointer to the new column object. It is used to remove the indirection of the TSMColumn objects resulting in only one iso. two virtual column calls to get the data.

Reimplemented from casacore::DataManager.

## reopenRW()

virtual void casacore::TiledStMan::reopenRW | ( |  | ) |

virtual

Reopen all files used in this storage manager for read/write access.

Reimplemented from casacore::DataManager.

## resync64()

virtual rownr_t casacore::TiledStMan::resync64 | ( | rownr_t | nrrow | ) |

virtual

Resync the storage manager with the new file contents.

Reimplemented from casacore::DataManager.

## setCacheSize() [1/2]

void casacore::TiledStMan::setCacheSize | ( | rownr_t | rownr,
|  | const IPosition & | sliceShape,
|  | const IPosition & | windowStart,
|  | const IPosition & | windowLength,
|  | const IPosition & | axisPath,
|  | Bool | forceSmaller )

Set the cache size using the calcCacheSize function mentioned above.

## setCacheSize() [2/2]

void casacore::TiledStMan::setCacheSize | ( | rownr_t | rownr,
|  | uInt | nbuckets,
|  | Bool | forceSmaller )

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.
A flag is set indicating that the TSMDataColumn access functions do not need to size the cache.

## setDataChanged()

void casacore::TiledStMan::setDataChanged | ( |  | ) |

inline

Set the flag to "data has changed since last flush".

Definition at line 541 of file TiledStMan.h.

References dataChanged_p, and casacore::True.

## setDataManagerName()

void casacore::TiledStMan::setDataManagerName | ( | const String & | newHypercolumnName | ) |

## setHypercubeCacheSize()

void casacore::TiledStMan::setHypercubeCacheSize | ( | uInt | hypercube,
|  | uInt | nbuckets,
|  | Bool | forceSmaller )

Sets the cache size using the hypercube instead of the row number.

Useful for iterating over all hypercubes.

## setMaximumCacheSize()

virtual void casacore::TiledStMan::setMaximumCacheSize | ( | uInt | nMiB | ) |

virtual

Set the maximum cache size (in MiB) in a non-persistent way.

Reimplemented from casacore::DataManager.

## setPersMaxCacheSize()

void casacore::TiledStMan::setPersMaxCacheSize | ( | uInt | nMiB | ) |

inline protected

Set the persistent maximum cache size (in MiB).

Definition at line 550 of file TiledStMan.h.

References maxCacheSize_p, and persMaxCacheSize_p.

## setProperties()

virtual void casacore::TiledStMan::setProperties | ( | const Record & | spec | ) |

virtual

Modify data manager properties.

Only MaxCacheSize can be used. It is similar to function setCacheSize with canExceedNrBuckets=False.

Reimplemented from casacore::DataManager.

References casacore::Record().

## setShape()

virtual void casacore::TiledStMan::setShape | ( | rownr_t | rownr,
|  | TSMCube * | hypercube,
|  | const IPosition & | shape,
|  | const IPosition & | tileShape )

virtual

Set the shape and tile shape of a hypercube.

By default it throws an "impossible" exception.

Reimplemented in casacore::TiledCellStMan, and casacore::TiledShapeStMan.

References casacore::shape(), and tileShape().

## setup()

void casacore::TiledStMan::setup | ( | Int | extraNdim = -1 | ) |

protected

Set up the TiledStMan variables from the table description.

The argument specifies the number of extra dimensions for the hypercube compared to the data array (usually 0 or 1). It is only used if no hypercolumn definition exists. -1 means that the hypercolumn definition has to be present.

## setupCheck()

virtual void casacore::TiledStMan::setupCheck | ( | const TableDesc & | tableDesc,
|  | const Vector< String > & | dataNames ) const

protected virtual

Function setup calls this function to allow the derived class to check specific information.

In case of errors, an exception should be thrown. By default it does nothing.

Reimplemented in casacore::TiledCellStMan, casacore::TiledColumnStMan, and casacore::TiledShapeStMan.

## showCacheStatistics()

void casacore::TiledStMan::showCacheStatistics | ( | ostream & | os | ) | const

Show the statistics of all caches used.

## singleHypercube()

virtual TSMCube * casacore::TiledStMan::singleHypercube | ( |  | ) |

virtual

Test if only one hypercube is used by this storage manager.

If not, throw an exception. Otherwise return the hypercube.

Reimplemented in casacore::TiledShapeStMan.

## tileShape()

const IPosition & casacore::TiledStMan::tileShape | ( | rownr_t | rownr | ) | const

Get the tile shape of the data in the given row.

Referenced by casacore::TiledDataStMan::addHypercube(), casacore::TiledShapeStMan::addHypercube(), makeHypercube(), makeTSMCube(), casacore::TiledCellStMan::setShape(), casacore::TiledShapeStMan::setShape(), setShape(), and casacore::TiledColumnStMan::TiledColumnStMan().

## userSetCache()

Bool casacore::TiledStMan::userSetCache | ( | rownr_t | rownr | ) | const

Determine if the user set the cache size (using setCacheSize).

## writeTile()

void casacore::TiledStMan::writeTile | ( | char * | external,
|  | const Block< uInt > & | externalOffset,
|  | const char * | local,
|  | const Block< uInt > & | localOffset,
|  | uInt | nrpixels )

Write a tile after converting the data to external format.

## Member Data Documentation

## colSet_p

PtrBlock<TSMColumn*> casacore::TiledStMan::colSet_p

protected

The assembly of all columns.

Definition at line 500 of file TiledStMan.h.

## coordColSet_p

PtrBlock<TSMColumn*> casacore::TiledStMan::coordColSet_p

protected

The assembly of all coordinate columns.

Definition at line 507 of file TiledStMan.h.

## cubeSet_p

PtrBlock<TSMCube*> casacore::TiledStMan::cubeSet_p

protected

The assembly of all TSMCube objects.

Definition at line 513 of file TiledStMan.h.

Referenced by nhypercubes().

## dataChanged_p

Bool casacore::TiledStMan::dataChanged_p

protected

Has any data changed since the last flush?

Definition at line 525 of file TiledStMan.h.

Referenced by setDataChanged().

## dataCols_p

PtrBlock<TSMDataColumn*> casacore::TiledStMan::dataCols_p

protected

The assembly of all data columns.

Definition at line 502 of file TiledStMan.h.

Referenced by getDataColumn().

## dataColSet_p

PtrBlock<TSMColumn*> casacore::TiledStMan::dataColSet_p

protected

Definition at line 503 of file TiledStMan.h.

## fileSet_p

PtrBlock<TSMFile*> casacore::TiledStMan::fileSet_p

protected

The assembly of all TSMFile objects.

The first file is for all non-extensible cubes, while the others are for one file per extensible cube.

Definition at line 511 of file TiledStMan.h.

Referenced by casacore::TiledFileHelper::file().

## fixedCellShape_p

IPosition casacore::TiledStMan::fixedCellShape_p

protected

The fixed cell shape.

Definition at line 523 of file TiledStMan.h.

## hypercolumnName_p

String casacore::TiledStMan::hypercolumnName_p

protected

The name of the hypercolumn.

Definition at line 496 of file TiledStMan.h.

## idColSet_p

PtrBlock<TSMColumn*> casacore::TiledStMan::idColSet_p

protected

The assembly of all id columns.

Definition at line 505 of file TiledStMan.h.

## maxCacheSize_p

uInt casacore::TiledStMan::maxCacheSize_p

protected

The actual maximum cache size for a hypercube (in MiB).

Definition at line 517 of file TiledStMan.h.

Referenced by maximumCacheSize(), and setPersMaxCacheSize().

## nrCoordVector_p

uInt casacore::TiledStMan::nrCoordVector_p

protected

The number of vector coordinates.

Definition at line 521 of file TiledStMan.h.

Referenced by nrCoordVector().

## nrdim_p

uInt casacore::TiledStMan::nrdim_p

protected

The dimensionality of the hypercolumn.

Definition at line 519 of file TiledStMan.h.

## nrrow_p

rownr_t casacore::TiledStMan::nrrow_p

protected

The number of rows in the columns.

Definition at line 498 of file TiledStMan.h.

Referenced by nrow().

## persMaxCacheSize_p

uInt casacore::TiledStMan::persMaxCacheSize_p

protected

The persistent maximum cache size (in MiB) for a hypercube.

Definition at line 515 of file TiledStMan.h.

Referenced by setPersMaxCacheSize().

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

- tables/DataMan/TiledStMan.h