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.
Tiled storage managers make access to array data possible with more or less the same efficiency for access along different axes.
Create a TiledStMan storage manager. The given maximum cache size 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.
Get the name given to the storage manager. This is the name of the hypercolumn.
Record a record containing data manager specifications.
Set the flag to "data has changed since last flush".
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.
Set the maximum cache size (in bytes) in a non-persistent way.
Get the current 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.
Can the tiled storage manager handle changing array shapes? The default is no (but TiledCellStMan can).
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. reask is set to True (because next time things might be different).
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.
Set the cache size using the 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.
A flag is set indicating that the TSMDataColumn
access functions do not need to size the cache.
Determine if the user set the cache size (using setCacheSize).
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.
Show the statistics of all caches used.
Get the length of the data for the given number of pixels. This can be used to calculate the length of a tile.
Get the number of coordinate vectors.
Get the nr of rows in this storage manager.
Does the storage manager allow to add rows? (yes)
Get the default tile shape. By default it returns a zero-length IPosition.
Return the number of hypercubes.
Test if only one hypercube is used by this storage manager. If not, throw an exception. Otherwise return the hypercube.
Get the given hypercube.
Get the hypercube in which the given row is stored.
Get the hypercube in which the given row is stored. It also returns the position of the row in that hypercube.
Read a tile and convert the data to local format.
Write a tile after converting the data to external format.
Get the TSMFile object with the given sequence number.
Open the storage manager for an existing table.
Resync the storage manager with the new file contents.
Reopen all files used in this storage manager for read/write access.
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).
Create a column in the storage manager on behalf of a table column.
Create a scalar column.
Create a column in the storage manager on behalf of a table column.
Create a direct array column.
Create a column in the storage manager on behalf of a table column.
Create an indirect array column.
The TiledStMan wants to do reallocateColumn.
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.
Set the shape and tile shape of a hypercube. By default it throws an "impossible" exception.
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.
Get the data type of the coordinate column with the given name. An exception is thrown when the column is unknown.
Initialize the new coordinates for the given cube.
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.
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.
Get the table description needed for the hypercolumn description.
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.
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.
Check if the shapes of FixedShape data and coordinate columns match. An exception is thrown if not.
Check if the cube shape matches that of defined coordinates.
Check if the hypercube to be added is correctly defined.
Make a new TSMCube object.
Get the index of the hypercube with the given id-values. If not found, -1 is returned.
Determine how many rows need to be added for an extension (in the last dimension) of a hypercube with the given shape.
Flush the caches of all hypercubes. If data have put and fsync is set, fsync all files.
Let a derived class read the header info. This is used by the open and resync function.
Create the TSM header file. It creates an AipsIO object for it.
Open the TSM header file. It creates an AipsIO object for it.
Write the data into the header file. The given number of TSMCube objects have to be written.
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).
Close the header file. It deletes the AipsIO object.
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.
Create a TSMFile object and store its pointer at the given index in the block.
Convert the scalar data type to an array data type. This function is temporary and can disappear when the ColumnDesc classes use type TpArray*.