28 #ifndef TABLES_ISMBUCKET_H
29 #define TABLES_ISMBUCKET_H
159 const char* data,
uInt leng);
172 const char*
get (
uInt offset)
const;
241 static char*
readCallBack (
void* owner,
const char* bucketStorage);
259 void show (ostream& os)
const;
282 uInt fromIndex,
uInt toIndex)
const;
285 void read (
const char* bucketStorage);
288 void write (
char* bucketStorage)
const;
uInt getInterval(uInt colnr, rownr_t rownr, rownr_t bucketNrrow, rownr_t &start, rownr_t &end, uInt &offset) const
Get the row-interval for given column and row.
static void writeCallBack(void *owner, char *bucketStorage, const char *bucket)
Callback function when BucketCache writes a bucket.
Bool canAddData(uInt leng) const
Is the bucket large enough to add a value?
uInt getLength(uInt fixedLength, const char *data) const
Get the length of the data value.
PtrBlock< Block< rownr_t > * > rowIndex_p
The row index per column; each index contains the row number of each value stored in the bucket (for ...
ISMBase * stmanPtr_p
Pointer to the parent storage manager.
Block< uInt > & offIndex(uInt colnr)
Return the offsets of the values stored in the data part.
uInt getSplit(uInt totLeng, const Block< uInt > &rowLeng, const Block< uInt > &cumLeng)
Return the index where the bucket should be split to get two parts with almost identical length...
void addData(uInt colnr, rownr_t rownr, uInt index, const char *data, uInt leng)
Add the data to the data part.
void read(const char *bucketStorage)
Read the data from the storage into this bucket.
rownr_t split(ISMBucket *&left, ISMBucket *&right, Block< Bool > &duplicated, rownr_t bucketStartRow, rownr_t bucketNrrow, uInt colnr, rownr_t rownr, uInt lengToAdd)
Split the bucket in the middle.
const char * get(uInt offset) const
Get a pointer to the data for the given offset.
Bool canReplaceData(uInt newLeng, uInt oldLeng) const
Is the bucket large enough to replace a value?
Base class of the Incremental Storage Manager.
uInt indexLeng_p
The size (in bytes) of the index.
void copy(const ISMBucket &that)
Copy the contents of that bucket to this bucket.
Block< rownr_t > & rowIndex(uInt colnr)
Get access to the index information for the given column.
uInt insertData(const char *data, uInt leng)
Insert a data value by appending it to the end.
ISMBucket & operator=(const ISMBucket &)
Forbid assignment.
Block< uInt > indexUsed_p
Nr of used elements in each index; i.e.
uInt dataLeng_p
The size (in bytes) of the data.
Bool simpleSplit(ISMBucket *left, ISMBucket *right, Block< Bool > &duplicated, rownr_t &splitRownr, rownr_t rownr)
Determine whether a simple split is possible.
uInt & indexUsed(uInt colnr)
Return the number of values stored.
bool Bool
Define the standard types used by Casacore.
A drop-in replacement for Block<T*>.
A bucket in the Incremental Storage Manager.
uInt64 rownr_t
Define the type of a row number in a table.
PtrBlock< Block< uInt > * > offIndex_p
The offset index per column; each index contains the offset (in bytes) of each value stored in the bu...
uInt uIntSize_p
The size (in bytes) of an uInt and rownr_t (used in index, etc.).
void replaceData(uInt &offset, const char *data, uInt newLeng, uInt fixedLength)
Replace a data item.
void shiftLeft(uInt index, uInt nr, Block< rownr_t > &rowIndex, Block< uInt > &offIndex, uInt &nused, uInt leng)
Remove nr items from data and index part by shifting to the left.
static char * initCallBack(void *owner)
Callback function when BucketCache adds a new bucket to the data file.
char * data_p
The data space (in external (e.g.
Bool check(uInt &offendingCol, uInt &offendingIndex, rownr_t &offendingRow, rownr_t &offendingPrevRow) const
Check that there are no repeated rowIds in the bucket.
static char * readCallBack(void *owner, const char *bucketStorage)
Callback function when BucketCache reads a bucket.
uInt copyData(ISMBucket &other, uInt colnr, rownr_t toRownr, uInt fromIndex, uInt toIndex) const
Copy a data item from this bucket to the other bucket.
void removeData(uInt offset, uInt leng)
Remove a data item with the given length.
uInt & getOffset(uInt colnr, rownr_t rownr)
Get access to the offset of the data for given column and row.
static void deleteCallBack(void *, char *bucket)
Callback function when BucketCache removes a bucket from the cache.
void show(ostream &os) const
Show the layout of the bucket.
ISMBucket(ISMBase *parent, const char *bucketStorage)
Create a bucket with the given parent.
void write(char *bucketStorage) const
Write the bucket into the storage.