A CTDB_ON_TABLE_GET_RECLEN callback is invoked after FairCom DB data and index files are open and the T and CTDB_ON_TABLE_GET_SCHEMA and CTDB_ON_TABLE_GET_DODA callbacks have been invoked. This callback is also invoked after the FairCom DB data file record schema and DODA object are loaded into the table handle.
You can use the CTDB_ON_TABLE_GET_RECLEN callback event to control the length, in bytes, of the fixed portion of the record buffer. The handle passed to this callback is always a table handle and you can safely typecast the table handle to a pCTDBTABLE structure pointer.
The following CTDBTABLE structure members keep the length of the fixed portion of the record buffer:
CTDBTABLE Structure Member |
Explanation |
---|---|
VRLEN fixreclen |
length of fixed portion of record buffer |
By the time CTDB_ON_TABLE_GET_RECLEN callback is invoked, the fixreclen member of CTDBTABLE structure has already been calculated. You can use this event to modify the length of the fixed portion of the record buffer.
c-treeDB C API Example
CTDBRET ctdbDECL OnTableGetReclen(CTHANDLE Handle)
{
pCTDBTABLE pTable = (pCTDBTABLE)Handle;
if (pTable)
pTable->fixreclen = 16;
return CTDBRET_OK;
}