casacore
|
#include <SSMIndex.h>
Public Member Functions | |
SSMIndex (SSMBase *aPtrSSM, uInt rowsPerBucket=0) | |
Create the object with the given number of rows per bucket. More... | |
~SSMIndex () | |
void | get (AipsIO &anOs) |
Read the bucket index from the AipsIO object. More... | |
void | put (AipsIO &anOs) const |
Write the bucket index into the AipsIO object. More... | |
void | recreate () |
Recreate the object in case all rows are deleted from the table. More... | |
Vector< uInt > | getBuckets () const |
Return all the bucketnrs used in this index. More... | |
uInt | getNrBuckets () const |
Return the nr of buckets used. More... | |
void | setNrColumns (Int aNrColumns, uInt aSizeUsed) |
Set nr of columns use this index. More... | |
void | addRow (rownr_t aNrRows) |
Add some rows. More... | |
void | showStatistics (ostream &anOs) const |
Show Statistics of index. More... | |
Int | removeColumn (Int anOffset, uInt nbits) |
A column is removed. More... | |
Int | getFree (Int &anOffset, uInt nbits) const |
Try to find free space for a field with a given length (best fit). More... | |
void | addColumn (Int anOffset, uInt nbits) |
reuse the space at offset for a field with the given nr of bits. More... | |
Int | deleteRow (rownr_t aRowNumber) |
Delete the given row. More... | |
uInt | getRowsPerBucket () const |
Get the number of rows that fits in ach bucket. More... | |
void | find (rownr_t aRowNumber, uInt &aBucketNr, rownr_t &aStartRow, rownr_t &anEndRow, const String &colName) const |
Find the bucket containing the given row. More... | |
Private Member Functions | |
uInt | getIndex (rownr_t aRowNr, const String &colName) const |
Get the index of the bucket containing the given row. More... | |
Private Attributes | |
SSMBase * | itsSSMPtr |
uInt | itsNUsed |
Block< rownr_t > | itsLastRow |
Block< uInt > | itsBucketNumber |
std::map< Int, Int > | itsFreeSpace |
uInt | itsRowsPerBucket |
Int | itsNrColumns |
The bucket index for a group of columns in the Standard Storage Manager.
Internal
SSMIndex represent the bucket index in the Standard Storage Manager.
In SSMBase it is described that an index is used to map row number to data bucket in a bucket stream. This class implements this index. It serves 2 purposes:
Definition at line 86 of file SSMIndex.h.
Create the object with the given number of rows per bucket.
Note that the default is needed to create the object for existing tables.
casacore::SSMIndex::~SSMIndex | ( | ) |
reuse the space at offset for a field with the given nr of bits.
This is used when column has been added to this bucket.
void casacore::SSMIndex::addRow | ( | rownr_t | aNrRows | ) |
Add some rows.
Delete the given row.
It returns the bucket nr if it gets empty, otherwise -1.
void casacore::SSMIndex::find | ( | rownr_t | aRowNumber, |
uInt & | aBucketNr, | ||
rownr_t & | aStartRow, | ||
rownr_t & | anEndRow, | ||
const String & | colName | ||
) | const |
Find the bucket containing the given row.
An exception is thrown if not found. It also sets the first and last row number fitting in that bucket.
Try to find free space for a field with a given length (best fit).
-1 is returned if no fit is found. Otherwise it returns the nr of bytes left unused.
Get the index of the bucket containing the given row.
uInt casacore::SSMIndex::getNrBuckets | ( | ) | const |
Return the nr of buckets used.
|
inline |
Get the number of rows that fits in ach bucket.
Definition at line 177 of file SSMIndex.h.
References itsRowsPerBucket.
void casacore::SSMIndex::recreate | ( | ) |
Recreate the object in case all rows are deleted from the table.
A column is removed.
Set the free space at offset for a field with the given nr of bits. It returns the nr of columns still used in this index.
Set nr of columns use this index.
void casacore::SSMIndex::showStatistics | ( | ostream & | anOs | ) | const |
Show Statistics of index.
Definition at line 164 of file SSMIndex.h.
Definition at line 167 of file SSMIndex.h.
Definition at line 159 of file SSMIndex.h.
|
private |
Definition at line 173 of file SSMIndex.h.
|
private |
Definition at line 156 of file SSMIndex.h.
|
private |
Definition at line 170 of file SSMIndex.h.
Referenced by getRowsPerBucket().
|
private |
Definition at line 153 of file SSMIndex.h.