28 #ifndef TABLES_ISMBASE_H
29 #define TABLES_ISMBASE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/DataMan/DataManager.h>
35 #include <casacore/casa/Containers/Block.h>
36 #include <casacore/casa/iosfwd.h>
234 rownr_t& offendingBucketStartRow,
235 uInt& offendingBucketNrow,
236 uInt& offendingBucketNr,
309 const String& dataTypeID);
313 const String& dataTypeID);
317 const String& dataTypeID);
Cache for buckets in a part of a file.
OpenOption
Define the possible ByteIO open options.
Abstract base class for a data manager.
rownr_t nrrow_p
The number of rows in the columns.
virtual Record getProperties() const
Get data manager properties that can be modified.
virtual void create64(rownr_t nrrow)
Let the storage manager create files as needed for a new table.
PtrBlock< ISMColumn * > colSet_p
The assembly of all columns.
void readIndex()
Read the index (at the end of the file).
virtual void setProperties(const Record &spec)
Modify data manager properties.
ISMBase(const ISMBase &that)
Copy constructor (only meant for clone function).
virtual rownr_t open64(rownr_t nrrow, AipsIO &)
Open the storage manager file for an existing table, read in the data, and let the ISMColumn objects ...
virtual void addColumn(DataManagerColumn *)
Do the final addition of a column.
char * tempBuffer() const
Get access to the temporary buffer.
char * tempBuffer_p
A temporary read/write buffer (also for other classes).
uInt uniqnr_p
Unique nr for column in this storage manager.
ISMIndex * index_p
The ISM bucket index.
virtual Bool flush(AipsIO &, Bool fsync)
Flush and optionally fsync the data.
Bool checkBucketLayout(uInt &offendingCursor, rownr_t &offendingBucketStartRow, uInt &offendingBucketNrow, uInt &offendingBucketNr, uInt &offendingCol, uInt &ffendingIndex, rownr_t &offendingRow, rownr_t &offendingPrevRow)
Check that there are no repeated rowIds in the buckets comprising this ISM.
uInt bucketSize_p
The bucket size.
ISMBase & operator=(const ISMBase &that)
Assignment cannot be used.
virtual Bool canAddRow() const
Can the storage manager add rows? (yes)
uInt bucketSize() const
Get the bucket size (in bytes).
rownr_t nrow() const
Get the number of rows in this storage manager.
virtual String dataManagerName() const
Get the name given to the storage manager (in the constructor).
ISMColumn & getColumn(uInt colnr)
Get access to the given column.
ISMIndex & getIndex()
Get the index object.
void setCacheSize(uInt cacheSize, Bool canExceedNrBuckets)
Set the cache size (in buckets).
void showIndexStatistics(ostream &os)
Show the index statistics.
void setBucketDirty()
Make the current bucket in the cache dirty (i.e.
uInt rownrSize() const
Get the size of a rownr in external format (can be canonical or local).
virtual String dataManagerType() const
Get the type name of the data manager (i.e.
uInt nbucketInit_p
The initial number of buckets in the cache.
uInt persCacheSize_p
The persistent cache size.
virtual Record dataManagerSpec() const
Record a record containing data manager specifications.
uInt version_p
The version of the class.
virtual void reopenRW()
Reopen the storage manager files for read/write.
void recreate()
(Re)create the index, file, and cache object.
Bool checkBucketSize_p
Check a positive bucketsize?
virtual void removeColumn(DataManagerColumn *)
Remove a column from the data file and the colSet_p.
StManArrayFile * iosfile_p
The file containing the indirect arrays.
void init()
Let the storage manager initialize itself.
BucketCache & getCache()
Get the cache object.
virtual void showCacheStatistics(ostream &os) const
Show the statistics of all caches used.
uInt uniqueNr()
Get a unique column number for the column (it is only unique for this storage manager).
virtual DataManagerColumn * makeDirArrColumn(const String &name, int dataType, const String &dataTypeID)
Create a direct array column.
void makeIndex()
Construct the index object (if not constructed yet) and read it.
uInt nFreeBucket_p
The nr of free buckets.
uInt uIntSize_p
The size of a uInt in external format (local or canonical).
Bool dataChanged_p
Has the data changed since the last flush?
String dataManName_p
Name of data manager.
virtual rownr_t resync64(rownr_t nrrow)
Resync the storage manager with the new file contents.
virtual Bool canRemoveColumn() const
Can the storage manager delete columns? (not yet)
virtual DataManagerColumn * makeScalarColumn(const String &name, int dataType, const String &dataTypeID)
Create a column in the storage manager on behalf of a table column.
ISMBase(const String &aDataManName, const Record &spec)
Create an incremental storage manager with the given name.
uInt rownrSize_p
The size of a rownr in external format (local or canonical).
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).
uInt cacheSize_p
The actual cache size.
void clearCache()
Clear the cache used by this storage manager.
uInt version() const
Get the version of the class.
void addBucket(rownr_t rownr, ISMBucket *bucket)
Add a bucket to the storage manager (i.e.
virtual Bool hasMultiFileSupport() const
The data manager supports use of MultiFile.
uInt cacheSize() const
Get the current cache size (in buckets).
ISMBucket * getBucket(rownr_t rownr, rownr_t &bucketStartRow, rownr_t &bucketNrrow)
Get the bucket containing the given row.
void writeIndex()
Write the index (at the end of the file).
Int firstFree_p
The first free bucket.
ISMBucket * nextBucket(uInt &cursor, rownr_t &bucketStartRow, rownr_t &bucketNrrow)
Get the next bucket.
BucketFile * file_p
The file containing all data.
virtual Bool canAddColumn() const
Can the storage manager add columns? (not yet)
BucketCache * cache_p
The cache with the ISM buckets.
virtual DataManagerColumn * makeIndArrColumn(const String &name, int dataType, const String &dataTypeID)
Create an indirect array column.
static DataManager * makeObject(const String &dataManagerType, const Record &spec)
Make the object from the type name string.
ISMBase(const String &dataManagerName, uInt bucketSize, Bool checkBucketSize, uInt cacheSize)
Create an incremental storage manager with the given name.
void makeCache()
Construct the cache object (if not constructed yet).
uInt uIntSize() const
Get the size of a uInt in external format (can be canonical or local).
virtual void addRow64(rownr_t nrrow)
Add rows to the storage manager.
ISMBase(uInt bucketSize=0, Bool checkBucketSize=True, uInt cacheSize=1)
Create an incremental storage manager without a name.
StManArrayFile * openArrayFile(ByteIO::OpenOption opt)
Open (if needed) the file for indirect arrays with the given mode.
virtual Bool canRemoveRow() const
Can the storage manager delete rows? (yes)
void showBucketLayout(ostream &os)
Show the layout of the buckets.
virtual void removeRow64(rownr_t rownr)
Delete a row from all columns.
A drop-in replacement for Block<T*>.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.