Go to the documentation of this file.
28 #ifndef TABLES_SSMBASE_H
29 #define TABLES_SSMBASE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/DataMan/DataManager.h>
35 #include <casacore/casa/Containers/Block.h>
45 class SSMStringHandler;
293 const char* aBucket);
366 const String& aDataTypeID);
370 const String& aDataTypeID);
374 const String& aDataTypeID);
StManArrayFile * itsIosFile
The file containing the indirect arrays.
SSMBase(const SSMBase &that)
Copy constructor (only meant for clone function).
static void writeCallBack(void *anOwner, char *aBucketStorage, const char *aBucket)
virtual Record getProperties() const
Get data manager properties that can be modified.
BucketCache * itsCache
The cache with the SSM buckets.
void setBucketDirty()
Make the current bucket in the cache dirty (i.e.
virtual String dataManagerName() const
Get the name given to the storage manager (in the constructor).
virtual void open(uInt aRowNr, AipsIO &)
Open the storage manager file for an existing table, read in the data, and let the SSMColumn objects ...
Abstract base class for a data manager.
OpenOption
Define the possible ByteIO open options.
virtual void setProperties(const Record &spec)
Modify data manager properties.
void showBaseStatistics(ostream &anOs) const
Show statistics of the Base offsets/index etc.
uInt itsIndexLength
length of index memoryblock
uInt getVersion() const
Get the version of the class.
A drop-in replacement for Block<T*>.
Int itsFirstIdxBucket
Number of the first index bucket.
Block< uInt > itsColIndexMap
Row Index ID containing all the columns in a bucket.
SSMBase & operator=(const SSMBase &that)
Assignment cannot be used.
SSMBase(const String &aDataManName, const Record &spec)
Create a Standard storage manager with the given name.
uInt itsCacheSize
The actual cache size.
String itsDataManName
Name of data manager.
Cache for buckets in a part of a file.
virtual Bool canRemoveRow() const
The storage manager can delete rows.
uInt getNRow() const
Get the number of rows in this storage manager.
virtual void addColumn(DataManagerColumn *)
Do the final addition of a column.
virtual void removeRow(uInt aRowNr)
Delete a row from all columns.
Abstract base class for a column in a data manager.
void readIndexBuckets()
Read the index from its buckets.
SSMBase(Int aBucketSize=0, uInt aCacheSize=1)
Create a Standard storage manager with default name SSM.
void setCacheSize(uInt aCacheSize, Bool canExceedNrBuckets=True)
Set the cache size (in buckets).
uInt setBucketSize()
Determine and set the bucket size.
uInt itsIdxBucketOffset
Offset of index in first bucket.
void clearCache()
Clear the cache used by this storage manager.
uInt itsFreeBucketsNr
The nr of free buckets.
virtual DataManagerColumn * makeScalarColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create a column in the storage manager on behalf of a table column.
SSMStringHandler * getStringHandler()
Return a pointer to the (one and only) StringHandler object.
Int itsFirstFreeBucket
The first free bucket.
uInt itsBucketSize
The bucket size.
virtual Bool hasMultiFileSupport() const
The data manager supports use of MultiFile.
virtual void removeColumn(DataManagerColumn *)
Remove a column from the data file.
virtual void showCacheStatistics(ostream &anOs) const
Show the statistics of all caches used.
uInt getNewBucket()
Add a new bucket and get its bucket number.
Int itsLastStringBucket
Number of the first String Bucket.
static DataManager * makeObject(const String &aDataManType, const Record &spec)
Make the object from the type name string.
void recreate()
(Re)create the index, file, and cache object.
virtual DataManagerColumn * makeIndArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create an indirect array column.
virtual Bool canAddRow() const
The storage manager can add rows.
virtual DataManager * clone() const
Clone this object.
virtual void deleteManager()
The data manager will be deleted (because all its columns are requested to be deleted).
Bool isDataChanged
Has the data changed since the last flush?
void makeCache()
Construct the cache object (if not constructed yet).
static void deleteCallBack(void *, char *aBucket)
void readHeader()
Read the header.
void showIndexStatistics(ostream &anOs) const
Show statistics of all indices used.
this file contains all the compiler specific defines
uInt getBucketSize() const
Get the bucket size.
BucketFile * itsFile
The file containing all data.
virtual Bool canRemoveColumn() const
The storage manager can delete columns.
PtrBlock< SSMIndex * > itsPtrIndex
Will contain all indices.
PtrBlock< SSMColumn * > itsPtrColumn
The assembly of all columns.
virtual Bool flush(AipsIO &, Bool doFsync)
Flush and optionally fsync the data.
uInt getNrIndices() const
Get the number of indices in use.
virtual Record dataManagerSpec() const
Record a record containing data manager specifications.
uInt itsNrRows
The number of rows in the columns.
Block< uInt > itsColumnOffset
Column offset.
uInt getCacheSize() const
Get the current cache size (in buckets).
SSMBase(const String &aDataManName, Int aBucketSize=0, uInt aCacheSize=1)
Create a Standard storage manager with the given name.
uInt itsNrBuckets
The initial number of buckets in the cache.
virtual void create(uInt aNrRows)
Let the storage manager create files as needed for a new table.
virtual DataManagerColumn * makeDirArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create a direct array column.
uInt getRowsPerBucket(uInt aColumn) const
Get rows per bucket for the given column.
static char * initCallBack(void *anOwner)
uInt itsPersCacheSize
The persistent cache size.
void writeIndex()
Write the header and the indices.
SSMIndex & getIndex(uInt anIdxNr)
Get access to the given Index.
StManArrayFile * openArrayFile(ByteIO::OpenOption anOpt)
Open (if needed) the file for indirect arrays with the given mode.
char * getBucket(uInt aBucketNr)
Read the bucket (if needed) and return the pointer to it.
String: the storage and methods of handling collections of characters.
bool Bool
Define the standard types used by Casacore.
virtual void reopenRW()
Reopen the storage manager files for read/write.
void removeBucket(uInt aBucketNr)
Remove a bucket from the bucket cache.
static char * readCallBack(void *anOwner, const char *aBucketStorage)
Callbacks for BucketCache access.
uInt itsNrIdxBuckets
Nr of buckets needed for index.
SSMStringHandler * itsStringHandler
String handler class.
BucketCache & getCache()
Get the cache object.
virtual void addRow(uInt aNrRows)
Add rows to the storage manager.
virtual Bool canAddColumn() const
The storage manager can add columns.
virtual void resync(uInt aRowNr)
Resync the storage manager with the new file contents.
void init()
Let the storage manager initialize itself (upon creation).
virtual String dataManagerType() const
Get the type name of the data manager (i.e.
char * find(uInt aRowNr, uInt aColNr, uInt &aStartRow, uInt &anEndRow, const String &colName)
Find the bucket containing the column and row and return the pointer to the beginning of the column d...
SSMColumn & getColumn(uInt aColNr)
Get access to the given column.