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